summaryrefslogtreecommitdiffstats
path: root/contrib/binutils
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1998-09-06 22:57:45 +0000
committerjdp <jdp@FreeBSD.org>1998-09-06 22:57:45 +0000
commit088484c9efa7b42bc7fcc180fd78fed96df31c63 (patch)
tree6c09c852a9bb7a6de448bb31aefcc26282130456 /contrib/binutils
parent857a03a573e70a598db37cc5e2751f5a6b09c020 (diff)
parenteffee09f856ecc81feb91290459a2cda49d20287 (diff)
downloadFreeBSD-src-088484c9efa7b42bc7fcc180fd78fed96df31c63.zip
FreeBSD-src-088484c9efa7b42bc7fcc180fd78fed96df31c63.tar.gz
This commit was generated by cvs2svn to compensate for changes in r38889,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/binutils')
-rw-r--r--contrib/binutils/Makefile.in335
-rw-r--r--contrib/binutils/README7
-rw-r--r--contrib/binutils/bfd/ChangeLog2401
-rw-r--r--contrib/binutils/bfd/Makefile.am977
-rw-r--r--contrib/binutils/bfd/Makefile.in1561
-rw-r--r--contrib/binutils/bfd/README4
-rw-r--r--contrib/binutils/bfd/acconfig.h6
-rw-r--r--contrib/binutils/bfd/acinclude.m467
-rw-r--r--contrib/binutils/bfd/aclocal.m4481
-rw-r--r--contrib/binutils/bfd/aout-target.h2
-rw-r--r--contrib/binutils/bfd/aout-tic30.c1062
-rw-r--r--contrib/binutils/bfd/aoutf1.h15
-rw-r--r--contrib/binutils/bfd/aoutx.h40
-rw-r--r--contrib/binutils/bfd/archive.c17
-rw-r--r--contrib/binutils/bfd/archures.c219
-rw-r--r--contrib/binutils/bfd/bfd-in.h6
-rw-r--r--contrib/binutils/bfd/bfd-in2.h466
-rw-r--r--contrib/binutils/bfd/bfd.c30
-rw-r--r--contrib/binutils/bfd/binary.c6
-rw-r--r--contrib/binutils/bfd/coff-i386.c185
-rw-r--r--contrib/binutils/bfd/coff-sh.c244
-rw-r--r--contrib/binutils/bfd/coff-tic30.c206
-rw-r--r--contrib/binutils/bfd/coffcode.h358
-rw-r--r--contrib/binutils/bfd/coffgen.c49
-rw-r--r--contrib/binutils/bfd/cofflink.c241
-rw-r--r--contrib/binutils/bfd/coffswap.h100
-rwxr-xr-xcontrib/binutils/bfd/config.bfd108
-rw-r--r--contrib/binutils/bfd/config.in9
-rwxr-xr-xcontrib/binutils/bfd/configure1578
-rw-r--r--contrib/binutils/bfd/configure.host106
-rw-r--r--contrib/binutils/bfd/configure.in459
-rw-r--r--contrib/binutils/bfd/cpu-arc.c70
-rw-r--r--contrib/binutils/bfd/cpu-sh.c61
-rw-r--r--contrib/binutils/bfd/cpu-tic30.c39
-rw-r--r--contrib/binutils/bfd/cpu-v850.c94
-rw-r--r--contrib/binutils/bfd/dep-in.sed1
-rw-r--r--contrib/binutils/bfd/doc/ChangeLog75
-rw-r--r--contrib/binutils/bfd/doc/Makefile.am248
-rw-r--r--contrib/binutils/bfd/doc/Makefile.in614
-rw-r--r--contrib/binutils/bfd/doc/aoutx.texi60
-rw-r--r--contrib/binutils/bfd/doc/archive.texi10
-rw-r--r--contrib/binutils/bfd/doc/archures.texi115
-rw-r--r--contrib/binutils/bfd/doc/bfd.texinfo6
-rw-r--r--contrib/binutils/bfd/doc/bfdt.texi597
-rw-r--r--contrib/binutils/bfd/doc/cache.texi18
-rw-r--r--contrib/binutils/bfd/doc/chew.c82
-rw-r--r--contrib/binutils/bfd/doc/coffcode.texi84
-rw-r--r--contrib/binutils/bfd/doc/core.texi10
-rw-r--r--contrib/binutils/bfd/doc/doc.str2
-rw-r--r--contrib/binutils/bfd/doc/elf.texi4
-rw-r--r--contrib/binutils/bfd/doc/format.texi10
-rw-r--r--contrib/binutils/bfd/doc/hash.texi25
-rw-r--r--contrib/binutils/bfd/doc/init.texi4
-rw-r--r--contrib/binutils/bfd/doc/libbfd.texi48
-rw-r--r--contrib/binutils/bfd/doc/linker.texi24
-rw-r--r--contrib/binutils/bfd/doc/opncls.texi22
-rw-r--r--contrib/binutils/bfd/doc/reloc.texi170
-rw-r--r--contrib/binutils/bfd/doc/section.texi133
-rw-r--r--contrib/binutils/bfd/doc/syms.texi231
-rw-r--r--contrib/binutils/bfd/doc/targets.texi24
-rw-r--r--contrib/binutils/bfd/dwarf2.c1457
-rw-r--r--contrib/binutils/bfd/ecoff.c5
-rw-r--r--contrib/binutils/bfd/ecofflink.c13
-rw-r--r--contrib/binutils/bfd/elf-bfd.h19
-rw-r--r--contrib/binutils/bfd/elf32-arc.c213
-rw-r--r--contrib/binutils/bfd/elf32-sh.c56
-rw-r--r--contrib/binutils/bfd/elf32-v850.c1785
-rw-r--r--contrib/binutils/bfd/elf64-alpha.c312
-rw-r--r--contrib/binutils/bfd/elfcode.h14
-rw-r--r--contrib/binutils/bfd/elfcore.h5
-rw-r--r--contrib/binutils/bfd/elflink.c50
-rw-r--r--contrib/binutils/bfd/elflink.h1216
-rw-r--r--contrib/binutils/bfd/elfxx-target.h16
-rw-r--r--contrib/binutils/bfd/i386netbsd.c4
-rw-r--r--contrib/binutils/bfd/ieee.c17
-rw-r--r--contrib/binutils/bfd/ihex.c45
-rw-r--r--contrib/binutils/bfd/libaout.h6
-rw-r--r--contrib/binutils/bfd/libbfd-in.h17
-rw-r--r--contrib/binutils/bfd/libbfd.c16
-rw-r--r--contrib/binutils/bfd/libbfd.h43
-rw-r--r--contrib/binutils/bfd/libcoff-in.h13
-rw-r--r--contrib/binutils/bfd/libcoff.h70
-rw-r--r--contrib/binutils/bfd/linker.c16
-rw-r--r--contrib/binutils/bfd/netbsd-core.c90
-rw-r--r--contrib/binutils/bfd/netbsd.h28
-rw-r--r--contrib/binutils/bfd/opncls.c17
-rw-r--r--contrib/binutils/bfd/reloc.c361
-rw-r--r--contrib/binutils/bfd/reloc16.c12
-rw-r--r--contrib/binutils/bfd/srec.c5
-rw-r--r--contrib/binutils/bfd/stabs.c4
-rw-r--r--contrib/binutils/bfd/stamp-h.in1
-rw-r--r--contrib/binutils/bfd/syms.c451
-rw-r--r--contrib/binutils/bfd/targets.c27
-rw-r--r--contrib/binutils/bfd/tekhex.c83
-rw-r--r--contrib/binutils/binutils/ChangeLog582
-rw-r--r--contrib/binutils/binutils/Makefile.am449
-rw-r--r--contrib/binutils/binutils/Makefile.in1359
-rw-r--r--contrib/binutils/binutils/NEWS10
-rw-r--r--contrib/binutils/binutils/README89
-rw-r--r--contrib/binutils/binutils/acconfig.h9
-rw-r--r--contrib/binutils/binutils/acinclude.m41
-rw-r--r--contrib/binutils/binutils/aclocal.m4461
-rw-r--r--contrib/binutils/binutils/addr2line.c8
-rw-r--r--contrib/binutils/binutils/ar.124
-rw-r--r--contrib/binutils/binutils/ar.c46
-rw-r--r--contrib/binutils/binutils/binutils.texi189
-rw-r--r--contrib/binutils/binutils/bucomm.c12
-rw-r--r--contrib/binutils/binutils/coffgrok.c10
-rw-r--r--contrib/binutils/binutils/config.in22
-rw-r--r--contrib/binutils/binutils/config.texi2
-rwxr-xr-xcontrib/binutils/binutils/configure1770
-rw-r--r--contrib/binutils/binutils/configure.in129
-rw-r--r--contrib/binutils/binutils/deflex.l19
-rw-r--r--contrib/binutils/binutils/defparse.c1056
-rw-r--r--contrib/binutils/binutils/defparse.h27
-rw-r--r--contrib/binutils/binutils/defparse.y30
-rw-r--r--contrib/binutils/binutils/dep-in.sed1
-rw-r--r--contrib/binutils/binutils/dlltool.c614
-rw-r--r--contrib/binutils/binutils/dlltool.h41
-rw-r--r--contrib/binutils/binutils/objcopy.117
-rw-r--r--contrib/binutils/binutils/objcopy.c311
-rw-r--r--contrib/binutils/binutils/objdump.12
-rw-r--r--contrib/binutils/binutils/objdump.c200
-rw-r--r--contrib/binutils/binutils/rclex.c2526
-rw-r--r--contrib/binutils/binutils/rclex.l465
-rw-r--r--contrib/binutils/binutils/rcparse.c2993
-rw-r--r--contrib/binutils/binutils/rcparse.h124
-rw-r--r--contrib/binutils/binutils/rcparse.y1589
-rw-r--r--contrib/binutils/binutils/resbin.c2376
-rw-r--r--contrib/binutils/binutils/rescoff.c776
-rw-r--r--contrib/binutils/binutils/resrc.c2260
-rw-r--r--contrib/binutils/binutils/size.c120
-rw-r--r--contrib/binutils/binutils/srconv.c90
-rw-r--r--contrib/binutils/binutils/stabs.c4
-rw-r--r--contrib/binutils/binutils/stamp-h.in1
-rw-r--r--contrib/binutils/binutils/strings.c4
-rw-r--r--contrib/binutils/binutils/sysdump.c65
-rw-r--r--contrib/binutils/binutils/sysinfo.y4
-rw-r--r--contrib/binutils/binutils/wrstabs.c14
-rw-r--r--contrib/binutils/config-ml.in57
-rwxr-xr-xcontrib/binutils/config.guess264
-rwxr-xr-xcontrib/binutils/config.sub113
-rw-r--r--contrib/binutils/config/ChangeLog17
-rw-r--r--contrib/binutils/config/mh-elfalphapic1
-rw-r--r--contrib/binutils/config/mh-mingw3212
-rw-r--r--contrib/binutils/config/mt-elfalphapic1
-rw-r--r--contrib/binutils/config/mt-linux2
-rwxr-xr-xcontrib/binutils/configure318
-rw-r--r--contrib/binutils/configure.in414
-rw-r--r--contrib/binutils/etc/Makefile.in28
-rwxr-xr-xcontrib/binutils/etc/configure106
-rw-r--r--contrib/binutils/etc/configure.in2
-rw-r--r--contrib/binutils/etc/make-stds.texi57
-rw-r--r--contrib/binutils/etc/standards.texi96
-rw-r--r--contrib/binutils/gas/CONTRIBUTORS26
-rw-r--r--contrib/binutils/gas/ChangeLog2183
-rw-r--r--contrib/binutils/gas/Makefile.am1549
-rw-r--r--contrib/binutils/gas/Makefile.in1688
-rw-r--r--contrib/binutils/gas/NEWS16
-rw-r--r--contrib/binutils/gas/README11
-rw-r--r--contrib/binutils/gas/acconfig.h24
-rw-r--r--contrib/binutils/gas/acinclude.m458
-rw-r--r--contrib/binutils/gas/aclocal.m4459
-rw-r--r--contrib/binutils/gas/app.c76
-rw-r--r--contrib/binutils/gas/as.c116
-rw-r--r--contrib/binutils/gas/as.h180
-rw-r--r--contrib/binutils/gas/atof-generic.c18
-rw-r--r--contrib/binutils/gas/cgen.c291
-rw-r--r--contrib/binutils/gas/cond.c16
-rw-r--r--contrib/binutils/gas/config.in145
-rw-r--r--contrib/binutils/gas/config/atof-ieee.c21
-rw-r--r--contrib/binutils/gas/config/obj-aout.c2
-rw-r--r--contrib/binutils/gas/config/obj-aout.h22
-rw-r--r--contrib/binutils/gas/config/obj-coff.c74
-rw-r--r--contrib/binutils/gas/config/obj-coff.h38
-rw-r--r--contrib/binutils/gas/config/obj-elf.c58
-rw-r--r--contrib/binutils/gas/config/obj-elf.h25
-rw-r--r--contrib/binutils/gas/config/obj-multi.h2
-rw-r--r--contrib/binutils/gas/config/tc-alpha.c332
-rw-r--r--contrib/binutils/gas/config/tc-alpha.h8
-rw-r--r--contrib/binutils/gas/config/tc-arc.c1481
-rw-r--r--contrib/binutils/gas/config/tc-arc.h71
-rw-r--r--contrib/binutils/gas/config/tc-sh.c233
-rw-r--r--contrib/binutils/gas/config/tc-sh.h9
-rw-r--r--contrib/binutils/gas/config/tc-tic30.c1909
-rw-r--r--contrib/binutils/gas/config/tc-tic30.h53
-rw-r--r--contrib/binutils/gas/config/tc-v850.c1902
-rw-r--r--contrib/binutils/gas/config/tc-v850.h80
-rw-r--r--contrib/binutils/gas/config/te-nbsd.h8
-rw-r--r--contrib/binutils/gas/depend.c208
-rw-r--r--contrib/binutils/gas/doc/Makefile.am43
-rw-r--r--contrib/binutils/gas/doc/Makefile.in475
-rw-r--r--contrib/binutils/gas/doc/all.texi4
-rw-r--r--contrib/binutils/gas/doc/as.111
-rw-r--r--contrib/binutils/gas/doc/as.texinfo260
-rw-r--r--contrib/binutils/gas/doc/c-i386.texi13
-rw-r--r--contrib/binutils/gas/doc/c-sh.texi19
-rw-r--r--contrib/binutils/gas/doc/c-v850.texi308
-rw-r--r--contrib/binutils/gas/doc/internals.texi42
-rw-r--r--contrib/binutils/gas/ecoff.c254
-rw-r--r--contrib/binutils/gas/ecoff.h6
-rw-r--r--contrib/binutils/gas/ehopt.c434
-rw-r--r--contrib/binutils/gas/expr.c200
-rw-r--r--contrib/binutils/gas/expr.h7
-rw-r--r--contrib/binutils/gas/frags.c24
-rw-r--r--contrib/binutils/gas/frags.h85
-rw-r--r--contrib/binutils/gas/gasp.c23
-rw-r--r--contrib/binutils/gas/hash.c6
-rw-r--r--contrib/binutils/gas/input-scrub.c25
-rw-r--r--contrib/binutils/gas/itbl-lex.l2
-rw-r--r--contrib/binutils/gas/listing.c352
-rw-r--r--contrib/binutils/gas/listing.h10
-rw-r--r--contrib/binutils/gas/macro.c113
-rw-r--r--contrib/binutils/gas/messages.c18
-rw-r--r--contrib/binutils/gas/output-file.c4
-rw-r--r--contrib/binutils/gas/read.c672
-rw-r--r--contrib/binutils/gas/read.h18
-rw-r--r--contrib/binutils/gas/stabs.c103
-rw-r--r--contrib/binutils/gas/stamp-h.in1
-rw-r--r--contrib/binutils/gas/subsegs.c2
-rw-r--r--contrib/binutils/gas/symbols.c322
-rw-r--r--contrib/binutils/gas/symbols.h2
-rw-r--r--contrib/binutils/gas/write.c153
-rw-r--r--contrib/binutils/gas/write.h3
-rw-r--r--contrib/binutils/include/ChangeLog216
-rw-r--r--contrib/binutils/include/bfdlink.h3
-rw-r--r--contrib/binutils/include/callback.h199
-rw-r--r--contrib/binutils/include/coff/ChangeLog28
-rw-r--r--contrib/binutils/include/coff/internal.h24
-rw-r--r--contrib/binutils/include/coff/sh.h3
-rw-r--r--contrib/binutils/include/coff/tic30.h203
-rw-r--r--contrib/binutils/include/demangle.h1
-rw-r--r--contrib/binutils/include/dis-asm.h34
-rw-r--r--contrib/binutils/include/elf/ChangeLog94
-rw-r--r--contrib/binutils/include/elf/alpha.h8
-rw-r--r--contrib/binutils/include/elf/arc.h52
-rw-r--r--contrib/binutils/include/elf/common.h4
-rw-r--r--contrib/binutils/include/elf/internal.h4
-rw-r--r--contrib/binutils/include/elf/v850.h94
-rw-r--r--contrib/binutils/include/floatformat.h25
-rw-r--r--contrib/binutils/include/getopt.h34
-rw-r--r--contrib/binutils/include/libiberty.h32
-rw-r--r--contrib/binutils/include/obstack.h7
-rw-r--r--contrib/binutils/include/opcode/ChangeLog267
-rw-r--r--contrib/binutils/include/opcode/arc.h274
-rw-r--r--contrib/binutils/include/opcode/cgen.h671
-rw-r--r--contrib/binutils/include/opcode/i386.h94
-rw-r--r--contrib/binutils/include/opcode/tic30.h691
-rw-r--r--contrib/binutils/include/opcode/v850.h154
-rw-r--r--contrib/binutils/include/regs/ChangeLog0
-rw-r--r--contrib/binutils/include/remote-sim.h285
-rw-r--r--contrib/binutils/include/symcat.h40
-rwxr-xr-xcontrib/binutils/install-sh287
-rw-r--r--contrib/binutils/ld/ChangeLog780
-rw-r--r--contrib/binutils/ld/Makefile.am778
-rw-r--r--contrib/binutils/ld/NEWS9
-rw-r--r--contrib/binutils/ld/README26
-rw-r--r--contrib/binutils/ld/acconfig.h6
-rw-r--r--contrib/binutils/ld/acinclude.m41
-rw-r--r--contrib/binutils/ld/aclocal.m4461
-rw-r--r--contrib/binutils/ld/config.in9
-rwxr-xr-xcontrib/binutils/ld/configure1225
-rw-r--r--contrib/binutils/ld/configure.host80
-rw-r--r--contrib/binutils/ld/configure.in69
-rw-r--r--contrib/binutils/ld/emulparams/arcelf.sh11
-rw-r--r--contrib/binutils/ld/emulparams/elf32b4300.sh10
-rw-r--r--contrib/binutils/ld/emulparams/elf32l4300.sh10
-rw-r--r--contrib/binutils/ld/emulparams/i386pe.sh2
-rwxr-xr-xcontrib/binutils/ld/emulparams/tic30aout.sh7
-rwxr-xr-xcontrib/binutils/ld/emulparams/tic30coff.sh7
-rw-r--r--contrib/binutils/ld/emulparams/v850.sh14
-rw-r--r--contrib/binutils/ld/emultempl/elf32.em244
-rw-r--r--contrib/binutils/ld/emultempl/pe.em63
-rw-r--r--contrib/binutils/ld/ld.113
-rw-r--r--contrib/binutils/ld/ld.h4
-rw-r--r--contrib/binutils/ld/ld.texinfo160
-rw-r--r--contrib/binutils/ld/ldcref.c8
-rw-r--r--contrib/binutils/ld/ldctor.c15
-rw-r--r--contrib/binutils/ld/ldemul.c2
-rw-r--r--contrib/binutils/ld/ldexp.c38
-rw-r--r--contrib/binutils/ld/ldfile.c31
-rw-r--r--contrib/binutils/ld/ldgram.y15
-rw-r--r--contrib/binutils/ld/ldlang.c289
-rw-r--r--contrib/binutils/ld/ldlang.h9
-rw-r--r--contrib/binutils/ld/ldlex.h6
-rw-r--r--contrib/binutils/ld/ldlex.l72
-rw-r--r--contrib/binutils/ld/ldmain.c1
-rw-r--r--contrib/binutils/ld/ldmisc.c37
-rw-r--r--contrib/binutils/ld/ldmisc.h4
-rw-r--r--contrib/binutils/ld/ldver.c2
-rw-r--r--contrib/binutils/ld/ldwrite.c76
-rw-r--r--contrib/binutils/ld/lexsup.c56
-rw-r--r--contrib/binutils/ld/scripttempl/elf.sc42
-rw-r--r--contrib/binutils/ld/scripttempl/pe.sc123
-rw-r--r--contrib/binutils/ld/scripttempl/tic30aout.sc34
-rw-r--r--contrib/binutils/ld/scripttempl/tic30coff.sc58
-rw-r--r--contrib/binutils/ld/scripttempl/v850.sc183
-rw-r--r--contrib/binutils/ld/stamp-h.in1
-rw-r--r--contrib/binutils/libiberty/ChangeLog234
-rw-r--r--contrib/binutils/libiberty/Makefile.in46
-rw-r--r--contrib/binutils/libiberty/README7
-rw-r--r--contrib/binutils/libiberty/alloca-norm.h2
-rw-r--r--contrib/binutils/libiberty/argv.c57
-rw-r--r--contrib/binutils/libiberty/asprintf.c57
-rw-r--r--contrib/binutils/libiberty/choose-temp.c25
-rw-r--r--contrib/binutils/libiberty/config.table11
-rw-r--r--contrib/binutils/libiberty/config/mh-fbsd211
-rw-r--r--contrib/binutils/libiberty/config/mt-mingw3227
-rw-r--r--contrib/binutils/libiberty/configure.in22
-rw-r--r--contrib/binutils/libiberty/cplus-dem.c384
-rw-r--r--contrib/binutils/libiberty/floatformat.c8
-rw-r--r--contrib/binutils/libiberty/functions.def5
-rw-r--r--contrib/binutils/libiberty/getopt.c436
-rw-r--r--contrib/binutils/libiberty/getopt1.c49
-rw-r--r--contrib/binutils/libiberty/obstack.c35
-rw-r--r--contrib/binutils/libiberty/pexecute.c213
-rw-r--r--contrib/binutils/libiberty/strsignal.c6
-rw-r--r--contrib/binutils/libiberty/vasprintf.c9
-rw-r--r--contrib/binutils/libiberty/xmalloc.c22
-rwxr-xr-xcontrib/binutils/ltconfig1512
-rw-r--r--contrib/binutils/ltmain.sh2453
-rw-r--r--contrib/binutils/missing134
-rwxr-xr-xcontrib/binutils/mkinstalldirs36
-rw-r--r--contrib/binutils/opcodes/ChangeLog969
-rw-r--r--contrib/binutils/opcodes/Makefile.am258
-rw-r--r--contrib/binutils/opcodes/Makefile.in773
-rw-r--r--contrib/binutils/opcodes/acconfig.h6
-rw-r--r--contrib/binutils/opcodes/acinclude.m41
-rw-r--r--contrib/binutils/opcodes/aclocal.m4461
-rw-r--r--contrib/binutils/opcodes/alpha-opc.c16
-rw-r--r--contrib/binutils/opcodes/arc-dis.c266
-rw-r--r--contrib/binutils/opcodes/arc-opc.c1128
-rw-r--r--contrib/binutils/opcodes/cgen-asm.c105
-rw-r--r--contrib/binutils/opcodes/cgen-dis.c102
-rw-r--r--contrib/binutils/opcodes/cgen-opc.c128
-rw-r--r--contrib/binutils/opcodes/config.in6
-rwxr-xr-xcontrib/binutils/opcodes/configure1188
-rw-r--r--contrib/binutils/opcodes/configure.in167
-rw-r--r--contrib/binutils/opcodes/dep-in.sed1
-rw-r--r--contrib/binutils/opcodes/dis-buf.c10
-rw-r--r--contrib/binutils/opcodes/disassemble.c23
-rw-r--r--contrib/binutils/opcodes/i386-dis.c115
-rw-r--r--contrib/binutils/opcodes/sh-dis.c342
-rw-r--r--contrib/binutils/opcodes/sh-opc.h92
-rw-r--r--contrib/binutils/opcodes/stamp-h.in1
-rw-r--r--contrib/binutils/opcodes/tic30-dis.c711
-rw-r--r--contrib/binutils/opcodes/v850-dis.c253
-rw-r--r--contrib/binutils/opcodes/v850-opc.c494
-rw-r--r--contrib/binutils/opcodes/z8k-dis.c35
-rwxr-xr-xcontrib/binutils/symlink-tree2
-rwxr-xr-xcontrib/binutils/ylwrap107
351 files changed, 72520 insertions, 10458 deletions
diff --git a/contrib/binutils/Makefile.in b/contrib/binutils/Makefile.in
index 6b36187..e0d5ba3 100644
--- a/contrib/binutils/Makefile.in
+++ b/contrib/binutils/Makefile.in
@@ -1,6 +1,7 @@
#
# Makefile for directory with subdirs to build.
-# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation
+# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+# Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,16 +21,25 @@
srcdir = .
prefix = /usr/local
-
exec_prefix = $(prefix)
-bindir = $(exec_prefix)/bin
-libdir = $(exec_prefix)/lib
+
+bindir=${exec_prefix}/bin
+sbindir=${exec_prefix}/sbin
+libexecdir=${exec_prefix}/libexec
+datadir=${prefix}/share
+sysconfdir=${prefix}/etc
+sharedstatedir=${prefix}/com
+localstatedir=${prefix}/var
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+oldincludedir=/usr/include
+infodir=${prefix}/info
+mandir=${prefix}/man
+
tooldir = $(exec_prefix)/$(target)
program_transform_name =
-datadir = $(prefix)/share
-mandir = $(prefix)/man
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
@@ -39,16 +49,18 @@ man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
-infodir = $(prefix)/info
-includedir = $(prefix)/include
GDB_NLM_DEPS =
SHELL = /bin/sh
-INSTALL = $$s/install.sh -c
-INSTALL_PROGRAM = $(INSTALL)
+# INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
+# cygwin32 host.
+INSTALL_PROGRAM_ARGS =
+
+INSTALL = $(SHELL) $$s/install-sh -c
+INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
+INSTALL_SCRIPT = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
-INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
INSTALL_DOSREL = install-dosrel-fake
@@ -63,9 +75,10 @@ HOST_CC = $(CC_FOR_BUILD)
HOST_PREFIX =
HOST_PREFIX_1 = loser-
-# We don't specify -g -O because many compilers don't support -g -O,
-# and/or -O is broken in and of itself.
+# These flag values are normally overridden by the configure script.
CFLAGS = -g
+CXXFLAGS = -g -O2
+
LIBCFLAGS = $(CFLAGS)
CFLAGS_FOR_TARGET = $(CFLAGS)
LDFLAGS_FOR_TARGET =
@@ -73,10 +86,9 @@ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
PICFLAG =
PICFLAG_FOR_TARGET =
-CXX = gcc
+CXX = c++
# Use -O2 to stress test the compiler.
-CXXFLAGS = -g -O2
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
@@ -84,8 +96,12 @@ LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
RANLIB = ranlib
DLLTOOL = dlltool
+WINDRES = windres
NM = nm
+
+LD = ld
+
# Not plain GZIP, since gzip looks there for extra command-line options.
GZIPPROG = gzip
@@ -93,7 +109,20 @@ GZIPPROG = gzip
DEFAULT_YACC = yacc
DEFAULT_LEX = lex
-BISON = bison -y
+BISON = `if [ -f $$r/bison/bison ] ; then \
+ echo $$r/bison/bison -L $$s/bison/ ; \
+ else \
+ echo bison ; \
+ fi`
+
+YACC = `if [ -f $$r/bison/bison ] ; then \
+ echo $$r/bison/bison -y -L $$s/bison/ ; \
+ elif [ -f $$r/byacc/byacc ] ; then \
+ echo $$r/byacc/byacc ; \
+ else \
+ echo ${DEFAULT_YACC} ; \
+ fi`
+
LEX = `if [ -f $$r/flex/flex ] ; \
then echo $$r/flex/flex ; \
else echo ${DEFAULT_LEX} ; fi`
@@ -130,7 +159,7 @@ OTHERS =
# This is set by the configure script to the list of directories which
# should be built using the target tools.
-TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup
+TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup opcodes cygmon
# Target libraries are put under this directory:
# Changed by configure to $(target_alias) if cross.
@@ -153,11 +182,11 @@ REALLY_SET_LIB_PATH = \
export $(RPATH_ENVVAR);
ALL = all.normal
-INSTALL_TARGET = install-dirs \
+INSTALL_TARGET = installdirs \
+ install-gcc \
$(INSTALL_MODULES) \
$(INSTALL_TARGET_MODULES) \
$(INSTALL_X11_MODULES) \
- install-gcc \
$(INSTALL_DOSREL)
@@ -165,7 +194,7 @@ CC_FOR_TARGET = ` \
if [ -f $$r/gcc/xgcc ] ; then \
if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
- echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
+ echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
else \
echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
fi; \
@@ -191,7 +220,7 @@ CXX_FOR_TARGET = ` \
if [ -f $$r/gcc/xgcc ] ; then \
if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
- echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
+ echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
else \
echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
fi; \
@@ -202,13 +231,13 @@ CXX_FOR_TARGET = ` \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo $(CXX); \
else \
- t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
+ t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \
fi; \
fi`
AS_FOR_TARGET = ` \
- if [ -f $$r/gas/as.new ] ; then \
- echo $$r/gas/as.new ; \
+ if [ -f $$r/gas/as-new ] ; then \
+ echo $$r/gas/as-new ; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo $(AS); \
@@ -218,8 +247,8 @@ AS_FOR_TARGET = ` \
fi`
LD_FOR_TARGET = ` \
- if [ -f $$r/ld/ld.new ] ; then \
- echo $$r/ld/ld.new ; \
+ if [ -f $$r/ld/ld-new ] ; then \
+ echo $$r/ld/ld-new ; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo $(LD); \
@@ -239,6 +268,17 @@ DLLTOOL_FOR_TARGET = ` \
fi; \
fi`
+WINDRES_FOR_TARGET = ` \
+ if [ -f $$r/binutils/windres ] ; then \
+ echo $$r/binutils/windres ; \
+ else \
+ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ echo $(WINDRES); \
+ else \
+ t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
+ fi; \
+ fi`
+
AR_FOR_TARGET = ` \
if [ -f $$r/binutils/ar ] ; then \
echo $$r/binutils/ar ; \
@@ -262,8 +302,8 @@ RANLIB_FOR_TARGET = ` \
fi`
NM_FOR_TARGET = ` \
- if [ -f $$r/binutils/nm.new ] ; then \
- echo $$r/binutils/nm.new ; \
+ if [ -f $$r/binutils/nm-new ] ; then \
+ echo $$r/binutils/nm-new ; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo $(NM); \
@@ -294,7 +334,7 @@ BASE_FLAGS_TO_PASS = \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "INSTALL_XFORM=$(INSTALL_XFORM)" \
+ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
"LDFLAGS=$(LDFLAGS)" \
"LEX=$(LEX)" \
"LD_FOR_TARGET=$(LD_FOR_TARGET)" \
@@ -309,14 +349,29 @@ BASE_FLAGS_TO_PASS = \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
+ "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
"SHELL=$(SHELL)" \
"EXPECT=$(EXPECT)" \
"RUNTEST=$(RUNTEST)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
- "YACC=$(BISON)" \
+ "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
+ "YACC=$(YACC)" \
+ "bindir=$(bindir)" \
+ "datadir=$(datadir)" \
"exec_prefix=$(exec_prefix)" \
+ "includedir=$(includedir)" \
+ "infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "libexecdir=$(libexecdir)" \
+ "lispdir=$(lispdir)" \
+ "localstatedir=$(localstatedir)" \
+ "mandir=$(mandir)" \
+ "oldincludedir=$(oldincludedir)" \
"prefix=$(prefix)" \
- "tooldir=$(tooldir)"
+ "sbindir=$(sbindir)" \
+ "sharedstatedir=$(sharedstatedir)" \
+ "sysconfdir=$(sysconfdir)" \
+ "tooldir=$(tooldir)"
# Flags to pass down to most sub-makes, in which we're building with
# the host environment.
@@ -327,9 +382,10 @@ EXTRA_HOST_FLAGS = \
'CC=$(CC)' \
'CXX=$(CXX)' \
'DLLTOOL=$(DLLTOOL)' \
+ 'LD=$(LD)' \
'NM=$(NM)' \
- 'RANLIB=$(RANLIB)'
-
+ 'RANLIB=$(RANLIB)' \
+ 'WINDRES=$(WINDRES)'
FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
@@ -362,7 +418,8 @@ EXTRA_TARGET_FLAGS = \
'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
'NM=$$(NM_FOR_TARGET)' \
'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
- 'RANLIB=$$(RANLIB_FOR_TARGET)'
+ 'RANLIB=$$(RANLIB_FOR_TARGET)' \
+ 'WINDRES=$$(WINDRES_FOR_TARGET)'
TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
@@ -383,16 +440,17 @@ EXTRA_GCC_FLAGS = \
'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
'NM=$(NM)' \
'RANLIB=$$(RANLIB_FOR_TARGET)' \
+ 'WINDRES=$$(WINDRES_FOR_TARGET)' \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
- `if test x"$(LANGUAGES)" != x; then echo "LANGUAGES=$(LANGUAGES)"; fi` \
- `if test x"$(STMP_FIXPROTO)" != x; then echo "STMP_FIXPROTO=$(STMP_FIXPROTO)"; fi` \
- `if test x"$(LIMITS_H_TEST)" != x; then echo "LIMITS_H_TEST=$(LIMITS_H_TEST)"; fi` \
- `if test x"$(LIBGCC1_TEST)" != x; then echo "LIBGCC1_TEST=$(LIBGCC1_TEST)"; fi` \
- `if test x"$(LIBGCC2_CFLAGS)" != x; then echo "LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)"; fi` \
- `if test x"$(LIBGCC2_DEBUG_CFLAGS)" != x; then echo "LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)"; fi` \
- `if test x"$(LIBGCC2_INCLUDES)" != x; then echo "LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)"; fi` \
- `if test x"$(ENQUIRE)" != x; then echo "ENQUIRE=$(ENQUIRE)"; fi` \
- `if test x"$(BOOT_CFLAGS)" != x; then echo "BOOT_CFLAGS=$(BOOT_CFLAGS)"; fi`
+ "`if test x'$(LANGUAGES)' != x; then echo 'LANGUAGES=$(LANGUAGES)'; else echo 'XFOO=bar'; fi`" \
+ "`if test x'$(STMP_FIXPROTO)' != x; then echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)'; else echo 'XFOO=bar'; fi`" \
+ "`if test x'$(LIMITS_H_TEST)' != x; then echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)'; else echo 'XFOO=bar'; fi`" \
+ "`if test x'$(LIBGCC1_TEST)' != x; then echo 'LIBGCC1_TEST=$(LIBGCC1_TEST)'; else echo 'XFOO=bar'; fi`" \
+ "`if test x'$(LIBGCC2_CFLAGS)' != x; then echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
+ "`if test x'$(LIBGCC2_DEBUG_CFLAGS)' != x; then echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)'; else echo 'XFOO=bar'; fi`" \
+ "`if test x'$(LIBGCC2_INCLUDES)' != x; then echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)'; else echo 'XFOO=bar'; fi`" \
+ "`if test x'$(ENQUIRE)' != x; then echo 'ENQUIRE=$(ENQUIRE)'; else echo 'XFOO=bar'; fi`" \
+ "`if test x'$(BOOT_CFLAGS)' != x; then echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)'; else echo 'XFOO=bar'; fi`"
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
@@ -401,11 +459,13 @@ GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
ALL_MODULES = \
all-apache \
all-autoconf \
+ all-automake \
all-bash \
all-bfd \
all-binutils \
+ all-bison \
all-byacc \
- all-cvs \
+ all-cvssrc \
all-db \
all-dejagnu \
all-diff \
@@ -417,6 +477,8 @@ ALL_MODULES = \
all-flex \
all-gas \
all-gawk \
+ all-gettext \
+ all-gnuserv \
all-gprof \
all-grep \
all-grez \
@@ -424,9 +486,11 @@ ALL_MODULES = \
all-hello \
all-indent \
all-inet \
+ all-intl \
all-ispell \
all-itcl \
all-ld \
+ all-libgui \
all-libiberty \
all-m4 \
all-make \
@@ -443,7 +507,7 @@ ALL_MODULES = \
all-send-pr \
all-shellutils \
all-sim \
- all-sn \
+ all-snavigator \
all-tar \
all-tcl \
all-texinfo \
@@ -460,16 +524,18 @@ ALL_MODULES = \
# are tested as part of the host's native tool-chain, and not
# tested in a cross configuration.
NATIVE_CHECK_MODULES = \
+ check-bison \
check-byacc \
check-flex
CROSS_CHECK_MODULES = \
check-apache \
check-autoconf \
+ check-automake \
check-bash \
check-bfd \
check-binutils \
- check-cvs \
+ check-cvssrc \
check-db \
check-dejagnu \
check-diff \
@@ -479,15 +545,19 @@ CROSS_CHECK_MODULES = \
check-find \
check-gas \
check-gawk \
+ check-gettext \
+ check-gnuserv \
check-gprof \
check-grep \
check-gzip \
check-hello \
check-indent \
check-inet \
+ check-intl \
check-ispell \
check-itcl \
check-ld \
+ check-libgui \
check-libiberty \
check-m4 \
check-make \
@@ -502,7 +572,7 @@ CROSS_CHECK_MODULES = \
check-sed \
check-send-pr \
check-shellutils \
- check-sn \
+ check-snavigator \
check-sim \
check-tar \
check-tcl \
@@ -520,15 +590,19 @@ CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
# We put install-opcodes before install-binutils because the installed
# binutils might be on PATH, and they might need the shared opcodes
# library.
+# We put install-tcl before install-itcl because itcl wants to run a
+# program on installation which uses the Tcl libraries.
INSTALL_MODULES = \
install-apache \
install-autoconf \
+ install-automake \
install-bash \
install-bfd \
install-opcodes \
install-binutils \
+ install-bison \
install-byacc \
- install-cvs \
+ install-cvssrc \
install-db \
install-dejagnu \
install-diff \
@@ -540,6 +614,8 @@ INSTALL_MODULES = \
install-flex \
install-gas \
install-gawk \
+ install-gettext \
+ install-gnuserv \
install-gprof \
install-grep \
install-grez \
@@ -547,9 +623,12 @@ INSTALL_MODULES = \
install-hello \
install-indent \
install-inet \
+ install-intl \
install-ispell \
+ install-tcl \
install-itcl \
install-ld \
+ install-libgui \
install-libiberty \
install-m4 \
install-make \
@@ -564,9 +643,8 @@ INSTALL_MODULES = \
install-send-pr \
install-shellutils \
install-sim \
- install-sn \
+ install-snavigator \
install-tar \
- install-tcl \
install-textutils \
install-tgas \
install-time \
@@ -583,7 +661,8 @@ ALL_X11_MODULES = \
all-gash \
all-guile \
all-tclX \
- all-tk
+ all-tk \
+ all-tix
# This is a list of the check targets for all of the modules which are
# compiled using $(X11_FLAGS_TO_PASS).
@@ -593,7 +672,9 @@ CHECK_X11_MODULES = \
check-guile \
check-expect \
check-gash \
- check-tclX
+ check-tclX \
+ check-tk \
+ check-tix
# This is a list of the install targets for all the modules which are
# compiled using $(X11_FLAGS_TO_PASS).
@@ -605,7 +686,8 @@ INSTALL_X11_MODULES = \
install-expect \
install-gash \
install-tclX \
- install-tk
+ install-tk \
+ install-tix
# This is a list of the targets for all of the modules which are compiled
# using $(TARGET_FLAGS_TO_PASS).
@@ -618,7 +700,9 @@ ALL_TARGET_MODULES = \
all-target-winsup \
all-target-libgloss \
all-target-libiberty \
- all-target-examples
+ all-target-gperf \
+ all-target-examples \
+ all-target-cygmon
# This is a list of the configure targets for all of the modules which
# are compiled using the target tools.
@@ -631,7 +715,9 @@ CONFIGURE_TARGET_MODULES = \
configure-target-winsup \
configure-target-libgloss \
configure-target-libiberty \
- configure-target-examples
+ configure-target-gperf \
+ configure-target-examples \
+ configure-target-cygmon
# This is a list of the check targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
@@ -641,7 +727,8 @@ CHECK_TARGET_MODULES = \
check-target-libg++ \
check-target-newlib \
check-target-winsup \
- check-target-libiberty
+ check-target-libiberty \
+ check-target-gperf
# This is a list of the install targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
@@ -652,17 +739,20 @@ INSTALL_TARGET_MODULES = \
install-target-newlib \
install-target-winsup \
install-target-libgloss \
- install-target-libiberty
+ install-target-libiberty \
+ install-target-gperf
# This is a list of the targets for which we can do a clean-{target}.
CLEAN_MODULES = \
clean-apache \
clean-autoconf \
+ clean-automake \
clean-bash \
clean-bfd \
clean-binutils \
+ clean-bison \
clean-byacc \
- clean-cvs \
+ clean-cvssrc \
clean-db \
clean-dejagnu \
clean-diff \
@@ -674,6 +764,8 @@ CLEAN_MODULES = \
clean-flex \
clean-gas \
clean-gawk \
+ clean-gettext \
+ clean-gnuserv \
clean-gprof \
clean-grep \
clean-grez \
@@ -681,9 +773,11 @@ CLEAN_MODULES = \
clean-hello \
clean-indent \
clean-inet \
+ clean-intl \
clean-ispell \
clean-itcl \
clean-ld \
+ clean-libgui \
clean-libiberty \
clean-m4 \
clean-make \
@@ -700,7 +794,7 @@ CLEAN_MODULES = \
clean-send-pr \
clean-shellutils \
clean-sim \
- clean-sn \
+ clean-snavigator \
clean-tar \
clean-tcl \
clean-texinfo \
@@ -720,7 +814,9 @@ CLEAN_TARGET_MODULES = \
clean-target-winsup \
clean-target-libgloss \
clean-target-libiberty \
- clean-target-examples
+ clean-target-gperf \
+ clean-target-examples \
+ clean-target-cygmon
# All of the x11 modules that can be cleaned
CLEAN_X11_MODULES = \
@@ -731,7 +827,8 @@ CLEAN_X11_MODULES = \
clean-gash \
clean-guile \
clean-tclX \
- clean-tk
+ clean-tk \
+ clean-tix
# The first rule in the file had better be this one. Don't put any above it.
all: all.normal
@@ -741,8 +838,8 @@ all: all.normal
.PHONY: all.normal
all.normal: \
$(ALL_MODULES) \
- $(ALL_TARGET_MODULES) \
$(ALL_X11_MODULES) \
+ $(ALL_TARGET_MODULES) \
all-gcc
# Do a target for all the subdirectories. A ``make do-X'' will do a
@@ -782,12 +879,12 @@ $(DO_X):
done; \
;; \
esac ; \
- export AR AS CC CXX NM RANLIB DLLTOOL; \
+ export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
if (cd ./$$i; \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
- "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
- "DLLTOOL=$${DLLTOOL}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
$${target}); \
then true; else exit 1; fi; \
else true; fi; \
@@ -801,12 +898,12 @@ $(DO_X):
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
done; \
- export AR AS CC CXX NM RANLIB DLLTOOL; \
+ export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
if (cd $(TARGET_SUBDIR)/$$i; \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
- "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
+ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
- "DLLTOOL=$${DLLTOOL}" \
+ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
$${target}); \
then true; else exit 1; fi; \
else true; fi; \
@@ -889,7 +986,7 @@ check: $(CHECK_MODULES) \
# Installation targets.
.PHONY: install uninstall source-vault binary-vault vault-install
-install: $(INSTALL_TARGET) install-info
+install: $(INSTALL_TARGET)
uninstall:
@echo "the uninstall target is not supported in this tree"
@@ -929,7 +1026,7 @@ inet-install:
# the fixed header files.
.PHONY: install-no-fixedincludes
install-no-fixedincludes: \
- install-dirs \
+ installdirs \
$(INSTALL_MODULES) \
$(INSTALL_TARGET_MODULES) \
$(INSTALL_X11_MODULES) \
@@ -956,6 +1053,7 @@ gcc-no-fixedincludes:
mv gcc/tmp-include gcc/include 2>/dev/null; \
else true; fi
+
# This rule is used to build the modules which use FLAGS_TO_PASS. To
# build a target all-X means to cd to X and make all.
#
@@ -1006,7 +1104,7 @@ $(CROSS_CHECK_MODULES):
# This rule is used to install the modules which use FLAGS_TO_PASS.
# To build a target install-X means to cd to X and make install.
.PHONY: $(INSTALL_MODULES)
-$(INSTALL_MODULES): install-dirs
+$(INSTALL_MODULES): installdirs
@dir=`echo $@ | sed -e 's/install-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
@@ -1061,6 +1159,7 @@ $(CONFIGURE_TARGET_MODULES):
LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
NM="$(NM_FOR_TARGET)"; export NM; \
RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
cd $(TARGET_SUBDIR)/$${dir}; \
case $(srcdir) in \
@@ -1144,7 +1243,7 @@ $(CHECK_TARGET_MODULES):
# TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
# and make install.
.PHONY: $(INSTALL_TARGET_MODULES)
-$(INSTALL_TARGET_MODULES): install-dirs
+$(INSTALL_TARGET_MODULES): installdirs
@dir=`echo $@ | sed -e 's/install-target-//'`; \
if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
@@ -1189,7 +1288,7 @@ $(CHECK_X11_MODULES):
# This rule is used to install the modules which use X11_FLAGS_TO_PASS.
# To build a target install-X means to cd to X and make install.
.PHONY: $(INSTALL_X11_MODULES)
-$(INSTALL_X11_MODULES):
+$(INSTALL_X11_MODULES): installdirs
@dir=`echo $@ | sed -e 's/install-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
@@ -1251,7 +1350,7 @@ install-gcc:
# This rule is used to install the modules which use FLAGS_TO_PASS.
# To build a target install-X means to cd to X and make install.
.PHONY: install-dosrel
-install-dosrel: install-dirs info
+install-dosrel: installdirs info
@dir=`echo $@ | sed -e 's/install-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
@@ -1267,17 +1366,21 @@ install-dosrel-fake:
# This is a list of inter-dependencies among modules.
all-apache:
-all-autoconf: all-m4
+all-autoconf: all-m4 all-texinfo
+all-automake:
all-bash:
all-bfd:
-all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
+all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc
+all-bison: all-texinfo
all-byacc:
-all-cvs:
+all-cvssrc:
+configure-target-cygmon: $(ALL_GCC)
+all-target-cygmon: configure-target-cygmon all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
all-db:
all-dejagnu: all-tcl all-expect all-tk
all-diff: all-libiberty
all-emacs:
-all-emacs19: all-byacc
+all-emacs19: all-bison all-byacc
all-etc:
configure-target-examples: $(ALL_GCC)
all-target-examples: configure-target-examples
@@ -1285,15 +1388,19 @@ all-expect: all-tcl all-tk
all-fileutils: all-libiberty
all-findutils:
all-find:
-all-flex: all-libiberty all-byacc
+all-flex: all-libiberty all-bison all-byacc
all-gas: all-libiberty all-opcodes all-bfd
all-gash: all-tcl
all-gawk:
ALL_GCC = all-gcc
-all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld
-all-bootstrap: all-libiberty all-byacc all-binutils all-gas all-ld
-GDB_TK = all-tk all-tcl
-all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
+all-gcc: all-bison all-byacc all-binutils all-gas all-ld
+all-bootstrap: all-libiberty all-bison all-byacc all-binutils all-gas all-ld
+GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui
+all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
+all-gettext:
+all-gnuserv:
+configure-target-gperf: $(ALL_GCC)
+all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++
all-gprof: all-libiberty all-bfd all-opcodes
all-grep: all-libiberty
all-grez: all-libiberty all-bfd all-opcodes
@@ -1303,15 +1410,18 @@ all-gzip: all-libiberty
all-hello: all-libiberty
all-indent:
all-inet: all-tcl all-send-pr all-perl
+all-intl:
all-ispell: all-emacs19
all-itcl: all-tcl all-tk
-all-ld: all-libiberty all-bfd all-opcodes all-byacc all-flex
+all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex
configure-target-libg++: $(ALL_GCC) configure-target-librx
all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++
configure-target-libgloss: $(ALL_GCC)
all-target-libgloss: configure-target-libgloss configure-target-newlib
configure-target-libio: $(ALL_GCC)
all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
+check-target-libio: all-target-libstdc++
+all-libgui: all-tcl all-tk all-itcl
all-libiberty:
configure-target-librx: $(ALL_GCC) configure-target-newlib
all-target-librx: configure-target-librx
@@ -1332,8 +1442,8 @@ all-recode: all-libiberty
all-sed: all-libiberty
all-send-pr: all-prms
all-shellutils:
-all-sim: all-libiberty all-bfd all-opcodes
-all-sn: all-tcl all-tk all-itcl all-db
+all-sim: all-libiberty all-bfd all-opcodes all-readline
+all-snavigator: all-tcl all-tk all-tix all-itcl all-db all-grep
all-tar: all-libiberty
all-tcl:
all-tclX: all-tcl all-tk
@@ -1342,38 +1452,24 @@ all-texinfo: all-libiberty
all-textutils:
all-tgas: all-libiberty all-bfd all-opcodes
all-time:
+all-tix: all-tcl all-tk
all-wdiff:
-all-target-winsup: all-target-newlib all-target-libiberty all-target-librx all-target-libio configure-target-winsup
+all-target-winsup: all-target-newlib all-target-libiberty all-target-libio configure-target-winsup
configure-target-winsup: configure-target-newlib
all-uudecode: all-libiberty
configure-target-libiberty: $(ALL_GCC)
all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
all-target: $(ALL_TARGET_MODULES)
install-target: $(INSTALL_TARGET_MODULES)
-
+install-gdbtk: install-tcl install-tk install-itcl install-tix install-libgui install-gdb
### other supporting targets
MAKEDIRS= \
$(prefix) \
$(exec_prefix)
-.PHONY: install-dirs
-install-dirs:
- @for i in .. $(MAKEDIRS) ; do \
- if [ x$$i != x.. ]; then \
- echo Making $$i... ; \
- parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
- if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
- if [ ! -d $$i ] ; then \
- if mkdir $$i ; then \
- true ; \
- else \
- exit 1 ; \
- fi ; \
- else \
- true ; \
- fi ; \
- else true; fi; \
- done
+.PHONY: installdirs
+installdirs: mkinstalldirs
+ $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
dir.info: do-install-info
if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
@@ -1410,37 +1506,26 @@ Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
DEVO_SUPPORT= README Makefile.in configure configure.in \
config.guess config.sub config move-if-change \
mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
- COPYING COPYING.LIB install.sh config-ml.in symlink-tree
+ COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
+ mkinstalldirs ltconfig ltmain.sh missing ylwrap
# Files in devo/etc used in any net release.
# ChangeLog omitted because it may refer to files which are not in this
# distribution (perhaps it would be better to include it anyway).
-ETC_SUPPORT= Makefile.in cfg-paper.texi configure configure.in configure.man \
- configure.texi standards.texi make-stds.texi \
- configure.info* standards.info* cfg-paper.info*
+ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
+ make-stds.texi standards.info*
# When you use `make setup-dirs' or `make taz' you should always redefine
# this macro.
SUPPORT_FILES = list-of-support-files-for-tool-in-question
-# Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
-DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in ld/Makefile.in
.PHONY: taz
taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
- # Make sure "diststuff" files get built properly.
- for f in $(DISTBISONFILES) ; do \
- if [ -r $$f ]; then \
- sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
- mv -f tmp $$f ; \
- else true; fi ; \
- done
# Take out texinfo from a few places; make simple BISON=bison line.
sed -e '/^all\.normal: /s/\all-texinfo //' \
-e '/^ install-texinfo /d' \
- -e '/^BISON = `if/,/^$$/d' \
- -e '/^# BISON:/s/.*/BISON = bison -y/' \
<Makefile.in >tmp
mv -f tmp Makefile.in
#
@@ -1489,8 +1574,12 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
else true; fi
chmod og=u `find . -print`
- $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) \
- VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`
+ if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
+ ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \
+ else \
+ ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
+ fi; \
+ $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) VER=$$ver
do-tar-gz:
echo "==> Making $(TOOL)-$(VER).tar.gz"
diff --git a/contrib/binutils/README b/contrib/binutils/README
index 05ee85b..eb0e436 100644
--- a/contrib/binutils/README
+++ b/contrib/binutils/README
@@ -30,16 +30,13 @@ explicitly set CC in the environment before running configure, and to
also set CC when running make. For example (assuming sh/bash/ksh):
CC=gcc ./configure
- make CC=gcc
+ make
A similar example using csh:
setenv CC gcc
./configure
- make CC=gcc
-
-See etc/cfg-paper.texi, etc/configure.texi, and/or the README files in
-various subdirectories, for more details.
+ make
Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc. See the file COPYING or
diff --git a/contrib/binutils/bfd/ChangeLog b/contrib/binutils/bfd/ChangeLog
index f2f04ae..557679d 100644
--- a/contrib/binutils/bfd/ChangeLog
+++ b/contrib/binutils/bfd/ChangeLog
@@ -1,27 +1,2124 @@
+Mon Apr 27 11:49:55 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set version number to 2.9.1.
+ * configure: Rebuild.
+
+ Based on patch from H.J. Lu <hjl@gnu.org>:
+ * elf.c (bfd_elf_get_bfd_needed_list): New function.
+ * bfd-in.h (bfd_elf_get_bfd_needed_list): Declare.
+ * bfd-in2.h: Rebuild.
+
+Fri Apr 24 12:09:18 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * syms.c (struct indexentry): Change directory_name, file_name,
+ and function_name fields to char *.
+ (struct stab_find_info): Change cached_file_name field to char *.
+
+Thu Apr 16 11:43:33 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * archive.c (bfd_generic_archive_p): If a slurp subroutine returns
+ an error other than bfd_error_system_call, set the error to
+ bfd_error_wrong_format.
+
+ * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add
+ bfd_elf32_powerpcle_vec.
+
+ * elf.c (copy_private_bfd_data): If all the p_paddr fields in the
+ program segments are zero, don't set p_paddr_valid.
+
+Fri Apr 10 13:44:27 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_write_object_contents): Move a PE COMDAT symbol
+ before any other symbols in the same section.
+
+Tue Apr 7 12:35:18 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * archures.c (bfd_default_scan): Add m68k cases back to default
+ switch, reverting patch of March 25, since IEEE support depends
+ upon them.
+
+Mon Apr 6 14:06:40 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (diststuff): New target.
+ * Makefile.in: Rebuild.
+
+Sun Apr 5 16:21:44 1998 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (som_bfd_ar_write_symbol_stuff): Fix computation of
+ som_offset when we have an extended name table.
+
+Sun Apr 5 16:04:39 1998 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am (stamp-lib): Check that .libs/libbfd.a exists before
+ trying to copy it.
+ * Makefile.in: Rebuild.
+
+Fri Apr 3 11:09:42 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elf32-m68k.c (elf_m68k_size_dynamic_sections): Generate section
+ symbols when creating a shared library.
+ (elf_m68k_adjust_dynindx): New function, used by above code.
+ (elf_m68k_finish_dynamic_sections): Initialize the section
+ symbols.
+ (elf_m68k_relocate_section): Change abort to BFD_ASSERT.
+
+Wed Apr 1 13:36:58 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elf32-m68k.c (elf_m68k_relocate_section, case R_68K_PLT*O): Fix
+ assertion.
+
+Tue Mar 31 16:25:45 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Rebuild dependencies.
+ * Makefile.in: Rebuild.
+
+Mon Mar 30 16:12:17 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set version number to 2.9.
+ * configure: Rebuild.
+
+Mon Mar 30 12:20:50 1998 Brent Baccala <baccala@freesoft.org>
+
+ * syms.c (ENABLE_CACHING): Define.
+ (struct indexentry): Define.
+ (struct stab_cache): Remove.
+ (cmpindexentry): New static function.
+ (struct stab_find_info): Add new fields: indextable,
+ indextablesize, cached_indexentry, cached_offset, cached_stab, and
+ cached_file_name. Remove fields: file_cache, function_cache, and
+ line_cache.
+ (_bfd_stab_section_find_nearest_line): Rewrite to build a sorted
+ index table and search it.
+
+Mon Mar 30 10:39:34 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (_bfd_elf_copy_private_section_data): Call
+ copy_private_bfd_data once we've seen the last SEC_ALLOC section.
+
+ * cpu-mips.c: Remove trailing comma at end of enumeration list.
+
+Sat Mar 28 16:33:02 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-arm.c: Define all globally visible variables and functions
+ only when COFF_WITH_PE is not defined.
+ * configure.in (armpe_little_vec, armpe_big_vec): Add
+ coff-arm.lo.
+ * configure: Rebuild.
+
+Fri Mar 27 16:06:02 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Fix some gcc -Wall warnings:
+ * aout-arm.c (MY(fix_pcrel_26)): Add casts to avoid warnings.
+ * archive.c (_bfd_generic_read_ar_hdr_mag): Likewise.
+ * archures.c (bfd_default_scan): Likewise.
+ * bfd.c (bfd_scan_vma): Likewise.
+ * binary.c (mangle_name): Likewise
+ * coff-arm.c (aoutarm_fix_pcrel_26): Likewise.
+ * coff-sh.c (sh_relocate_section): Likewise.
+ * coff-stgo32.c (create_go32_stub): Likewise.
+ * coffcode.h (coff_slurp_line_table): Likewise.
+ * ecoff.c (_bfd_ecoff_write_armap): Likewise.
+ * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
+ (assign_file_positions_for_segments): Likewise.
+ * elf32-mips.c (mips_elf_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
+ * oasys.c (oasys_write_sections): Likewise.
+ * ppcboot.c (ppcboot_object_p): Likewise.
+ (mangle_name): Likewise.
+ * riscix.c (riscix_fix_pcrel_26): Likewise.
+ * srec.c (srec_scan): Likewise.
+ * stabs.c (_bfd_write_section_stabs): Likewise.
+ * sunos.c (sunos_add_dynamic_symbols): Likewise.
+ * aout-ns32k.c (_bfd_ns32k_relocate_contents): Add default case to
+ switch. Declare parameters for function pointers.
+ * archures.c (bfd_default_scan): Add braces to avoid ambiguous if
+ warning.
+ * elf.c (elf_sort_sections): Likewise.
+ * coff-arm.c (coff_thumb_pcrel_common): Initialize relocation.
+ Add default cases to switches.
+ (coff_arm_relocate_section): Remove unused local variables.
+ Always set rstat.
+ (coff_arm_bfd_set_private_flags): Change flag variable to type
+ flagword.
+ * coff-mips.c (mips_relocate_section): Initialize use_lo.
+ * coff-ppc.c (ppc_record_toc_entry): Change i to unsigned int.
+ (dump_toc): Change cat to const, and initialize it.
+ * coff-sh.c (sh_relax_delete_bytes): Initialize start and voff.
+ * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise.
+ (sh_elf_relocate_section): Initialize r_symndx.
+ * coffcode.h (coff_compute_section_file_positions): Only declare
+ old_sofar if ALIGN_SECTIONS_IN_FILE.
+ (coff_write_object_contents): Initialize csym.
+ * coffgen.c (coff_pointerize_aux): Make type and class unsigned.
+ * cpu-ns32k.c (_bfd_ns32k_get_displacement): Add default case to
+ switch.
+ * dwarf2.c: Include libiberty.h.
+ (read_2_signed_bytes, read_4_signed_bytes): Comment out.
+ (decode_line_info): Remove unused local variables.
+ * elf32-m32r.c (m32r_elf_sda16_reloc): Likewise.
+ (m32r_elf_relocate_section): Likewise.
+ * elf32-v850.c (v850_elf_store_addend_in_insn): Likewise.
+ (v850_elf_reloc): Likewise.
+ * elf-bfd.h (elf_linker_section_t): Make alignment unsigned.
+ (struct elf_obj_tdata): Make cverdefs and cverrefs unsigned.
+ * elf.c (assign_file_positions_for_segments): Always set adjust.
+ * elf32-d30v.c (bfd_elf_d30v_reloc): Initialize tmp_addr. Fully
+ parenthesize expression.
+ * elf32-m32r.c (m32r_elf_relocate_section): Always initialize h.
+ (m32r_elf_object_p): Return a value.
+ (m32r_elf_print_private_bfd_data): Change fprintf format string.
+ * elf32-mips.c (mips_elf_final_link): Initialize last.
+ (mips_elf_finish_dynamic_sections): Initialize last and dindx.
+ * elf32-v850.c (v850_elf_object_p): Return a value.
+ (v850_elf_print_private_bfd_data): Change fprintf format string.
+ * elfcode.h (elf_slurp_symbol_table): Change symcount and i to
+ unsigned long.
+ * elflink.h (elf_link_add_object_symbols): Change vernum to
+ unsigned int, and initialize it. Change fprintf format string.
+ (NAME(bfd_elf,size_dynamic_sections)): Cast -1 to bfd_size_type
+ when setting or comparing to soname_indx.
+ (elf_create_pointer_linker_section): Change num_symbols to
+ unsigned int.
+ * libcoff-in.h (coff_data_type): Change flags to flagword.
+ * peicode.h (pe_print_idata): Initialize idx. Change j to
+ bfd_size_type. Initialize hint_member. Remove useless test to
+ time_stamp.
+ (pe_print_edata): Change num_functions and num_names in struct
+ EDT_type to unsigned long. Remove cast. Change fprintf format
+ string.
+ * ppcboot.c (ppcboot_object_p): Change i to size_t.
+ * reloc.c (bfd_get_reloc_size): Change return type to unsigned
+ int.
+ * reloc16.c (bfd_coff_reloc16_relax_section): Change shrinks to
+ int *. Update uses. Change j to long.
+ * bfd-in2.h, libcoff.h: Rebuild.
+
+Thu Mar 26 13:32:17 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_new_section_hook): Set the type and storage
+ class in the native symbol information allocated for a new section
+ symbol.
+
+Thu Mar 26 10:13:41 1998 Nick Clifton <nickc@cygnus.com>
+
+ * peicode.h: Chain together calls to
+ coff_bfd_copy_private_bfd_data and
+ coff_bfd_print_private_bfd_data.
+
+ * coff-arm.c: Add prototypes for
+ coff_arm_bfd_print_private_bfd_data and
+ coff_arm_bfd_copy_private_bfd_data.
+
+Wed Mar 25 15:45:55 1998 Nick Clifton <nickc@cygnus.com>
+
+ * coffcode.h (coff_mkobject_hook): Set private falgs even for a PE
+ build.
+
+ * peicode.h: Call arm-coff private data functions after handling
+ pe private data.
+
+ * coff-arm.c: Turn statics into globals so that they can be shared
+ both pe and pei backends.
+
+Wed Mar 25 15:19:38 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutf1.h (sunos_set_arch_mach): Use bfd_mach_m68* rather than
+ plain numbers.
+ (sunos_write_object_contents): Likewise.
+ * aoutx.h (NAME(aout,machine_type)): Likewise.
+ * coffcode.h (coff_set_arch_mach_hook): Likewise.
+
+Wed Mar 25 13:59:24 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * archures.c (bfd_mach_m68*): Add definitions for various m68k
+ variants.
+ (bfd_default_scan): Remove m68k special cases.
+ * bfd-in2.h: Rebuild.
+ * mipsbsd.c (MY(write_object_contents)): Use bfd_mach_m68* rather
+ than plain numbers.
+ * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise.
+ * cpu-m68k.c (arch_info_struct): Likewise. Add entry for
+ m68k:68000.
+ (bfd_m68k_arch): Set mach field to zero to signal no explicit
+ selection, change printable_name to just "m68k" and make that the
+ default instead of m68k:68020.
+
+ * aout-tic30.c (NAME): Define this to avoid multiple definitions
+ from aoutx.h.
+ (MY_get_section_contents): Define as aout_32_get_section_contents
+ rather than NAME(aout,get_section_contents).
+
+ * elf-m10300.c (elf32_mn10300_link_hash_table_create): Fix cast.
+
+ * evax-alpha.c (evax_set_arch_mach): Only accept bfd_arch_alpha
+ and call bfd_default_set_arch_mach to do the real work.
+
+Wed Mar 25 10:41:35 1998 Richard Henderson <rth@cygnus.com>
+
+ * bout.c (BALX): Include return register g14 as part of the insn.
+ (BALX_MASK): New.
+ (calljx_callback): Use it.
+
+Wed Mar 25 11:19:28 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * libbfd-in.h (BFD_ALIGN): Cast this parameter to bfd_vma.
+ * libbfd.h: Rebuild.
+
+ * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Change
+ byte_count to unsigned int.
+ (mn10300_elf_relax_section): Initialize internal_relocs. Remove
+ unused local variables.
+
+ * evax-alpha.c (evax_close_and_cleanup): Remove unused local
+ variables er and er1.
+
+ * cpu-v850.c: Include <ctype.h>.
+ (scan): Case isdigit argument to unsigned char.
+
+ From Yan Meroth <YAN.MEROTH@st.com>:
+ * ihex.c (ihex_scan): Add extbase variable so that getting an
+ extended linear address record does not ignore any previous
+ extended address.
+ (ihex_write_object_contents): When writing out an extended linear
+ address record, zero out any previous extended address.
+
+Tue Mar 24 16:09:43 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * ieee.c (do_one): Check section before dereferencing it.
+ (ieee_canonicalize_reloc): Likewise with src->relent.sym_ptr_ptr.
+ (ieee_generic_stat_arch_elt): Likewise with abfd->my_archive.
+
+Mon Mar 23 18:51:47 1998 Joel Sherrill <joel@OARcorp.com>
+
+ * config.bfd: (sh*-*-rtems*): Switched from ELF to COFF.
+
+Mon Mar 23 14:23:36 1998 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c: Add interworking functions to pe backends.
+
+Fri Mar 20 18:47:20 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Use AM_DISABLE_SHARED.
+ * aclocal.m4, configure: Rebuild with libtool 1.2.
+
+Fri Mar 20 11:25:41 1998 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_relocate_section): Better error messages
+ when interowrking conflucts occur. Courtesy of Jonathan Walton
+ and Tony Thompson. PR 15357.
+ (aoutarm_std_reloc_howto): Fixed bitsize fields of rightshifted
+ relocations. Patch courtesy of Jonathan Walton and Tony
+ Thompson. PR 15373.
+
+Fri Mar 20 02:26:43 1998 Richard Henderson <rth@cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Revert
+ part of Feb 22 change controling when to override the existing
+ symbol with the .plt entry.
+
+Wed Mar 18 09:26:25 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config.bfd (targ_cpu): Add thumb-pe target.
+
+ * coffcode.h (OTHER_GLOBAL_CLASS): Support thumb external
+ functions in PE build.
+
+Sun Mar 8 23:37:26 1998 Stan Cox <scox@equinox.cygnus.com>
+
+ * config.bfd (sparclite-*-elf*): Added.
+
+Mon Feb 23 19:31:19 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Add elf.lo to elf shell variable.
+ * Makefile.am (BFD_LIBS): Remove elf.lo.
+ (BFD_LIBS_CFILES): Remove elf.c.
+ (BFD32_BACKENDS): Add elf.lo.
+ (BFD32_BACKENDS_CFILES): Add elf.c.
+ * configure, Makefile.in: Rebuild.
+
+1998-02-23 15:53 Richard Henderson <rth@cygnus.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): A pc-relative
+ relocation against a now-local symbol should not have a dynamic
+ relocation.
+
+Mon Feb 23 16:17:08 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (coff_swap_filehdr_in): Don't set BFD flag HAS_SYMS in
+ COFF filehdr flags.
+ (pe_print_private_bfd_data): Print PE flags. From Mikey
+ <jeffdb@netzone.com>.
+
+Sun Feb 22 20:39:00 1998 Richard Henderson <rth@cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create
+ a plt entry when we can determine that we authoritatively define
+ the symbol.
+
+Sun Feb 22 20:33:05 1998 Richard Henderson <rth@cygnus.com>
+
+ * configure.in (COREFILE selection): Remove sparc-*-linux*. They
+ don't actually use trad-core, but a SunOS-style core file handled
+ by gdb directly.
+ * hosts/sparclinux.h: Remove.
+
+Wed Feb 18 15:31:06 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (pe_print_idata): If there is no .idata section, look
+ for the import tables in some other section. Make the initial
+ label line up better with the data. Print the import address
+ table even if there is no import name table. If the import
+ address table holds actual addresses, print them.
+
+Tue Feb 17 12:58:34 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * libbfd.c (bfd_seek): If fseek fails, save errno around call to
+ bfd_tell. If errno is EINVAL, set bfd_error_file_truncated, not
+ bfd_error_system_call.
+
+Fri Feb 13 13:11:33 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Define.
+ * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e.
+
+ From H.J. Lu <hjl@gnu.org>:
+ * Makefile.am (libbfd_la_LDFLAGS): Define.
+ * Makefile.in: Rebuild.
+
+Thu Feb 12 17:31:11 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ NetBSD patches from Gordon W. Ross <gwr@mc.com>:
+ * netbsd.h (MACHTYPE_OK): Define.
+ (MY(write_object_contents)): Use DEFAULT_ARCH and DEFAULT_MID when
+ calling N_SET_MACHTYPE, rather than having a switch.
+ * libaout.h (enum machine_type): Add M_PMAX_NETBSD, M_VAX_NETBSD,
+ and M_ALPHA_NETBSD.
+ * i386netbsd.c (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
+ * m68k4knetbsd.c (SEGMENT_SIZE): Don't define.
+ (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
+ * m68knetbsd.c: (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
+ * ns32knetbsd.c (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
+ * sparcnetbsd.c (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
+
+ NetBSD patches from Gordon W. Ross <gwr@mc.com>:
+ * vaxnetbsd.c: New file.
+ * netbsd-core.c: Clean up. Remove unused macros. Use netbsd
+ rather than netbsd_core.
+ * targets.c (vaxnetbsd_vec): Declare.
+ (bfd_target_vector): Add vaxnetbsd_vec. If NETBSD_CORE is
+ defined, add netbsd_core_vec.
+ * configure.in: Set COREFILE for alpha*-*-netbsd* and
+ powerpc-*-netbsd* to netbsd-core.lo. If COREFILE is
+ netbsd-core.lo, set COREFLAG to -DNETBSD_CORE.
+ * config.bfd (alpha*-*-netbsd*): New target.
+ * Makefile.am: Rebuild dependencies.
+ (BFD32_BACKENDS): Add vaxnetbsd.lo.
+ (BFD32_BACKENDS_CFILES): Add vaxnetbsd.c.
+ * configure, Makefile.in: Rebuild.
+
+ * configure.host: Remove the old shared library build stuff. We
+ now use libtool instead.
+
+Wed Feb 11 17:13:09 1998 Richard Henderson <rth@cygnus.com>
+
+ * tekhex.c (tekhex_write_object_contents): Call tekhex_init.
+
+Tue Feb 10 19:23:28 1998 H.J. Lu <hjl@gnu.org>
+
+ * configure.in: Take stab-syms.lo out of sparclinux_vec list.
+ * configure: Rebuild.
+
+Tue Feb 10 15:16:38 1998 Nick Clifton <nickc@cygnus.com>
+ * elf32-v850.c (remember_hi16s_reloc): New function.
+ (find_remembered_hi16s_reloc): New function.
+ (v850_elf_store_addend_in_insn): Use the above new functions to
+ match up HI6S relocs with LO16 relocs.
+
+Tue Feb 10 15:01:39 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Change -linux* to -linux-gnu*.
+ * config.bfd, configure.host: Likewise.
+ * configure: Rebuild.
+
+Mon Feb 9 19:40:59 1998 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_store_addend_in_insn): Fix another
+ LO16/HI16S bug and improve comments about what is going on.
+
+Sat Feb 7 15:27:03 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure, aclocal.m4: Rebuild with new libtool.
+
+Fri Feb 6 11:50:22 1998 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): For BFD_RELOC_CTOR
+ get the size from bfd_arch_bits_per_address instead of directly
+ from the isa.
+
+Thu Feb 5 14:21:34 1998 Michael Meissner <meissner@cygnus.com>
+
+ * libbfd-in.h (BFD_ALIGN): If rounding up would cause the address
+ to wrap, just return all 1's bits instead.
+ * libbfd.h: Regenerate.
+
+Thu Feb 5 11:51:05 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (coff_pe_i386_relocate_section): New static function
+ if COFF_WITH_PE.
+ (coff_relocate_section): If COFF_WITH_PE, define as
+ coff_pe_i386_relocate_section.
+ * coffcode.h (coff_write_object_contents): If COFF_IMAGE_WITH_PE,
+ skip empty sections, to match coff_write_object_contents.
+
+ * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend,
+ rather than swapping out r_offset twice. From Luke Deller
+ <luked@cse.unsw.edu.au>.
+
+Wed Feb 4 19:11:28 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set libtool_enable_shared rather than
+ libtool_shared. Remove diversion hack.
+ * configure, Makefile.in, doc/Makefile.in, aclocal.m4: Rebuild
+ with new libtool.
+
+Wed Feb 4 16:10:21 1998 Brent Baccala <baccala@freesoft.org>
+
+ * syms.c (struct stab_cache): Define.
+ (struct stab_find_info): Remove cached_offset, cached_stab,
+ cached_str, and cached_stroff fields. Add file_cache,
+ function_cache, and line_cache fields.
+ (_bfd_stab_section_find_nearest_line): Use extensive caching to
+ speed up searches.
+
+Wed Feb 4 13:34:22 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (pe_print_idata): Check for import of ordinal rather
+ than name.
+ (pe_print_edata): If there is no .edata section, look for the
+ export data in some other section.
+
+Mon Feb 2 20:05:42 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * configure.in: Change version to 2.8.4.
+ * configure: Regenerated.
+
+Mon Feb 2 17:39:39 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
+
+ Add tms320c30 support:
+ * cpu-tic30.c: New file.
+ * aout-tic30.c: New file.
+ * coff-tic30.c: New file.
+ * archures.c (bfd_arch_tic30): Define.
+ (bfd_tic30_arch): Declare.
+ (bfd_archures_list): Add bfd_tic30_arch.
+ * targets.c (bfd_target_vector): Add tic30_aout_vec and
+ tic30_coff_vec.
+ * reloc.c (BFD_RELOC_TIC30_LDP): Define.
+ * coffcode.h (coff_set_arch_mach_hook): Add tic30 case.
+ (coff_set_flags): Likewise.
+ * config.bfd (tic30-*-*aout*, tic30-*-*coff*): New targets.
+ * configure.in (tic30_aout_vec, tic30_coff_vec): New vectors.
+ * Makefile.am: Rebuild dependencies.
+ (ALL_MACHINES): Add cpu-tic30.lo.
+ (ALL_MACHINES_CFILES): Add cpu-tic30.c.
+ (BFD32_BACKENDS): Add aout-tic30.lo and coff-tic30.lo.
+ (BFD32_BACKENDS_CFILES): Add aout-tic30.c and coff-tic30.c.
+ * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild.
+
+Mon Feb 2 12:25:12 1998 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_store_addend_in_insn): Allow HI16_S reloc
+ to lag behind LO16 reloc by a couple of instructions.
+
+Mon Feb 2 14:09:46 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am ($(srcdir)/bfd-in2.h): Add dummy command to force
+ make to reexamine the file timestamp.
+ ($(srcdir)/libbfd.h, $(srcddir)/libcoff.h): Likewise.
+
+ * elf64-alpha.c (ELF_MAXPAGESIZE): Change to 0x10000 from
+ 0x100000.
+
+Fri Jan 30 19:07:07 1998 Geoff Keating <geoffk@ozemail.com.au>
+
+ * elf32-ppc.c (ppc_elf_create_dynamic_sections): New procedure
+ to create .dynsbss and .rela.sbss sections.
+ (ppc_elf_adjust_dynamic_symbol): Put space for small data to be
+ copied from dynamic objects into .sbss.
+ (ppc_elf_size_dynamic_sections): Strip .rela.sbss if we don't
+ use it. Correct typo of .rela.sdata2.
+ (ppc_elf_finish_dynamic_symbol): Generate reloc to where we
+ put the data, which may now be in .sbss.
+ (ppc_elf_relocate_section): A SDAREL16 reloc can be in dynsbss.
+ (elf_backend_create_dynamic_sections): Define as
+ ppc_elf_create_dynamic_sections.
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Don't emit R_PPC_REL* relocs
+ against _GLOBAL_OFFSET_TABLE_.
+ (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in
+ shared libraries which refer to local symbols. Make sure that the
+ test for allocating space for a reloc in a shared object is the
+ same as the test for emitting a reloc.
+
+Thu Jan 29 15:55:35 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
+
+ * config.bfd (i[3456]-*-mingw32*): New target.
+ * acinclude.m4 (BFD_BINARY_OPEN): Check for mingw32.
+ * aclocal.m4, configure: Rebuild.
+
+Wed Jan 28 13:41:26 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we
+ have a bfd_object.
+
+Tue Jan 27 21:43:55 1998 Richard Henderson <rth@cygnus.com>
+
+ Sparc v9 ABI compliant PLT:
+ * elf64-sparc.c (PLT_HEADER_SIZE): V9 ABI uses 4 entries.
+ (plt_templates, sparc64_elf_build_plt_entry): Delete.
+ (LARGE_PLT_THRESHOLD): New define.
+ (GOT_RESERVED_ENTRIES): V9 ABI only uses 1.
+ (sparc64_elf_build_plt): New function.
+ (sparc64_elf_plt_entry_offset): Likewise.
+ (sparc64_elf_plt_ptr_offset): Likewise.
+ (sparc64_elf_adjust_dynamic_symbol): Change h->plt_offset to
+ contain the index for convenience. Skip the initial entries
+ in .rela.plt.
+ (sparc64_elf_size_dynamic_sections): Zero the allocated contents
+ memory for the benefit of .rela.plt.
+ (sparc64_elf_relocate_section): Call sparc64_elf_plt_entry_offset.
+ (sparc64_elf_finish_dynamic_symbol): Kill template stuff. Use
+ sparc64_elf_plt_entry_offset & sparc64_elf_plt_ptr_offset for reloc.
+ (sparc64_elf_finish_dynamic_sections): DT_PLTGOT points to .plt.
+ Call sparc64_elf_build_plt.
+ (elf_backend_want_got_plt): No.
+ (elf_backend_plt_readonly): No.
+ (elf_backend_plt_alignment): 8.
+
+ * elf.c (_bfd_elf_close_and_cleanup): New function; free the shstrtab.
+ * elf-bfd.h (_bfd_elf_close_and_cleanup): Declare it.
+ * elfxx-target.h (bfd_elfNN_close_and_cleanup): Arrange for it
+ to be called.
+
+Tue Jan 27 21:45:15 1998 Jeffrey A Law (law@cygnus.com)
+
+ * archures.c (bfd_mach_mips*): Add definitions for various MIPS
+ processors.
+ * cpu-mips.c (arch_info_struct): Add mips variants.
+ * bfd-in2.h: Rebuilt.
+
+Tue Jan 27 15:06:04 1998 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_relocate_section): Fix for PR14752 by
+ preserving the contents of t2a3_b_insn.
+
+Tue Jan 27 12:47:27 1998 Robert Lipe <robertl@dgii.com>
+
+ * config.bfd (i[3456]86-sco3.2v5*): ELF now the default.
+ (i[3456]86sco3.2v5*coff): New target.
+
+Mon Jan 26 15:41:30 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd-in2.h: Rebuild with changes to chew--tab expansion.
+
+Thu Jan 22 21:26:48 1998 Richard Henderson <rth@cygnus.com>
+
+ * bfd.c (bfd_get_error_handler): Add orthogonal function.
+ * bfd-in2.h: Regenerate.
+
+Thu Jan 22 21:13:39 1998 Richard Henderson <rth@cygnus.com>
+
+ * tekhex.c (tekhex_write_object_contents): Check for no symbols.
+
+Wed Jan 21 21:19:03 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (coff_i386_rtype_to_howto): If COFF_WITH_PE, don't
+ adjust addend for an output common symbol (from Jimmy Blair
+ <jimmyb@wrs.com>). If COFF_WITH_PE, adjust addend for PC relative
+ defined symbol to counteract adjustment made in generic relocation
+ code.
+
+ * dwarf2.c: Include sysdep.h, not stdio.h and stdlib.h.
+
+Wed Jan 21 21:16:06 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * coff-m88k.c (GET_SCNDHR_NRELOC): Fix typo in macro name.
+ (GET_SCNDHR_NLNNO): Likewise.
+
+Mon Jan 19 12:49:52 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * cpu-sh.c (arch_info_struct): Correct next field of sh3e.
+
+Wed Jan 14 17:23:27 1998 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-m32r.c: Add macros to handle NOP insertion.
+
+Wed Jan 14 16:15:22 1998 Richard Henderson <rth@cygnus.com>
+
+ * xcofflink.c (xcoff_mark_symbol): Don't mark the absolute section.
+ (xcoff_mark): Likewise.
+ (xcoff_build_ldsyms): Mark absolute symbols.
+
+Wed Jan 14 16:03:11 1998 Richard Henderson <rth@cygnus.com>
+
+ * bout.c (b_out_write_object_contents): Sort symbols before output
+ to keep {CALL,BAL}NAME symbols adjacent.
+ (b_out_symbol_cmp): New function.
+
+Tue Dec 30 12:45:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_check_relocs): If -Bsymbolic, don't
+ allocate space for a PC relative reloc against a symbol which is
+ defined in a regular file.
+ (elf32_sparc_relocate_section): If -Bsymbolic, don't copy a PC
+ relative reloc against a symbol which is defined in a regular
+ file.
+
+Mon Dec 29 18:02:28 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Jonathan Stone <jonathan@DSG.Stanford.EDU>:
+ * config.bfd (mips-dec-netbsd*): Add ECOFF vectors to
+ targ_selvecs.
+ (mips*el-*-netbsd*): Like mips-dec-netbsd*.
+ (mips*-*-netbsd*): New target.
+
+Mon Dec 29 17:13:28 1997 H.J. Lu (hjl@gnu.org)
+
+ * elflink.h (elf_link_assign_sym_version): Change error message
+ from "undefined version name" to "undefined versioned symbol
+ name".
+
+Mon Dec 29 11:41:16 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_relocate_section): Fix typo from previous
+ delta.
+
+Tue Dec 23 17:01:10 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Declare.
+ * libbfd.h: Rebuild.
+
+ * peicode.h (coff_swap_scnhdr_out): Set .reloc section to be
+ shared. Set stab* sections to be shared and read. Set .rsrc
+ section to be read and shared.
+
+Mon Dec 22 13:20:57 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Rebuild dependencies.
+ (ALL_MACHINES_CFILES): Add dwarf2.lo.
+ (ALL_MACHINES_CFILES): Add dwarf2.c.
+ * Makefile.in: Rebuild.
+
+ * coff-arm.c: Don't include obstack.h.
+
+Mon Dec 22 13:04:33 1997 Joel Sherrill <joel@oarcorp.com>
+
+ * config.bfd (i[3456]86*-go32-rtems*): Fix to be the same as
+ i[3456]86-go32.
+
+Thu Dec 18 16:01:25 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * configure: Regenerate to get @SHELL@ substituted.
+
+Wed Dec 17 09:45:09 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_relocate_section): Only look at section
+ owner if there is one.
+
+ * elf.c (assign_file_positions_for_segments): Fail if there is not
+ enough room for the program headers. (PR14186)
+
+Tue Dec 16 08:09:56 1997 Gavin Koch <gavin@cygnus.com>
+
+ * elf.c (_bfd_elf_find_nearest_line): Call
+ _bfd_dwarf2_find_nearest_line first.
+ * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Same.
+ * dwarf2.c: New file; implement _bfd_dwarf2_find_nearest_line.
+
+Mon Dec 15 16:08:52 1997 Nick Clifton <nickc@cygnus.com>
+
+ * archures.c: Add bfd_mach_m32r.
+
+Mon Dec 15 16:11:22 1997 Fred Fish <fnf@cygnus.com>
+
+ * coffcode.h (ALIGN_SECTIONS_IN_FILE): Define if I960 not defined.
+ (coff_compute_section_file_positions): Use ALIGN_SECTIONS_IN_FILE
+ to decide when to align the file sections for paging.
+
+Mon Dec 15 15:01:15 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-m32r.c (m32r_elf_object_p): New Function.
+ (m32r_elf_final_write_processing): New Function.
+ (m32r_elf_set_private_flags): New Function.
+ (m32r_elf_copy_private_bfd_data): New Function.
+ (m32r_elf_merge_private_bfd_data): New Function.
+ (m32r_elf_print_private_bfd_data): New Function.
+ (elf_backend_object_p): Point to m32r_object_p.
+ (elf_backend_final_write_processing): Point to
+ m32r_elf_final_write_processing.
+ (bfd_elf32_bfd_copy_private_bfd_data): Point to
+ m32r_elf_copy_private_bfd_data.
+ (bfd_elf32_bfd_merge_private_bfd_data): Point to
+ m32r_elf_merge_private_bfd_data.
+ (bfd_elf32_bfd_set_private_flags): Point to
+ m32r_elf_set_private_bfd_data.
+ (bfd_elf32_bfd_print_private_bfd_data): Point to
+ m32r_elf_print_private_bfd_data.
+
+
+ * bfd-in2.h (bfd_mach_m32r): Add identifier for M32R architecture
+ machines.
+
+Fri Dec 12 11:30:28 1997 Brendan Kehoe <brendan@canuck.cygnus.com>
+
+ * configure: Only build libbfd shared if --enable-shared's value
+ was `yes', or was set to `*bfd*'.
+ * aclocal.m4: Likewise.
+ * NOTE: this really needs to be fixed in libtool/libtool.m4, the
+ original source of this bit of code. It's not clear what the best fix
+ would be, though.
+
+Thu Dec 11 17:48:11 1997 Richard Henderson <rth@cygnus.com>
+
+ * linker.c (generic_link_add_symbol_list): Always init udata.p so
+ that the generic relaxation code can function when input and output
+ file formats are mismatched.
+
+Thu Dec 11 01:02:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (bfd_coff_small_swap_table): Initialize new fields.
+
+ * elf.c (assign_file_positions_for_segments): For a loadable
+ section, make sure that the load address is correct relative to
+ the load address of the segment plus the size of the segment so
+ far.
+
+ * coffcode.h (_coff_link_output_has_begun): Make static.
+ (_coff_final_link_postscript): Likewise.
+
+Wed Dec 10 23:37:11 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_input_bfd): Handle a relocateable link in
+ which a relocation refers to an indirect or warning symbol.
+
+Wed Dec 10 11:15:55 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (bfd_arm_coff_final_link): Function deleted.
+ (coff_arm_final_link_postscript): New function.
+ (coff_arm_link_output_has_begun): New function.
+
+ * libcoff.h (struct bfd_coff_backend_data): Add new fields:
+ _bfd_coff_link_output_has_begun and
+ _bfd_coff_final_link_postscript. Add new macros:
+ bfd_coff_link_output_has_begun() and
+ bfd_coff_final_link_postscript().
+
+ * cofflink.c (_bfd_coff_final_link): Insert calls to
+ bfd_coff_link_output_has_begun() and
+ bfd_coff_final_link_postscript().
+
+ * coffcode.h: Add two new fields to bfd_coff_backend_data
+ structure: _bfd_coff_link_output_has_begun and
+ _bfd_coff_final_link_postscript. Add default initialisers for
+ these fields. Add overridable aliases for the coff swap functions
+ in the backend data structure.
+
+ * elf32-v850.c: Update with patches from the branch to fix
+ HI16_S/LO16 reloc pairs.
+
+Tue Dec 9 11:37:53 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * archures.c (bfd_mach_mips*): Define.
+ (bfd_default_scan): For 3000 and 4000 replace magic constant with
+ macro.
+
+ * cpu-mips.c (N): Define.
+ (bfd_mips_arch, arch_info_struct): Re-write using macro N, replace
+ numbers with bfd_mach_mips* macros.
+
+Fri Dec 5 11:13:46 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_reloc, v850_elf_store_addend_in_insn,
+ v850_elf_relocate_section): Fix PR2 14180 and 14181
+ (v850_elf_section_from_bfd_section, v850_elf_symbol_processing,
+ v850_elf_add_symbol_hook, v850_elf_link_output_symbol_hook,
+ v850_elf_section_from_shdr, v850_elf_fake_sections): New functions
+ (for PR14180) to create and handle special common sections.
+ (v850_elf_final_link_relocate): Fix HI16 and HI16_S relocations
+ which have data stored in the instructions. PR14258.
+
+Tue Dec 2 10:26:16 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (TARGET_UNDERSCORE): Revert back to '_'
+ (USER_LABEL_PREFIX): Revert back to '_'
+
+ * config.bfd (targ_cpu): Add support for Thumb target.
+
+Mon Dec 1 20:24:18 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * coff-sh.c (sh_coff_howtos): Add R_SH_SWITCH8 entry.
+ (get_symbol_value): Handle R_SH_SWITCH8.
+ (sh_relax_delete_bytes): Likewise.
+
+Wed Nov 26 14:13:34 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (TARGET_UNDERSCORE): Changed to match definition in
+ gcc/config/arm/semi.h
+
+ * coffcode.h (coff_slurp_symbol_table): Add ARM and Thumb symbol
+ classes.
+
+Sun Nov 23 16:02:58 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * freebsd.h (SWAP_MAGIC): Read magic number little and not big
+ endian.
+
+Wed Nov 26 09:30:37 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coffcode.h (coff_mkobject_hook): Only set private flags for non
+ PE ARM ports.
+
+Tue Nov 25 15:33:23 1997 Richard Henderson <rth@cygnus.com>
+
+ * binary.c (binary_set_section_contents): Also ignore NEVER_LOAD
+ sections.
+
+Tue Nov 25 10:55:36 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): Do not
+ complain if inout and output formats differ.
+
+Tue Nov 25 11:26:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (BFD32_BACKENDS): Remove tekhex.lo.
+ (BFD32_BACKENDS_CFILES): Remove tekhex.c.
+ * Makefile.in: Rebuild.
+ * aclocal.m4, configure, src/Makefile.in: Rebuild with current
+ automake and autoconf.
+
+ * coff-arm.c (arm_allocate_interworking_sections): Fix typo
+ (COFF_WITH_PR to COFF_WITH_PE).
+
+Mon Nov 24 15:47:49 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c: Make variables and some functions static, so that
+ this file can be included in multiple object files.
+ (coff_arm_bfd_final_link): Fix minor bug.
+
+Sat Nov 22 15:16:00 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c: Add support for PIC and APCS-FLOAT type binaries.
+
+ * coffcode.h: Add support for PIC and APCS-FLOAT type binaries.
+
+Sat Nov 22 16:06:56 1997 Klaus Kaempf <kkaempf@progis.de>
+
+ * evax-emh.c (_bfd_evax_write_emh): Use alloca instead of strdup.
+
+Sat Nov 22 12:29:30 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (sunos_add_one_symbol): When overriding a defined
+ symbol, set it to undefined, not new.
+
+ * elf32-sh.c (sh_elf_relax_delete_bytes): Don't kill LABEL
+ relocs.
+
+Fri Nov 21 14:14:22 1997 Richard Henderson <rth@cygnus.com>
+
+ * coff-sh.c (sh_relax_section): Force sign extention of USES r_offset.
+ (sh_relax_delete_bytes): Don't kill LABEL relocs.
+
+Mon Nov 17 15:08:38 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Fix typo.
+ (mn10300_elf_relax_section): Likewise.
+
+Sat Nov 15 15:36:07 1997 Fred Fish <fnf@cygnus.com>
+
+ * peicode.h (coff_swap_aouthdr_in): Cast second arg of
+ bfd_h_get_* calls to "bfd_byte *".
+
+Tue Nov 11 10:37:23 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field
+ "movm_stack_size".
+ (mn10300_elf_relax_section): Include stack space for register saves
+ in the imm8 field of a "call" instruction.
+ (compute_function_info): Determine how much stack is allocated by
+ the movm instruction. Fix typo.
+ (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size.
+
+Mon Nov 10 14:32:40 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't crash if
+ a version dependency could not be found.
+
+Tue Nov 4 12:05:56 1997 Klaus K"ampf <kkaempf@progis.de>
+
+ * configure.com: Get version info from configure.in
+
+Fri Oct 24 11:15:58 1997 Jakub Jelinek <jj@sunsite.mff.cuni.cz>
+
+ * elf64-sparc.c (sparc64_elf_merge_private_bfd_data):
+ New function. Avoid mixing US1 and HAL R1 code.
+ Set resulting memory ordering to the strongest one used.
+ (sparc64_elf_object_p): Set bfd_mach correctly.
+
+Thu Oct 23 14:09:33 1997 Richard Henderson <rth@cygnus.com>
+
+ * elf64-sparc.c (sparc64_elf_howto_table): Add UA64 & UA16.
+ (sparc64_elf_check_relocs): Handle them.
+ (sparc64_elf_relocate_section): Likewise. Before emitting a dyn reloc,
+ check alignment and transmute R_SPARC_x<->R_SPARC_UAx.
+
+Thu Oct 23 00:53:14 1997 Richard Henderson <rth@dot.cygnus.com>
+
+ * configure.in (sparc*-*-linux*): Use trad-core and ...
+ * hosts/sparclinux.h: New file.
+
+Thu Oct 23 00:25:29 1997 Richard Henderson <rth@dot.cygnus.com>
+
+ * config.bfd (sparc64-*-linux*): New target.
+
+ * elf-bfd.h (struct elf_backend_data): Add plt_alignment member.
+ * elflink.c (_bfd_elf_create_got_section): Set .got alignment based
+ on arch_size.
+ (_bfd_elf_create_dynamic_sections): Likewise for .rel* sections.
+ Set .plt alignment from new plt_alignment.
+ * elflink.h (elf_link_create_dynamic_sections): Set version section
+ alignment to LOG_FILE_ALIGN.
+ * elfxx-target.h (elf_backend_plt_alignment): Provide default.
+ (elfXX_bed): Init plt_alignment.
+
+ * elf64-sparc.c (sparc64_elf_check_relocs,
+ sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections,
+ sparc64_elf_adjust_dynindx, sparc64_elf_finish_dynamic_symbol,
+ sparc64_elf_finish_dynamic_sections): New functions.
+ (sparc64_elf_howto_table): Fix a few name strings.
+ (ELF_DYNAMIC_INTERPRETER): New definition.
+ (sparc64_elf_relocate_section): Handle shared libraries.
+
+ * elf64-sparc.c (struct plt_template, plt_*_header, plt_*_entry,
+ sparc64_elf_build_plt_entry, sparc64_elf_finish_dynamic_symbol):
+ PLT definitions sparc64-linux originally choose. These will go
+ away soon in favour of the official abi definitions.
+
+Wed Oct 22 16:08:45 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (coff_small_object_p): New static function.
+ (coff_small_new_section_hook): New static function.
+ (bfd_coff_small_swap_table): New static const structure.
+ (coff_small_close_and_cleanup): Define.
+ (coff_small_bfd_free_cached_info): Define.
+ (coff_small_get_section_contents): Define.
+ (coff_small_get_section_contents_in_window): Define.
+ (shcoff_small_vec): New static structure.
+ (shlcoff_small_vec): New static structure.
+ * targets.c (bfd_target_vector): Add shcoff_small_vec and
+ shlcoff_small_vec.
+ * config.bfd (sh-*-elf*): Add shcoff_small_vec and
+ shlcoff_small_vec to targ_selvecs.
+ (sh-*-*): Likewise.
+ * configure.in: Add shcoff_small_vec and shlcoff_small_vec cases.
+ * configure: Rebuild.
+
+Mon Oct 20 15:01:27 1997 Klaus K"ampf <kkaempf@progis.de>
+
+ * evax-egsd.c: Weak symbols are global.
+
+ * evax-emh.c: Use proper casts.
+
+ * evax-egsd.c (_bfd_evax_write_egsd): Remove unneeded uname.
+
+ * evax-egsd.c: Section names and symbols have different
+ length restrictions. Add length parameter to
+ _bfd_evax_length_hash_symbol.
+ * evax-etir.c: Likewise.
+ * evax-misc.c (_bfd_evax_length_hash_symbol): Add length
+ parameter.
+ * evax.h (EOBJ_S_C_SECSIZ): Define.
+
+ * evax-alpha.c: Remove duplicate test.
+
+ * evax-emh.c: SYS$ functions are upper-case.
+
+ * evax-egsd.c: Create separate sections for common symbols.
+ * evax-etir.c: Don't output common section.
+ * evax.h: Bump up section count.
+
+ * configure.com: Use 64bit integers with DEC C.
+
+ * evax-egsd.c: Make section flags dec c compatible.
+
+Mon Oct 20 09:38:31 1997 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (normalize): Delete function.
+ (som_bfd_ar_write_symbol_stuff): New parameter elength. All callers
+ changed. Use passed in elength to determine size of the extended
+ name table instead of computing it again.
+
+Sun Oct 19 23:36:21 1997 Jim Wilson <wilson@cygnus.com>
+
+ * peicode.h (coff_swap_scnhdr_out): Use |= not = to set
+ IMAGE_SCN_MEM_READ for an unrecognized section.
+
+Sun Oct 19 21:04:56 1997 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (som_bfd_ar_write_symbol_stuff): Account for trailing
+ '/' in the extended name table.
+
+Fri Oct 17 00:04:13 1997 Richard Henderson <rth@cygnus.com>
+
+ * elflink.h (elf_link_assign_sym_version): For explicitly versioned
+ symbols, check globals list before matching on locals.
+
+Thu Oct 16 08:17:06 1997 Michael Meissner <meissner@cygnus.com>
+
+ * peicode.h (coff_swap_scnhdr_out,pe_print_idata): Fix mangled
+ patch.
+
+Wed Oct 15 13:45:10 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (pe_mkobject_hook): Set DLL flag.
+ (pe_bfd_copy_private_bfd_data): Copy DLL flag.
+
+ * peicode.h (coff_swap_scnhdr_out): Set IMAGE_SCN_MEM_DISCARDABLE
+ for .stab* sections. Replace strlen of constant strings with
+ number.
+
+Tue Oct 14 15:42:45 1997 Richard Henderson <rth@cygnus.com>
+
+ * elf64-alpha.c (elf64_alpha_merge_ind_symbols): New function to
+ merge got and reloc entries from ind syms to their target.
+ (elf64_alpha_always_size_sections): Call it.
+ (elf64_alpha_check_relocs): Operate on the target of indirect symbols.
+ (elf64_alpha_can_merge_gots): Likewise.
+ (elf64_alpha_merge_gots): Likewise.
+
+ * elf64-alpha.c (elf64_alpha_relocate_section): Back out HJ's change,
+ as it is insufficient to handle the relocation changes as well.
+
+Mon Oct 13 23:10:08 1997 Richard Henderson <rth@cygnus.com>
+
+ * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Allow for RELATIVE
+ relocs for symbols in shlibs that have been forced local.
+ (elf64_alpha_relocate_section): Output RELATIVEs in .got for same.
+
+Mon Oct 13 21:24:04 1997 Richard Henderson <rth@cygnus.com>
+
+ * elf64-alpha.c (elf64_alpha_relocate_section): Use the
+ got_enties of the default symbol for the default versioned
+ symbol. Patch from hjl@gnu.ai.mit.edu, modified not to use
+ alloca in the loop.
+
+Mon Oct 13 17:37:37 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_final_link_relocate): Only use the bottom
+ 24 bits of the PC when computing a PC relative relocation.
+
+Fri Oct 10 16:01:30 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_reloc, v850_elf_final_link_relocate):
+ Correct value for maximum positive 22 bit PC relative relocation.
+ (v850_elf_final_link_relocate): Prevent overflow from HI16_S and
+ HI_16 relocations. Correct bit adjustment in TDA offsets.
+
+Thu Oct 9 16:43:39 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf64-sparc.c (sparc_elf_{hix22,lox10}_reloc): New functions.
+ (sparc64_elf_howto_table): Use them for HIX22,LOX10 relocs.
+
+Wed Oct 8 11:38:45 1997 Richard Henderson <rth@cygnus.com>
+
+ * elfcore.h (bfd_prstatus): Pedanticly, alignment_power should
+ be LOG_FILE_ALIGN.
+
+Wed Oct 8 11:36:00 1997 Richard Henderson <rth@cygnus.com>
+
+ * config.bfd: Missed one alpha* change.
+
+Tue Oct 7 13:00:17 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf32-sparc.c (_bfd_sparc_elf_howto_table): Remove BFD64 support.
+ * elf64-sparc.c (SPARC64_OLD_RELOCS): Undef.
+ (MINUS_ONE): New macro.
+ (sparc_elf_notsup_reloc): New function.
+ (sparc64_elf_howto_table): Add entries for DISP64,PLT64,HIX22,LOX10,
+ H44,M44,L44,REGISTER.
+ (sparc_reloc_map): Likewise. Map BFD_RELOC_CTOR to R_SPARC_64.
+ (init_insn_reloc): New function.
+ (sparc_elf_wdisp16_reloc): Use it.
+ (sparc64_elf_relocate_section): Add entries for OLO10,HIX22,LOX10.
+
+Tue Oct 7 11:40:37 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * som.c (som_construct_extended_name_table): Remove static
+ function, and define as macro instead.
+
+Fri Oct 3 14:02:17 1997 Richard Henderson <rth@cygnus.com>
+
+ * config.bfd: Change alpha-*-* to alpha*-*-*; config.guess now
+ recognizes alphaev5 etc.
+ * configure.host: Likewise.
+
+Fri Oct 3 11:23:47 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ Make ld -s work on AIX:
+ * xcofflink.c (xcoff_link_add_symbols): Don't create the .debug
+ section if we are stripping.
+ (bfd_xcoff_size_dynamic_sections): Don't set the .debug section
+ size if we are stripping.
+ (_bfd_xcoff_bfd_final_link): Don't set SEC_RELOC or rel_filepos,
+ and don't write out relocs, if we are stripping.
+ (xcoff_link_input_bfd): Don't set up reloc if we are stripping.
+ (xcoff_write_global_symbol): Don't write out symbol or reloc if we
+ are stripping.
+
+ * configure.in: Don't include elf.lo again for ELF targets; it's
+ always in the library anyhow.
+ * configure: Rebuild.
+
+ * bfd-in2.h: Rebuild.
+
+ * elf32-sparc.c (sparc_elf_wdisp16_reloc): Cast to bfd_byte *, not
+ char *, when calling bfd_get_32 and bfd_put_32.
+ * sunos.c (sunos_scan_dynamic_symbol): Cast contents to char *
+ when calling strcpy.
+
+Thu Oct 2 16:15:50 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * reloc.c (bfd_check_overflow): New function.
+ (bfd_perform_relocation, bfd_install_relocation): Use it.
+ (BFD_RELOC_SPARC_{DISP64,PLT64}): New relocs.
+ (BFD_RELOC_SPARC_{HIX22,LOX10,H44,M44,L44,REGISTER}): New relocs.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
+Thu Oct 2 13:17:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (coff_swap_scnhdr_out): Set IMAGE_SCN_MEM_READ for an
+ unrecognized section. From Jon Thackray <jont@harlequin.co.uk>.
+
+Wed Oct 1 14:03:44 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am ($(BFD_H)): Change stmp-bfd.h to stmp-bfd-h.
+ (stmp-bfd-h): Rename from stmp-bfd.h.
+ (BFD_H_FILES, LIBBFD_H_FILES, LIBCOFF_H_FILES): New variables.
+ ($(srcdir)/bfd-in2.h): Just depend upon stmp-bin2-h.
+ (stmp-bin2-h): New target.
+ ($(srcdir)/libbfd.h): Just depend upon stmp-lbfd-h.
+ (stmp-lbfd-h): New target.
+ ($(srcdir)/libcoff.h): Just depend upon stmp-lcoff-h.
+ (stmp-lcoff-h): New target.
+ (CLEANFILES): Change stmp-bfd.h to stmp-bfd-h. Add stmp-bin2.h,
+ stmp-lbfd-h, and stmp-lcoff-h.
+ * Makefile.in: Rebuild.
+
+ * configure.in: Use a diversion to set enable_shared before the
+ arguments are parsed.
+ * configure: Rebuild.
+
+Tue Sep 30 14:18:32 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf32-sparc.c (_bfd_sparc_elf_howto_table): R_SPARC_GLOB_JMP
+ renamed to R_SPARC_UNUSED_42.
+ (sparc_reloc_map): Delete R_SPARC_GLOB_JMP entry.
+ * elf64-sparc.c (_bfd_sparc_elf_howto_table): R_SPARC_GLOB_JMP
+ renamed to R_SPARC_UNUSED_42.
+ (sparc_reloc_map): Delete R_SPARC_GLOB_JMP entry.
+ * reloc.c (BFD_RELOC_SPARC_GLOB_JMP): Delete.
+ * bfd-in2.h: Regenerated.
+ * libbfd.h: Regenerated.
+
+Thu Sep 25 12:15:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_merge_symbol): Don't check the hash creator until
+ after we have set *sym_hash.
+
+Wed Sep 24 16:52:28 1997 Joel Sherrill <joel@oarcorp.com>
+
+ * config.bfd (sh*-*-rtems*): New target, like sh-*-*elf*.
+
+Wed Sep 24 11:27:23 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (libbfd_a_SOURCES): Define.
+ * Makefile.in: Rebuild.
+
+ * configure.in: Call AC_CHECK_TOOL before AM_PROG_LIBTOOL.
+ * aclocal.m4: Rebuild with new libtool.
+ * configure: Rebuild.
+
+Tue Sep 23 19:03:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (map_sections_to_segments): Even if we are not demand
+ paged, don't put a loadable section after a nonloadable section.
+ (assign_file_positions_for_segments): Increment the file offset
+ for a section with contents, even if it is not loadable.
+
+Thu Sep 18 15:04:57 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_check_relocs): Improve error message.
+
+Wed Sep 17 09:54:51 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_final_link_relocate): Add checks to catch
+ relocations against non-existant symbols.
+
+Tue Sep 16 14:20:27 1997 Nick Clifton <nickc@cygnus.com>
+
+ * reloc.c: Add BFR_RELOC_V850_TDA_16_16_OFFSET.
+
+ * elf32-v850.c (v850_elf_reloc, v850_elf_final_link_relocate,
+ v850_elf_howto_table, v850_elf_reloc_map): Add support for a 16
+ bit reloc in the tiny data area.
+
+Wed Sep 10 15:17:25 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_reloc): Remove spurious error message.
+
+Wed Sep 10 11:17:50 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * archures.c (bfd_default_scan): Use strcasecmp.
+ (bfd_default_scan): Test for match with arch_name + ":" +
+ printable_name.
+ (bfd_default_scan): Test for match with printable_name - ":".
+ (bfd_default_scan): Delete w65, h8300, h8500, z8k, i960 special
+ cases. Each implements their own scan function.
+ (bfd_default_scan): Delete 386, 2900, 860, mips 2000, mips 4400
+ special cases. Since info->mach == 0. The test mach == number
+ fails.
+ (bfd_arch_list): New function, return name of all the supported
+ architectures.
+
+Tue Sep 9 10:21:56 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_print_private_bfd_data): Break after
+ decoding architecture.
+ (v850_elf_reloc): Do not complain if a R_V850_LO16 reloc has bit
+ 15 set.
+
+Sun Sep 7 12:25:22 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+
+ * bfd/elf64-alpha.c (reloc_howto_type): Fix the howto table.
+
+Thu Sep 4 09:44:10 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Rebuild dependencies.
+ (ALL_MACHINES_CFILES): Add cpu-v850.c.
+ (ALL_MACHINES_CFILES): Add elf32-v850.c.
+ * Makefile.in: Rebuild.
+
+ * reloc.c: Remove extraneous commas from relocation entries.
+ Remove BFD_RELOC_V850_16_PCREL.
+ * bfd-in2.h: Rebuild.
+
+ * xcofflink.c (xcoff_link_add_symbols): Put XTY_CM/XMC_TD symbols
+ in sections named .tocbss rather than .bss.
+
+Wed Sep 3 11:23:23 1997 Nick Clifton <nickc@cygnus.com>
+
+ * libbfd.h, bfd-in2.h, elf32-v850.c: Removed
+ BFD_RELOC_V850_16_PCREL.
+
+Tue Sep 2 20:44:10 1997 Fred Fish <fnf@cygnus.com>
+
+ * cofflink.c (coff_link_check_ar_symbols): Handle C_SYSTEM syms
+ the same as C_EXT syms.
+ (coff_link_add_symbols): Ditto.
+ (_bfd_coff_link_input_bfd): Ditto.
+ (_bfd_coff_write_task_globals): Add save_global_to_static. Use
+ it to preserve and restore state of global_to_static flag.
+
+Tue Sep 2 17:45:22 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_object_p): Set machine number based on
+ bits in e_flags field rather than magic numbers.
+ (v850_elf_final_write_processing, v850_elf_set_private_flags,
+ v850_elf_copy_private_bfd_data, v850_elf_merge_private_bfd_data,
+ v850_elf_print_private_bfd_data): New functions.
+
+
+Tue Sep 2 17:35:05 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * cpu-arc.c (arc_get_mach): Properly scan defined mach entries.
+
+Tue Sep 2 18:29:37 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-m10200.c (mn10200_elf_final_link_relocate): PC relative
+ instructions are relative to the next instruction, not the
+ current instruction.
+ (mn10200_elf_relax_section): Similarly.
+
+Tue Sep 2 15:45:45 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-v850.c: Use a macro to construct bfd_arch_info_type
+ entries.
+
+ * reloc.c, libbfd.h, bfd-in2.h, elf32-v850.c: Replace
+ BFD_RELOC_V850_{SDA/TDA/ZDA}_OFFSET relocs with new bit pattern
+ specific versions: BFD_RELOC_V850_{area}_{bits}_OFFSET.
+
+Thu Aug 28 17:01:09 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * cpu-v850.c: Remove "plain" from v850 printable name.
+ (scan): Use strcasecmp.
+
+ * archures.c (bfd_mach_v850): Define.
+
+ * cpu-sh.c (scan_mach): Compare with table instead of hardwired to
+ just sh/SH, use strcasecmp.
+ (arch_info_struct): Add entries for sh3 et.al.
+
+ * archures.c (bfd_mach_sh, ...): Define.
+
+Wed Aug 27 17:33:07 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * archures.c (bfd_archures_list): Always NULL terminate the list.
+
+Tue Aug 26 17:26:51 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Rebuild dependencies.
+ (ALL_MACHINES_CFILES): Add cpu-arc.c.
+ (ALL_MACHINES_CFILES): Add elf32-arc.c.
+ (elf32-arc.lo): Remove explicit dependency.
+ * Makefile.in: Rebuild.
+
+ * acinclude.m4 (BFD_CC_FOR_BUILD): Set EXEEXT_FOR_BUILD.
+ * doc/Makefile.am (MKDOC): Use EXEEXT_FOR_BUILD, not EXEEXT.
+ * aclocal.m4, configure, Makefile.in, doc/Makefile.in: Rebuild.
+
+Mon Aug 25 16:14:34 1997 Christopher Provenzano <proven@cygnus.com>
+
+ * configure: Rebuild with latest devo autoconf for NT support
+
+Mon Aug 25 16:11:04 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-arm.c (compatible): If B is a default type, return A.
+
+Mon Aug 25 15:35:46 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-v850.c (scan): New function.
+ (arch_info_struct): New structure.
+ (bfd_v850_arch): Add link into arch_info_structure.
+
+ * config.bfd (targ_cpu): All v850 variants use the bfd_arch_v850
+ architecture.
+
+ * elf32-v850.c (v850_elf_object_p): New function.
+
+
+Mon Aug 25 14:07:33 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * syms.c (_bfd_stab_section_find_nearest_line): Clear the
+ cached_stab field if the offset prevents us from using the cache.
+
+Mon Aug 25 12:08:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aout-target.h (MY(vec)): Add SEC_CODE and SEC_DATA to section
+ flags.
+ * aout-arm.c (aout_arm_little_vec): Likewise.
+ (aout_arm_big_vec): Likewise.
+ * bout.c (b_out_vec_big_host): Likewise.
+ (b_out_vec_little_host): Likewise.
+ * mipsbsd.c (aout_mips_little_vec): Likewise.
+ (aout_mips_big_vec): Likewise.
+
+Tue Aug 19 08:47:17 1997 Fred Fish <fnf@cygnus.com>
+
+ * coff-i960.c (COFF_ALIGN_IN_SECTION_HEADER): Define to 1.
+ (GET_SCNHDR_ALIGN, PUT_SCNHDR_ALIGN): Define.
+ * coff-m88k.c (GET_SCNHDR_NRELOC, GET_SCNHDR_NLNNO): Define.
+ * coffcode.h (coff_set_alignment_hook): Conditionally compile in if
+ COFF_ALIGN_IN_SECTION_HEADER is defined. Convert alignment to power
+ of two for I960 only.
+ * coffswap.h (GET_SCNHDR_NRELOC, PUT_SCNHDR_NRELOC, GET_SCNDHR_NLNNO,
+ PUT_SCNHDR_NLNNO, GET_SCNHDR_FLAGS, PUT_SCNHDR_FLAGS): Provide
+ default definitions.
+ (coff_swap_scnhdr_in): Use GET_SCNHDR_FLAGS, GET_SCNHDR_NRELOC,
+ GET_SCNHDR_NLNNO, and GET_SCNHDR_ALIGN.
+ (coff_swap_scnhdr_out): Use PUT_SCNHDR_FLAGS, PUT_SCNHDR_ALIGN.
+
+Mon Aug 18 11:36:19 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_howto_table, v850_elf_reloc_map,
+ v850_elf_check_relocs, v850_elf_reloc,
+ v850_elf_final_link_relocate): Add support for
+ BFD_RELOC_V850_16_PCREL relocation.
+
+ * reloc.c (COMMENT): Add suuport for BFD_RELOC_V850_16_PCREL
+ relocation.
+
+ * libbfd.h: Add support for BFD_RELOC_V850_16_PCREL relocation.
+
+ * bfd-in2.h: Add support for BFD_RELOC_V850_16_PCREL relocation.
+
+
+Fri Aug 15 12:01:28 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffgen.c (coff_find_nearest_line): Correctly handle the offset
+ argument as section relative, rather than an absolute address.
+ From Jan Hoogenraad <hoogenrd@natlab.research.philips.com>.
+
+Fri Aug 15 04:58:02 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config.bfd (arc-*-elf*): Add.
+ * configure.in (bfd_elf32_{little,big}arc_vec): Add.
+ * configure: Rebuild.
+ * Makefile.am (ALL_MACHINES): Add cpu-arc.lo.
+ (BFD32_BACKENDS): Add elf32-arc.lo.
+ (cpu-arc.lo,elf32-arc.lo): Add rules for.
+ * Makefile.in: Rebuild.
+ * archures.c (architecture list): Add bfd_arch_arc.
+ (bfd_archures_list): Add bfd_arc_arch.
+ (bfd_mach_arc_base): Define.
+ * reloc.c (BFD_RELOC_ARC_B22_PCREL,BFD_RELOC_ARC_B26): Add.
+ * targets.c (bfd_elf32_{little,big}arc_vec): Declare.
+ (bfd_target_vect): Add them.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * cpu-arc.c, elf32-arc.c: New files.
+ * elf.c (pre_headers): Recognize bfd_arch_arc.
+
+Tue Aug 12 11:45:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (NAME(aout,final_link)): If no symbols, make sure the
+ data section is correctly rounded to a page in the file.
+
+Mon Aug 11 12:45:43 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (NAME(aout,final_link)): Don't emit the string table if
+ there are no symbols.
+
+Sun Aug 10 14:45:56 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-stgo32.c: Rename from coff-stubgo32.c to avoid old System V
+ file system 14 character limit.
+ * Makefile.am, configure.in: Corresponding changes.
+ * Makefile.in, configure: Rebuild.
+
+Fri Aug 8 18:34:36 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: (ALL_MACHINES_CFILES): Add elf32-d10v.c.
+ Rebuild dependencies.
+ * Makefile.in: Rebuild.
+
+Wed Aug 6 18:56:51 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (docdir): Define.
+ * Makefile.in: Rebuild.
+
+Tue Aug 5 23:05:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Rebuild with autoconf 2.12.1.
+
+Mon Aug 4 12:00:35 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4, configure: Rebuild with new automake patches.
+
+Sun Aug 3 08:15:12 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-core.c (make_bfd_asection): New function to add a section
+ to the core file bfd.
+ (rs6000coff_core_p): Use make_bfd_asection to add the core file
+ sections.
+ Use BFD routines to seek, read and stat the core file.
+ Handle .data sections from loaded objects and anonymously mmapped
+ regions, these are available in AIX 4 core files.
+
+Fri Aug 1 12:58:32 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set enable_shared before AM_PROG_LIBTOOL.
+ * acinclude.m4: Move acmacros.m4 in here. Remove AM_PROG_LIBTOOL
+ copy; use a patches libtool instead.
+ * acmacros.m4: Remove.
+ * Makefile.in, aclocal.m4, configure: Rebuild.
+
+Thu Jul 31 19:55:36 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: New file, based on old Makefile.in.
+ * acmacros.m4: New file, copied from old aclocal.m4.
+ * acinclude.m4: New file.
+ * configure.in: Call AM_PROG_LIBTOOL. Remove shared library
+ handling; now handled by libtool. Replace AC_CONFIG_HEADER with
+ AM_CONFIG_HEADER. Replace AC_PROG_INSTALL with AM_PROG_INSTALL.
+ Call AM_MAINTAINER_MODE, AM_CYGWIN32, and AM_EXEEXT. Change all
+ .o files to .lo. Remove stamp-h handling in AC_OUTPUT.
+ * acconfig.h: Mention PACKAGE and VERSION.
+ * stamp-h.in: New file.
+ * dep-in.sed: Change .o to .lo.
+ * Makefile.in: Now built with automake.
+ * aclocal.m4: Now built with aclocal.
+ * config.in, configure: Rebuild.
+ * VERSION: Remove.
+
+Thu Jul 31 12:09:20 1997 Geoff Keating <geoffk@ozemail.com.au>
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Don't set TEXTREL
+ if there is only a relocation to a read-only but not allocatable
+ section (like .stab).
+ * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
+ * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
+ * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
+ * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise.
+ * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
+
+ * elf32-ppc.c (ppc_elf_howto_raw): Correct various comments.
+ (ppc_elf_create_linker_section): These sections are not
+ created by the linker (that is, they are created by the user
+ putting data in them). In particular, they can be the source
+ and target of relocations.
+ (ppc_elf_adjust_dynamic_symbol): Check postcondition of
+ bfd_elf32_link_record_dynamic_symbol. Align 16-byte common
+ objects (for instance, 'long double') to 16-byte boundaries.
+ (ppc_elf_size_dynamic_sections): Make the code that generates
+ section symbols exactly the same as for sparc, reducing the
+ number of section symbols output.
+ (ppc_elf_check_relocs): Check postcondition of
+ bfd_elf32_link_record_dynamic_symbol. Make default case the
+ same as corresponding code for sparc, fixing bug involving
+ .rela.stabs.
+ (ppc_elf_finish_dynamic_symbol): Fix case involving GOT symbols
+ forced to be local because of versioning (by replicating
+ corresponding change in sparc). Treat R_PPC_RELATIVE RELA relocs
+ as usual in ELF, not as pseudo-REL relocs (as the sparc linker
+ does).
+ (ppc_elf_relocate_section): Add handy debugging code for when
+ assertion fails. Add some more 'symbol made local because of
+ versioning' cases.
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Cope with addend when
+ processing a GOT relocation as required by ABI.
+
+Wed Jul 30 21:30:35 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elflink.h (NAME(bfd_elf,record_link_assignment)): Remove any
+ version info if this symbol came from a dynamic object.
+ (elf_link_add_object_symbols): Set the version info of a symbol
+ only if the object actually contains version definitions and
+ defines this symbol.
+
+Mon Jul 28 18:07:43 1997 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * aclocal.m4: Add CYGWIN and EXEEXT autoconf macros.
+ * configure.in: Use CYGWIN and EXEEXT autoconf macro to look for
+ win32 dependencies.
+ * configure: Regenerated with autoconf 2.12.
+ * doc/Makefile.in: Add $(EXEEXT) to chew executable.
+
+Mon Jul 28 02:50:29 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-core.c (rs6000coff_core_p): If CORE_TRUNC is set, print
+ a warning rather than returning an error.
+
+Sun Jul 27 19:54:14 1997 Felix Lee <flee@cygnus.com>
+
+ * coffswap.h (coff_swap_aux_in): add semicolon to make MSVC happy.
+
+Fri Jul 25 14:50:08 1997 Felix Lee <flee@cygnus.com>
+
+ * cisco-core.c: define signals for wingdb.
+
+Fri Jul 25 16:27:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecofflink.c (bfd_ecoff_debug_accumulate): Only merge files with
+ the same number of aux entries.
+
+Fri Jul 25 08:22:15 1997 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (hppa_som_gen_reloc_type): Use R_DATA_EXPR for the
+ difference of two symbols if the relocation size is 32 bits.
+ (som_write_fixups): Handle R_DATA_EXPR.
+
+Wed Jul 23 16:08:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (coff_i386_reloc): Don't offset a common symbol by
+ its value if COFF_WITH_PE is defined.
+
+Tue Jul 22 17:19:45 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * coff-stubgo32.c: New file.
+ * go32stub.h: New file.
+ * coff-i386.c: If COFF_GO32_EXE, include coff/go32exe.h.
+ * coffswap.h (coff_swap_filehdr_in): Invoke
+ COFF_ADJUST_FILEHDR_IN_PRE and COFF_ADJUST_FILEHDR_IN_POST if they
+ are defined.
+ (coff_swap_filehdr_out): Invoke COFF_ADJUST_FILEHDR_OUT_PRE and
+ COFF_ADJUST_FILEHDR_OUT_POST if they are defined.
+ (coff_swap_aux_in): Invoke COFF_ADJUST_AUX_IN_PRE and
+ COFF_ADJUST_AUX_IN_POST if they are defined.
+ (coff_swap_aux_out): Invoke COFF_ADJUST_AUX_OUT_PRE and
+ COFF_ADJUST_AUX_OUT_POST if they are defined.
+ (coff_swap_scnhdr_in): Invoke COFF_ADJUST_SCNHDR_IN_PRE and
+ COFF_ADJUST_SCNHDR_IN_POST if they are defined.
+ (coff_swap_scnhdr_out): Invoke COFF_ADJUST_SCNHDR_OUT_PRE and
+ COFF_ADJUST_SCNHDR_OUT_POST if they are defined.
+ * targets.c (go32stubbedcoff_vec): Declare.
+ (bfd_target_vector): Add go32stubbedcoff_vec.
+ * configure.in (go32coff_vec): New target vector.
+ (go32stubbedcoff_vec): Likewise.
+ * config.bfd (i[3456]86-*-msdosdjgpp*): New target.
+ (i[3456]86-*-go32*): Change to be like new msdosdjgpp*.
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add coff-stubgo32.o.
+ (BFD32_BACKENDS_CFILES): Add coff-stubgo32.c.
+ (HFILES): Add go32stub.h.
+
+Tue Jul 22 15:09:12 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Check for fdopen.
+ * configure, config.in: Rebuild.
+ * opncls.c (bfd_fdopenr): Check HAVE_FDOPEN rather than VMS or
+ __GO32__. Reindent a bit.
+
+Sun Jul 20 20:05:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (sunos_create_dynamic_sections): Set SEC_LINKER_CREATED
+ flag for newly created sections.
+ (sunos_add_dynamic_symbols): Don't discard newly created sections
+ if shared library is dynobj.
+
+Mon Jul 14 15:33:55 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (map_sections_to_segments): When checking whether
+ including a section in a segment would force us to skip a page,
+ align the address of the next segment to avoid wraparound
+ problems.
+
+Mon Jul 7 16:41:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (coff_i386_is_local_label_name): New static function
+ if TARGET_UNDERSCORE.
+ (coff_bfd_is_local_label_name): Define if TARGET_UNDERSCORE.
+ (i386coff_vec): Add SEC_CODE and SEC_DATA to section_flags.
+
+Mon Jun 30 14:29:26 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-m68k.c (howto_table): Use complain_overflow_bitfield, not
+ complain_overflow_signed, for 32 bit PC relative relocations.
+
+Thu Jun 26 01:26:31 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): When a version
+ indirection symbol is overridden, make the original symbol point
+ at the real overriding symbol.
+
+ * elf.c (bfd_elf_string_from_elf_section): Check for an invalid
+ string index.
+
+ * elflink.h (elf_link_output_extsym): Use the right section for a
+ common symbol.
+ * elf32-mips.c (mips_elf_link_output_symbol_hook): If a common
+ symbol was in .scommon, mark it as SHN_MIPS_SCOMMON.
+
+Wed Jun 25 12:43:10 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * elflink.h (elf_merge_symbols): Resolve indirect and warning
+ symbols before checking for new symbols.
+
+ * elfcore.h (elf_corefile_note): Move out of HAVE_SYS_PROCFS_H.
+
+Tue Jun 24 11:20:43 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffgen.c (coff_object_p): Read the f_opthdr bytes from the
+ file, not aoutsz bytes (they are different in XCOFF .o files).
+
+ * xcofflink.c (xcoff_link_add_symbols): Permit symbols to be
+ redefined by objects included from archives.
+
+Mon Jun 23 18:03:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_merge_symbol): In the case of a new defined
+ symbol overriding an old defined symbol, return the hash table
+ entry which we modify, even if it is the target of an
+ indirection.
+ (elf_link_add_object_symbols): If the real name of the symbol gets
+ overridden, convert the versioned symbol into an indirect symbol
+ to the real symbol.
+
+ * elflink.h (elf_merge_symbol): New static function, broken out of
+ elf_link_add_object_symbols.
+ (elf_link_add_object_symbols): Call it.
+
+Sun Jun 22 19:40:57 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (i3coff_object_p): If COFF_IMAGE_WITH_PE, hack to
+ handle case where COFF filehdr does not immediately follow PE
+ header.
+ * coffgen.c (coff_object_p): Remove useless seek to current
+ location.
+
+Wed Jun 18 19:03:38 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * linker.c (link_action): Change COMMON_ROW/indr to from CREF to
+ REFC.
+
+Tue Jun 17 11:55:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_link_input_bfd): If stripping debugging
+ symbols, skip N_ABS symbols with debugging storage classes.
+
+Mon Jun 16 18:56:27 1997 Geoff Keating <geoffk@ozemail.com.au>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Don't emit R_PPC_REL*
+ relocs in shared libraries which refer to local symbols. Cope
+ with addend when processing a GOT relocation.
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Only create symbols
+ for sections that the linker didn't create.
+ (ppc_elf_finish_dynamic_sections): Only try to write out a section
+ symbol if it was created in ppc_elf_size_dynamic_sections.
+ (ppc_elf_relocate_section): Complain if we have to generate a reloc
+ relative to a section for which we didn't output a symbol.
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Clean up. PLT
+ relocs are 'rela' relocs, like everything else. .rela.plt is not
+ a read-only section, so we don't have to special-case it.
+
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Entries in the
+ .rela.bss section are (of course) 'rela' relocs not 'rel' relocs.
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Initialise srelgot.
+ (ppc_elf_relocate_section): @got offsets are 4 from start of the
+ actual .got section.
+ * elflink.c (_bfd_elf_create_got_section): The three reserved
+ words start from the symbol '_GLOBAL_OFFSET_TABLE_'.
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): '.rela' is 5
+ characters, not 4.
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Use
+ _bfd_elf_create_got_section to create the GOT rather than
+ ppc_elf_create_linker_section. Create the '.rela.got' section
+ ourselves.
+ (ppc_elf_finish_dynamic_symbol): Set up GOT relocations when a
+ symbol has a GOT entry.
+ (ppc_elf_relocate_section): Record when a symbol is used through
+ the GOT, and allocate space in the GOT for each such symbol.
+ (ppc_elf_adjust_dynamic_symbol): Delete unused .got.plt stuff.
+ (ppc_elf_create_linker_section): Delete unused LINKER_SECTION_GOT
+ stuff.
+
+ * elf32-ppc.c (ppc_elf_howto_raw): GOT16_HA relocs should be
+ treated in a similar way to ADDR16_HA relocs.
+ (ppc_elf_relocate_section): PLTREL24 relocs do not get copied into
+ shared objects; the linker must deal with them.
+ (ppc_elf_create_linker_section): Stop setting
+ _GLOBAL_OFFSET_TABLE_ to the wrong value; delete unused
+ LINKER_SECTION_PLT stuff.
+ (ppc_elf_check_relocs): Delete unused LINKER_SECTION_PLT stuff.
+ (ppc_elf_finish_dynamic_sections): Use BFD calls to get GOT
+ section, not ELF-specific calls.
+ (elf_backend_plt_not_loaded): Set to 1.
+ (elf_backend_got_symbol_offset): Set to 4.
+ * elf-bfd.h (elf_backend_data): Add 'plt_not_loaded' member
+ for when ld.so fills in the PLT; and 'got_symbol_offset' member.
+ * elflink.c (_bfd_elf_create_dynamic_sections): Apply
+ plt_not_loaded member.
+ (_bfd_elf_create_got_section): Apply got_symbol_offset.
+ * elfxx-target.h (elf_backend_plt_not_loaded): Set default to
+ 'loaded'.
+ (elf_backend_G_O_T_offset): Set default to 0.
+ (elfNN_bed): Set added fields.
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Was setting
+ DT_RELENT in shared objects; should be DT_RELAENT.
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Propagate
+ R_PPC_ADDR16_HA relocs to shared objects. Cope with case where
+ such a reloc (in a non-shared object) refers to a symbol that's
+ not defined.
+
+Mon Jun 16 14:42:14 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * elfcode.h (put_signed_word): Define.
+ (get_signed_word): Define.
+ (elf_swap_reloca_in): Use get_signed_word for the r_addend field.
+ (elf_swap_reloca_out): Use put_signed_word for the r_addend
+ field.
+ * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Use
+ bfd_get_signed_32 to set the r_addend field.
+ * elf64-mips.c (mips_elf64_swap_reloca_in): Use
+ bfd_h_get_signed_64 to set the r_addend field.
+
+Mon Jun 16 12:31:29 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): When generating a
+ shared library, do the relocation if the input section is not
+ allocated in memory.
+
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Call
+ elf_link_assign_sym_version before elf_adjust_dynamic_symbol.
+ (elf_fix_symbol_flags): New static function, broken out of
+ elf_adjust_dynamic_symbol.
+ (elf_adjust_dynamic_symbol): Call elf_fix_symbol_flags.
+ (elf_link_assign_sym_version): Likewise. Permit a symbol to be
+ forced local even if NEEDS_PLT is set. When forcing a symbol to
+ be local, clear NEEDS_PLT.
+ (elf_link_output_extsym): Remove unused local bed.
+
+Wed Jun 11 22:44:20 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10300.c (elf32_mn10300_link_hash_entry): New structure
+ for derived elf linker hash table entries. References to
+ elf_link_hash_entry changed appropriately.
+ (elf32_mn10300_link_hash_table): New structure for derived elf
+ linker hash table.
+ (elf32_mn10300_hash_table): Define.
+ (elf32_mn10300_link_hash_traverse): Likewise.
+ (elf32_mn10300_link_hash_newfunc): New function.
+ (elf32_mn10300_link_hash_table_create): Likewise.
+ (elf32_mn10300_finish_hash_table_entry): Likewise.
+ (mn10300_elf_relax_section): Handle "call" -> "calls", removal
+ of prologue code, and call:32->call:16 relaxing.
+ (compute_function_info: New function.
+ (bfd_elf32_bfd_ilink_hash_table_create): Define.
+
+Wed Jun 11 00:00:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_output_extsym): Call finish_dynamic_symbol
+ for a symbol which is being forced to be local.
+ * elf32-i386.c (elf_i386_relocate_section): Write out the
+ relocation value for a GOT reloc for a symbol which is turning
+ into a local symbol.
+ (elf_i386_finish_dynamic_symbol): If a symbol is turning into a
+ local symbol, write out a RELATIVE reloc rather than a GLOB_DAT
+ reloc.
+ * elf32-m68k.c, elf32-sparc.c: Corresponding changes.
+
+ * elf32-i386.c (elf_i386_relocate_section): Get the relocation
+ value if the symbol is turning into a local symbol.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+
+1997-06-10 22:58 Ulrich Drepper <drepper@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Also read verneed
+ information by calling `_bfd_elf_slurp_version_tables'.
+ (elf_link_add_object_symbols): For undefined symbols look for
+ version information in the verneed records.
+ (elf_link_add_object_symbols): Use soname of shared object
+ for verneed record if it is available.
+
+Tue Jun 10 11:13:03 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * cpu-arm.c: Add prototypes for compatible and scan.
+ * cofflink.c: Add prototype for mark_relocs.
+
+ * archive.c (bfd_special_undocumented_glue): Change filename to
+ const pointer. Add prototype.
+
+Mon Jun 9 12:34:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elflink.h (elf_link_add_object_symbols): Ignore relocations of
+ sections that will be discarded.
+
+1997-06-06 22:58 Ulrich Drepper <drepper@cygnus.com>
+
+ * elflink.h (elf_link_find_version_dependencies): When searching
+ for known version symbol skip non-matching verdef records, not
+ matching records.
+
+Thu Jun 5 15:52:45 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section): Write a long,
+ not a bfd_vma, to the base file, to match how dlltool reads it.
+
+Tue Jun 3 16:57:45 1997 Nick Clifton <nickc@cygnus.com>
+
+ * reloc.c: Add thumb relocations.
+
+ * bfd-in2.h: Add Thumb relocations.
+
+ * libbfd.h: Add Thumb relocations.
+
+Mon Jun 2 10:41:52 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * cpu-m68k.c (arch_info_struct): Fix 68060 cpu name.
+
+Fri May 30 12:46:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Set dynindx
+ for a section even if it is not loaded.
+
+ * cofflink.c (coff_link_add_symbols): If PE file, don't subtract
+ section VMA.
+ (_bfd_coff_link_input_bfd): Separate section VMA handling for
+ input and output files.
+ (_bfd_coff_generic_relocate_section): Check whether input file,
+ not output file, is a PE file.
+
+Wed May 28 15:48:43 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c: (coff_arm_bfd_set_private_flags): Make static.
+
+Wed May 28 16:16:04 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (coff_i386_reloc): Don't just exit if we see an
+ R_IMAGEBASE reloc.
+
+Wed May 28 09:48:43 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-arm.c (compatible): Add test for supersets of ARM
+ architectures.
+
+Tue May 27 19:42:03 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * cofflink.c (_bfd_coff_final_link): Initialize global_to_static
+ member.
+
+Tue May 27 14:34:08 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_bfd_set_private_flags): Make global. It is
+ called directly by gas/config/tc-arm.c.
+
+Tue May 27 15:58:53 1997 Richard Henderson <rth@tamu.edu>
+
+ * elf64-alpha.c (PLT_ENTRY_*): Use a new thread-safe format.
+ (elf64_alpha_finish_dynamic_symbol): Fill it in properly.
+
+Mon May 26 14:05:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-ppc.c (coff_ppc_relocate_section): If PE file, don't add
+ section VMA.
+
+Mon May 26 10:57:48 1997 Fred Fish <fnf@cygnus.com>
+
+ * peicode.h (coff_bfd_print_private_bfd_data): #undef before #define.
+ (coff_bfd_copy_private_bfd_data): Ditto.
+ * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): Make static.
+ (coff_arm_bfd_print_private_bfd_data): Ditto.
+ (coff_arm_bfd_set_private_flags): Ditto.
+ (coff_arm_bfd_copy_private_bfd_data): Ditto.
+
+Fri May 23 15:14:58 1997 Fred Fish <fnf@cygnus.com>
+
+ * libcoff-in.h (struct coff_final_link_info): Add boolean
+ global_to_static member for support of task linking.
+ (_bfd_coff_write_task_globals): Add prototype.
+ * libcoff.h: Regenerate.
+ * coffcode.h (coff_write_object_contents): Use #ifdef to
+ check RS6000COFF_C, to be consistent with all other uses
+ in this file.
+ * cofflink.c (_bfd_coff_final_link): If doing task linking,
+ call _bfd_coff_write_task_globals.
+ (_bfd_coff_link_input_bfd): If doing task linking, convert
+ global functions to static.
+ (_bfd_coff_write_global_sym): If doing task linking, convert
+ global variables to static.
+ (_bfd_coff_write_task_globals): New function.
+
+Wed May 21 17:15:50 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_slurp_symbol_table): If COFF_WITH_PE or
+ COFF_IMAGE_WITH_PE, don't subtract the section VMA from the symbol
+ value.
+ * coffgen.c (fixup_symbol_value): Add abfd parameter. Change all
+ callers. If PE file, don't add section VMA.
+ (coff_write_alien_symbol): If PE file, don't add section VMA.
+ * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
+ (_bfd_coff_write_global_sym): Likewise.
+ (_bfd_coff_generic_relocate_section): Likewise.
+
+ * peicode.h: Add & 0xffffffff when using ImageBase in case bfd_vma
+ is 64 bits.
+
+Wed May 21 09:58:10 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cofflink.c (mark_relocs): Add new function to mark symbols which
+ are used by relocations.
+ (_bfd_coff_link_input_bfd): Add call to mark_relocs() and code to
+ suppress the skipping of symbols that have thus been marked.
+
+Tue May 20 18:45:26 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (sh_merge_private_data): New static function.
+ (coff_bfd_merge_private_bfd_data): Define.
+
+Fri May 16 10:23:03 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-m10300.c (elf32_mn10300_relax_section): Read in all
+ the symbols associated with each BFD.
+ (mn10300_elf_relax_delete_bytes): Don't adjust the same symbol
+ more than once.
+ * elf-m10200.c: Likewise.
+ * elf32-m32r.c: Likewise.
+ * elf32-sh.c: Likewise.
+
Fri May 16 12:10:52 1997 Ian Lance Taylor <ian@cygnus.com>
* elflink.h (elf_link_add_object_symbols): Don't decrease the
- alignment of a common symbol. If two symbols that look like
- common symbols are found in two shared libraries, and the size is
- different, use the larger size, and warn if --warn-common. If a
+ alignment of a common symbol. If two symbols that look like
+ common symbols are found in two shared libraries, and the size is
+ different, use the larger size, and warn if --warn-common. If a
common symbol overrides a definition in a shared library, set the
size to the larger size, and warn if --warn-common.
+Thu May 15 14:31:28 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-arm.c (compatible): Allow default machine to be polymorphed
+ into any other machine type.
+
+ * coffcode.h (coff_set_flags): Initialise flags variable to 0.
+
+ * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): When merging
+ data into an unitialised destination set its machine type as well.
+
Thu May 15 16:40:20 1997 Ian Lance Taylor <ian@cygnus.com>
* elflink.h (elf_link_add_object_symbols): Force ELF symbol size
to common symbol size. Consistently treat uninitialized symbols
in shared objects as common symbols.
-Tue May 13 10:42:41 1997 Ian Lance Taylor <ian@cygnus.com>
+Fri May 9 10:15:27 1997 Nick Clifton <nickc@cygnus.com>
+
+ * archures.c (constants): Added new constants to identify the
+ type of the ARM architecture: bfd_mach_arm_2, bfd_mach_arm_2a,
+ bfd_mach_arm_3, bfd_mach_arm_3M, bfd_mach_arm_4 and bfd_mach_arm_4T.
+
+ * bfd-in2.h (constants): Added new constants to identify
+ the type of the ARM architecture: bfd_mach_arm_2, bfd_mach_arm_2a,
+ bfd_mach_arm_3, bfd_mach_arm_3M, bfd_mach_arm_4 and
+ bfd_mach_arm_4T. This file is auto-magically generated from the
+ archures.c file. This update is just to save work.
+
+ * coff-arm.c (coff_arm_bfd_merge_private_bfd_data,
+ coff_arm_bfd_print_private_bfd_data,
+ coff_arm_bfd_set_private_flags,
+ coff_arm_bfd_copy_private_bfd_data): Added these new functions.
+ (global): Macro redefinitions set up to use these new functions.
+
+ * coffcode.h (coff_mkobject_hook): Added call to
+ coff_arm_bfd_set_private_flags().
+ (coff_set_arch_mach_hook): Added code to set machine type based on
+ bits stored in internal flags.
+ (coff_set_flags): Added code to set the new bits in the flags
+ field based on the machine number.
+ (function definition macros): Made all function definition macros
+ conditional so that they can be overridden by target specific
+ files.
- * VERSION: Set to 2.8.1.
+ * cpu-arm.c (compatible): Added this function. (arch_info_struct):
+ Structure extended to include new types, one each for ARMv2,
+ ARMv2a, ARMv3, ARMv3M, ARMv4 and ARMv4T.
+
+ * libcoff-in.h (struct coff_tdata): Added flags field.
Fri May 9 17:40:02 1997 Ian Lance Taylor <ian@cygnus.com>
+ * config.bfd (i[3456]86-*-gnu*): Don't include Mach support.
+
* config.bfd: Change #if 0 around uses of host_aout_vec to #if
HAVE_host_aout_vec.
+Mon May 5 13:57:32 1997 Mike Meissner <meissner@cygnus.com>
+
+ * coffgen.c (coff_find_nearest_line): If there are no syments,
+ just return false.
+
Mon May 5 18:18:45 1997 Philip Blundell <pjb27@cam.ac.uk>
* config.bfd: cope with '*-*-linux-gnuaout' targets.
@@ -61,9 +2158,13 @@ Sat Apr 19 22:50:14 1997 Ian Lance Taylor <ian@cygnus.com>
* elf32-i386.c (elf_i386_check_relocs): Only count PC relative
relocs. From Jamie Lokier <jamie@rebellion.co.uk>.
+ * coffcode.h (coff_compute_section_file_positions): Force the
+ potential last byte in the file to be written out when
+ COFF_IMAGE_WITH_PE.
+
Thu Apr 17 13:46:56 1997 Per Fogelstrom <pefo@openbsd.org>
- * configure.host (mips*-*-openbsd*): New target.
+ * configure.host (mips*-*-openbsd*): New host.
Thu Apr 17 11:10:54 1997 Ian Lance Taylor <ian@cygnus.com>
@@ -110,6 +2211,10 @@ Tue Apr 15 11:50:37 1997 Ian Lance Taylor <ian@cygnus.com>
whenever entry is larger than text address, but only by whole
pages. From Gordon W. Ross <gwr@mc.com>.
+ * Makefile.in (install): Depend upon installdirs. Use
+ mkinstalldirs to build $(oldincludedir).
+ (installdirs): New target.
+
* elflink.h (elf_link_add_object_symbols): Don't call check_relocs
if this is a debugging section which we are stripping.
@@ -150,6 +2255,9 @@ Fri Apr 11 15:43:24 1997 Ian Lance Taylor <ian@cygnus.com>
(MY_entry_is_text_address): Define.
* m68knetbsd.c (SEGMENT_SIZE): Define as 0x20000.
+ * xcofflink.c (bfd_xcoff_import_symbol): Handle importing a symbol
+ whose name starts with `.'.
+
Fri Apr 11 11:57:15 1997 Niklas Hallqvist <niklas@appli.se>
* config.bfd: (i[3456]86-*-openbsd*, m68*-*-openbsd*,
@@ -168,6 +2276,21 @@ Tue Apr 8 18:09:29 1997 Jamie Lokier <jamie@rebellion.co.uk>
(_bfd_stab_section_offset): Use `cumulative_skips' to
speed up offset calculation.
+Tue Apr 8 00:01:31 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-mn10300.c (mn10300_elf_relax_section): Don't forget the
+ addend for non pc-relative relocations.
+
+ * elf-m10300.c (bfd_elf32_mn10300_reloc): Remove prototype
+ for non-existent function.
+
+ * elf-m10300.c (mn10300_elf_relax_section): New function.
+ (mn10300_elf_relax_delete_bytes): Likewise.
+ (mn10300_elf_symbol_address_p): Likewise.
+ (mn10300_elf_get_relocated_section_contents): Likewise.
+ (bfd_elf32_bfd_relax_section): Define.
+ (bfd_elf32_bfd_get_relocated_section_contents): Likewise.
+
Mon Apr 7 16:47:09 1997 Ian Lance Taylor <ian@cygnus.com>
* configure.host: Set SHLIB_LIBS.
@@ -176,6 +2299,11 @@ Mon Apr 7 16:47:09 1997 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (SHLIB_LIBS): New variable.
($(SHLIB)): Use $(SHLIB_LIBS).
+Mon Apr 7 10:53:52 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * bfd-in.h bfd-in2.h: add bfd_section_lma macro to correspond
+ with bfd_section_vma.
+
Fri Apr 4 11:37:15 1997 Ian Lance Taylor <ian@cygnus.com>
* configure.in: Update file names for bfd_elf32_mn10[23]00_vec.
@@ -185,12 +2313,29 @@ Fri Apr 4 11:37:15 1997 Ian Lance Taylor <ian@cygnus.com>
* bfd.c (bfd_record_phdr): Cast count to size_t before
subtraction.
+ * coff-ppc.c (dump_toc): Add cast to avoid warning from SunOS cc.
+ * coff-rs6000.c (xcoff_read_ar_hdr): Likewise.
+ (xcoff_write_archive_contents): LIkewise.
+ * elf32-mips.c (_bfd_mips_elf_set_section_contents): Likewise.
+ (mips_elf_create_procedure_table): Likewise.
+ * peicode.h (pe_print_idata): Likewise.
+ (pe_print_edata, pe_print_pdata, pe_print_reloc): Likewise.
+ * xcofflink.c (xcoff_get_section_contents): Likewise.
+ (_bfd_xcoff_canonicalize_dynamic_symtab): Likewise.
+ (xcoff_link_add_symbols): Likewise.
+ (xcoff_link_add_symbols): Likewise.
+
* ppcboot.c (ppcboot_set_arch_mach): Make static.
(ppcboot_bfd_print_private_bfd_data): Likewise.
+ * elf32-mips.c (elf_mips_ctor64_howto): Set complain_on_overflow
+ to complain_overflow_signed.
+
Thu Apr 3 11:51:54 1997 Ian Lance Taylor <ian@cygnus.com>
- * VERSION: Set to 2.8.
+ * VERSION: Set to 2.8.1.
+
+ * Branched binutils 2.8.
* elf32-ppc.c (ppc_elf_check_relocs): Don't check SEC_ALLOC when
deciding whether to copy a reloc into a shared object.
@@ -629,7 +2774,7 @@ Thu Mar 6 12:19:59 1997 Fred Fish <fnf@cygnus.com>
* coff-h8500.c: Ditto.
* coff-w65.c: Ditto
* coff-z8k.c: Ditto.
-
+
Wed Mar 5 13:59:09 1997 Doug Evans <dje@seba.cygnus.com>
* elf32-m32r.c (m32r_elf_do_10_pcrel_reloc): Fix overflow calc.
@@ -697,7 +2842,7 @@ Thu Feb 27 18:36:23 1997 Ian Lance Taylor <ian@cygnus.com>
* coffgen.c (_bfd_coff_is_local_label_name): New function.
* libcoff-in.h (_bfd_coff_is_local_label_name): Declare.
* libcoff.h: Rebuild.
-
+
* targets.c (BFD_JUMP_TABLE_SYMBOLS): Change _bfd_is_local_label
to _bfd_is_local_label_name.
(bfd_target): Likewise.
@@ -847,11 +2992,16 @@ Tue Feb 18 15:31:48 1997 Fred Fish <fnf@cygnus.com>
* reloc.c (struct reloc_howto_struct): Fix typo in comment.
* bfd-in2.h: Regenerated.
-
+
Tue Feb 18 11:41:00 1996 Dawn Perchik <dawn@cygnus.com>
* sysdep.h: Don't define errno in MSVC if error.h is included.
+Tue Feb 18 10:04:13 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (v850_elf_relocate_section): Make sure r_symndx
+ is initialized before it is used.
+
Mon Feb 17 11:28:40 1997 Ian Lance Taylor <ian@cygnus.com>
* hp300hpux.c (convert_sym_type): Don't convert a secondary common
@@ -915,7 +3065,7 @@ Tue Feb 11 15:27:32 1997 Ian Lance Taylor <ian@cygnus.com>
* reloc.c (BFD_RELOC_MIPS16_GPREL): Define.
* bfd-in2.h, libbfd.h: Rebuild.
-Mon Feb 10 23:25:00 1997 Doug Evans <dje@seba.ricochet.net>
+Mon Feb 10 23:25:00 1997 Doug Evans <dje@seba.cygnus.com>
* elf32-m32r.c (elf_m32r_howto_table): Change partial_inplace to true
for R_M32R_{16,32,24,HI16_ULO,HI16_SLO,LO16}.
@@ -988,6 +3138,8 @@ Mon Jan 27 12:25:02 1997 Ian Lance Taylor <ian@cygnus.com>
* aout-arm.c (MY_swap_std_reloc_in): Remove unused r_length.
* elf32-ppc.c (ppc_elf_check_relocs): Remove unused plt.
+ * elf32-v850.c (v850_elf_final_link_relocate): Remove used
+ r_format and r_pcrel. Always return a value.
* riscix.c (MY_final_link_callback): Define to dummy value.
* elf32-i386.c (elf_i386_size_dynamic_sections): When checking for
@@ -1020,6 +3172,16 @@ Tue Jan 14 08:46:33 1997 Doug Evans <dje@canuck.cygnus.com>
* libaout.h (machine_type): Reserve several values for sparclet.
+Mon Jan 13 19:36:25 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-v850.c (v850_elf_howto_table): Set the special_function
+ table to v850_elf_reloc for all non-standard relocations.
+ (v850_elf_check_relocs): Add check for h being non-null.
+ (v850_elf_reloc): Add R_V850_ZDA_OFFSET support. Use switch
+ statement instead of multiple ifs.
+ (v850_elf_relocate_section): Fix up error message, don't just call
+ abort.
+
Mon Jan 6 13:28:35 1997 Jeffrey A Law (law@cygnus.com)
* elf32-mn10200.c (elf_mn10200_howto): Don't ever set partial-inplace.
@@ -1044,7 +3206,7 @@ Fri Jan 3 16:58:31 1997 Richard Henderson <rth@tamu.edu>
(bfd_elf*_mkobject): Don't define here ...
* elfxx-target.h: ... but rather here. Default always_size_sections
hook to NULL.
- * elf.c (elf_mkobject): Rename to bfd_elf_mkobject, since that was
+ * elf.c (elf_mkobject): Rename to bfd_elf_mkobject, since that was
what the #defines in elf-bfd.h transmuted it to anyway.
* section.c: Add SEC_LINKER_CREATED flag.
@@ -1062,7 +3224,7 @@ Fri Jan 3 16:58:31 1997 Richard Henderson <rth@tamu.edu>
ppc_elf_size_dynamic_sections): Likewise.
* elf32-sparc.c (elf32_sparc_check_relocs,
elf32_sparc_size_dynamic_sections): Likewise.
- * elflink.c (_bfd_elf_create_got_section): Add SEC_LINKER_CREATED to
+ * elflink.c (_bfd_elf_create_got_section): Add SEC_LINKER_CREATED to
section flags.
(_bfd_elf_create_dynamic_sections): Likewise.
(_bfd_elf_make_linker_section_rela): Likewise.
@@ -1074,6 +3236,21 @@ Fri Jan 3 16:58:31 1997 Richard Henderson <rth@tamu.edu>
* elf64-alpha.c: Rewrite everything touching relocations.
+Fri Jan 3 11:42:53 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-v850.c (all functions and static variables): Go through
+ and regularize names to be of the form v850_elf_<xxx>.
+ (toplevel): Include <elf/v850.h>.
+ (enum reloc_type): Move to include/elf/v850.h.
+ (v850_elf_check_relocs): For common variables, if the variable is
+ referenced by a R_V850_{SDA,ZDA,TDA} relocation, put the variable
+ into the appropriate section.
+ (elf_backend_check_relocs): Define.
+
+Tue Dec 31 15:15:28 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-v850.c (elf_v850_howto_table): Fix some spacing.
+
Tue Dec 31 14:44:50 1996 Ian Lance Taylor <ian@cygnus.com>
* config.bfd (mips*el-*-linux*): New target.
@@ -1201,7 +3378,7 @@ Tue Dec 10 23:23:52 1996 Jeffrey A Law (law@cygnus.com)
* bfd-in2.h, libbfd.h: Rebuilt.
* elf32-mn10200.c: Update from elf32-mn10300.c.
-
+
Fri Dec 6 15:18:05 1996 Jeffrey A Law (law@cygnus.com)
* elf32-mn10300.c (elf_symbol_leading_char): Define.
@@ -1307,7 +3484,7 @@ Mon Nov 25 08:52:29 1996 Jeffrey A Law (law@cygnus.com)
(elf32_mn10300_reloc_map): Update for new reloc types.
* reloc.c: Add some new relocs for the mn10300 series.
* bfd-in2.h, libbfd.h: Rebuilt.
-
+
Sat Nov 23 13:26:18 1996 Jeffrey A Law (law@cygnus.com)
* som.c (setup_sections): Don't lose for a space which has
@@ -1331,7 +3508,7 @@ Fri Nov 22 11:32:13 1996 Ian Lance Taylor <ian@cygnus.com>
dynamic linking information if needed.
Thu Nov 21 10:31:31 1996 Rob Savoye (rob@cygnus.com)
-
+
* config.bfd: Added VersaDOS format to the Ericsson configuration.
Wed Nov 20 16:31:31 1996 Jeffrey A Law (law@cygnus.com)
@@ -1379,10 +3556,26 @@ Fri Oct 25 16:56:40 1996 Ian Lance Taylor <ian@cygnus.com>
* ieee.c (ieee_write_external_part): Correctly record whether
there is an external part.
+Thu Oct 24 14:32:52 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (elf32_v850_bfd_final_link_relocate): Correctly
+ handle tda offsets for sld.w and sst.w instructions.
+ Fix alignment check in sld.w and sst.w tda reloc handling.
+
Thu Oct 24 09:08:47 1996 Stu Grossman (grossman@critters.cygnus.com)
* aclocal.m4, configure: Set USE_BINARY_FOPEN for *-*-windows.
+Wed Oct 23 00:53:16 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c: Add comments about assumptions about
+ char, short & long sizes.
+ (elf32_v850_bfd_final_link_relocate): Fix sign extension
+ problems for several relocs.
+
+ * elf32-v850.c (elf32_v850_howto_table): Fix typo in
+ R_V850_SDA_OFFSET entry.
+
Wed Oct 23 00:20:34 1996 Ian Lance Taylor <ian@cygnus.com>
* xcofflink.c (bfd_xcoff_import_symbol): Don't allocate ldsym.
@@ -1390,6 +3583,22 @@ Wed Oct 23 00:20:34 1996 Ian Lance Taylor <ian@cygnus.com>
(xcoff_build_ldsyms): Assume that ldsym was not previously
allocated. For an imported symbol, copy ldindx into l_ifile.
+Tue Oct 22 19:20:38 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (elf_v850_howto_table): Fix ordering of
+ R_V850_ZDA_OFFSET and R_V850_TDA_OFFSET. Fix various
+ fields in R_V850_TDA_OFFSET.
+ (elf32_v850_bfd_final_link_relocate): Tweak pc-relative
+ relocs to work more like other relocs. Handle R_V850_TDA_OFFSET
+ relocations.
+
+ * elf32-v850.c: Include bfdlink.h.
+ (bfd_elf32_v850_reloc): Return an error if we get a reloc
+ we can't handle.
+ (elf32_v850_bfd_final_link_relocate): New function.
+ (v850_elf_relocation_section): Likewise.
+ (elf_backend_relocate_section): Define.
+
Tue Oct 22 17:22:43 1996 Ian Lance Taylor <ian@cygnus.com>
* binary.c (binary_set_section_contents): Ignore sections which
@@ -1426,6 +3635,24 @@ Wed Oct 16 11:24:35 1996 Jeffrey A Law (law@cygnus.com)
all sections that will be included in the output file.
(_bfd_generic_link_output_symbols): Discard symbols in sections
which are being discarded.
+ * elf32-v850.c (enum reloc_type): Add R_V850_SDA_OFFSET,
+ R_V850_TDA_OFFSET and R_V850_ZDA_OFFSET.
+ (elf_v850_howto_table): Corresponding changes.
+ (elf_v850_reloc_map): Corresponding changes.
+ * reloc.c: Add additional V850 relocations.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+
+ * elf32-v850.c (bfd_elf32_v850_reloc): Mask out bits we
+ no longer want in pc-relative relocs.
+
+Tue Oct 15 22:17:37 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (bfd_elf32_v850_reloc): Don't silently
+ accept a reloc against an undefined sybmol!
+
+Tue Oct 15 16:17:28 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * elf32-v850.c: Define elf_symbol_leading_char to be '_'.
Tue Oct 15 12:40:41 1996 Ian Lance Taylor <ian@cygnus.com>
@@ -1441,7 +3668,7 @@ Mon Oct 14 12:37:26 1996 Ian Lance Taylor <ian@cygnus.com>
Mon Oct 14 11:17:24 1996 Richard Henderson <rth@tamu.edu>
- * reloc.c: Create a new BFD_RELOC_ALPHA_ELF_LITERAL. It was a
+ * reloc.c: Create a new BFD_RELOC_ALPHA_ELF_LITERAL. It was a
mistake to have reused the ECOFF LITERAL for ELF since they have
different semantics.
* elf64-alpha.c (elf_reloc_map): Map from ELF_LITERAL.
@@ -1582,7 +3809,7 @@ Wed Oct 2 21:40:55 1996 Jeffrey A Law (law@cygnus.com)
* targets.c (bfd_elf32_mn10x00_vec): Declare.
(bfd_target_vector): Add bfd_elf32_mn10x00_vec.
* bfd-in2.h, configure: Rebuilt.
-
+
Wed Oct 2 15:46:45 1996 Klaus Kaempf <kkaempf@progis.de>
openVMS/Alpha: Provide filename and case_hack flags via
@@ -1632,6 +3859,11 @@ Tue Oct 1 12:31:39 1996 Ian Lance Taylor <ian@cygnus.com>
a dynamic object in the dynamic symbol table if it is referenced
or defined by a regular object.
+Fri Sep 27 18:41:07 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * elf32-v850.c (bfd_elf32_v850_is_local_label): New function to
+ remove dwarf local labels. Shrinks binaries by a factor of 3!
+
Mon Sep 23 13:33:00 1996 Ian Lance Taylor <ian@cygnus.com>
* elf32-ppc.c (ppc_elf_add_symbol_hook): Create the .sbss section
@@ -1813,7 +4045,7 @@ Tue Sep 10 16:18:30 1996 Fred Fish <fnf@cygnus.com>
(build_debug_section): Ditto.
(copy_name): Ditto.
* syms.c (coff_section_type): Ditto.
-
+
Mon Sep 9 22:36:01 1996 Jeffrey A Law (law@cygnus.com)
* bfd-in2.h: Rebuilt after m32r changes.
@@ -1824,6 +4056,12 @@ Mon Sep 9 12:31:22 1996 Doug Evans <dje@canuck.cygnus.com>
* Makefile.in,archures.c,elf.c,targets.c: Likewise.
* config.bfd: Keep target list alphabetically sorted.
+Mon Sep 9 11:48:41 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (bfd_elf32_v850_reloc, case R_V850_HI16): Don't forget
+ to add in the constant part found in the instruction itself.
+ (case R_V850_HI16_S): Likewise.
+
Fri Sep 6 17:04:39 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* elf32-d10v.c (elf_d10v_howto_table): Modify the size of R_D10V_16
@@ -1846,6 +4084,17 @@ Tue Sep 3 12:16:20 1996 Doug Evans <dje@canuck.cygnus.com>
(bfd_target_vector): Add sparcle_aout_vec.
* aout-sparcle.c: New file.
+Tue Sep 3 00:57:02 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (bfd_elf32_v850_reloc): Fix handling of
+ low order sign bit propogation for R_V850_HI16_S.
+
+ * elf32-v850.c (bfd_elf32_v850_reloc): New function for
+ handling V850 specific relocs.
+ (elf_v850_howto_table): Use the new function for some
+ relocations. Twiddle masks & shifts for some relocs.
+ Set partial_inplace where needed.
+
Mon Sep 2 12:12:34 1996 Ian Lance Taylor <ian@cygnus.com>
* cpu-mips.c: Add an explicit mips:3000 entry, and change the
@@ -1855,12 +4104,36 @@ Mon Sep 2 12:12:34 1996 Ian Lance Taylor <ian@cygnus.com>
(_bfd_mips_elf_merge_private_bfd_data): If the machine number of
the output BFD is the default, set it from the first input BFD.
+Sun Sep 1 18:38:01 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (elf_v850_howto_table): All the 16bit relocs
+ insert at bitpos zero. The HI16 relocs are shifted right
+ by 16 bits. Fix src_mask for all relocs.
+ (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define. The V850 is
+ little endian!
+ (TARGET_BIG_SYM, TARGET_BIG_NAME): Remove. The V850 is little
+ endian!
+
Sun Sep 1 15:41:08 1996 Ian Lance Taylor <ian@cygnus.com>
* rs6000-core.c (rs6000coff_core_file_matches_executable_p):
Rewrite to use BFD file read routines and to avoid using a fixed
length for the file name.
+Sat Aug 31 10:22:25 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (enum reloc_type): Add R_V850_{32,16,8}.
+ (elf_v850_howto_table): Add support for R_V850_{32,16,8}.
+ (v850_reloc_map): Add translation from BFD_RELOC_{32,16,8}
+ to R_V850_{32,16,8}.
+
+Fri Aug 30 18:06:04 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * elf32-v850.c (reloc_type): Add R_V850_HI16_S.
+ (elf_v850_howto_table): Add info for HI16_S reloc.
+ (v850_reloc_map): Add HI_16_S reloc.
+ * reloc.c: Define BFD_RELOC_V850_* relocs.
+
Fri Aug 30 11:49:19 1996 Ian Lance Taylor <ian@cygnus.com>
Add SH ELF support.
@@ -1949,6 +4222,20 @@ Thu Aug 22 10:54:38 1996 Ian Lance Taylor <ian@cygnus.com>
undefined symbol merely because we are generating a shared
library.
+Tue Aug 20 15:06:05 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * Makefile.in (ALL_MACHINES): Add cpu-v850.o.
+ (BFD32_BACKENDS) Add elf32-v850.o.
+ * archures.c: Add bfd_v850_arch.
+ * bfd-in2.h: Add bfd_v850_arch.
+ * config.bfd (v850-*-*): New target.
+ * configure: (bfd_elf32_v850_vec) New vector.
+ * configure.in: (bfd_elf32_v850_vec) New vector.
+ * cpu-v850.c: New file.
+ * elf.c (prep_headers): Added case bfd_arch_v850.
+ * elf32-v850.c: New file.
+ * targets.c (bfd_elf32_v850_vec): New vector.
+
Fri Aug 16 16:25:35 1996 Ian Lance Taylor <ian@cygnus.com>
* xcofflink.c (xcoff_link_add_dynamic_symbols): Create and define
@@ -2274,7 +4561,7 @@ Wed Jul 17 14:51:52 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* reloc.c (BFD_RELOC_D10V_10_PCREL_R, BFD_RELOC_D10V_10_PCREL_L,
BFD_RELOC_D10V_18, BFD_RELOC_D10V_18_PCREL): Define.
* targets.c (bfd_elf32_d10v_vec): New vector.
-
+
Wed Jul 17 10:58:55 1996 Kim Knuttila <krk@cygnus.com>
* coff-ppc.c (coff_ppc_relocate_section): Removed bogus fprintf
@@ -2458,16 +4745,16 @@ Tue Jun 25 11:41:24 1996 Richard Henderson <rth@tamu.edu>
.rela.plt offset directly rather than calculating it.
Mon Jun 24 17:15:10 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * Makefile.in, (bindir, libdir, datadir, mandir, infodir, includedir):
+
+ * Makefile.in, (bindir, libdir, datadir, mandir, infodir, includedir):
Use autoconf-set values.
- * doc/Makefile.in (bindir, libdir, datadir, mandir, infodir,
- includedir, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set
+ * doc/Makefile.in (bindir, libdir, datadir, mandir, infodir,
+ includedir, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set
values.
(docdir): Deleted.
* configure.in (AC_PREREQ): autoconf v2.5 or higher.
* configure: Rebuilt.
-
+
Mon Jun 24 22:50:35 1996 Jeffrey A Law (law@cygnus.com)
* som.c (som_write_fixups): Fix typo in R_END_TRY for exception
@@ -2496,7 +4783,7 @@ Sun Jun 23 20:42:51 1996 Doug Evans <dje@canuck.cygnus.com>
Fri Jun 21 17:38:15 1996 Joel Sherrill <joel@merlin.gcs.redstone.army.mil>
* config.bfd: Add support for *-*-rtems* configurations.
-
+
Fri Jun 21 15:19:59 1996 Ian Lance Taylor <ian@cygnus.com>
* elf.c (prep_headers): Add bfd_arch_alpha case.
@@ -2550,7 +4837,7 @@ Tue Jun 18 15:17:36 1996 Jeffrey A. Law <law@rtl.cygnus.com>
* coff-h8300.c: Remove #if 0 code.
(compatable): Don't allow mixing/matching of different architectures.
-
+
* archures.c (bfd_mach_h8300s): Add.
* bfd-in2.h: Rebuilt.
* coff-h8300.c (funcvec_hash_newfunc): Handle H8/S too.
@@ -2907,7 +5194,7 @@ Wed May 29 16:15:29 1996 Ian Lance Taylor <ian@cygnus.com>
(bfd_elf64_littlemips_vec): Declare.
(bfd_target_vector): Add bfd_elf64_bigmips_vec and
bfd_elf64_littlemips_vec if BFD64 is defined.
-
+
* libbfd.c (bfd_get_file_window): Add cast to fprintf argument.
Tue May 28 11:42:08 1996 Ian Lance Taylor <ian@cygnus.com>
@@ -2997,7 +5284,7 @@ Tue May 7 16:10:19 1996 Michael Meissner <meissner@tiktok.cygnus.com>
* config{ure.in,.bfd}: Add support for ppcboot target.
* targets.c: Ditto.
* configure: Regenerate.
-
+
Tue May 7 11:15:19 1996 Jeffrey A Law (law@cygnus.com)
* coff-h8300.c (howto_table): Update names to match recent
@@ -3158,7 +5445,7 @@ Wed Apr 24 14:04:07 1996 Ian Lance Taylor <ian@cygnus.com>
(xcoff_dynamic_reloc): New static variable.
(_bfd_xcoff_canonicalize_dynamic_reloc): New function.
(xcoff_link_add_dynamic_symbols): Use xcoff_get_section_contents.
-
+
Tue Apr 23 12:48:42 1996 Ian Lance Taylor <ian@cygnus.com>
* coff-sparc.c (bfd_coff_generic_reloc): Return bfd_reloc_ok even
@@ -3356,7 +5643,7 @@ Thu Apr 4 18:49:09 1996 Fred Fish <fnf@cygnus.com>
* sysdep.h: Use TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H
to control what combination of <time> and <sys/time.h>
get included.
-
+
Tue Apr 2 13:11:53 1996 Doug Evans <dje@canuck.cygnus.com>
* aoutf1.h (sunos_32_set_arch_mach): Handle M_SPARCLET.
@@ -3408,7 +5695,7 @@ Sun Mar 31 01:58:41 1996 steve chamberlain <sac@slash.cygnus.com>
* peicode.h (coff_swap_aouthdr_out): Delete test for .junk.
* coffcode.h (coff_compute_section_file_positions): Likewise.
(coff_write_object_contents): Likewise.
-
+
Fri Mar 29 12:44:36 1996 Ian Lance Taylor <ian@cygnus.com>
* section.c (SEC_LINK_ONCE): Define.
@@ -3449,7 +5736,7 @@ Thu Mar 28 23:48:49 1996 Jeffrey A Law (law@cygnus.com)
the function vector as needed. Place the address of the function
vector entry in the location specified by the R_MEM_INDIRECT reloc.
Rewrite the vectors section contents as necessary.
- (h8300_bfd_link_add_symbols): New function for the h8300 linker.
+ (h8300_bfd_link_add_symbols): New function for the h8300 linker.
(coff_bfd_link_add_symbols): Define to use h8300 specific version.
(coff_bfd_link_hash_table_create): Likewise.
@@ -3615,7 +5902,7 @@ Thu Mar 14 16:06:06 1996 Jeffrey A Law (law@cygnus.com)
(rtype2howto): Support R_MEM_INDIRECT.
(h8300_reloc16_extra_cases): Handle R_MEM_INDIRECT like R_RELBYTE
for now.
-
+
Tue Mar 12 12:41:17 1996 David Mosberger-Tang <davidm@koala.azstarnet.com>
* coff-alpha.c (alpha_relocate_section): Use
@@ -3639,7 +5926,7 @@ Tue Mar 12 12:10:55 1996 Ian Lance Taylor <ian@cygnus.com>
* cofflink.c (_bfd_coff_reloc_link_order): Likewise.
* ecoff.c (ecoff_reloc_link_order): Likewise.
* elflink.h (elf_link_add_object_symbols): Likewise.
- (elf_reloc_link_order): Likewise.
+ (elf_reloc_link_order): Likewise.
* linker.c (_bfd_generic_link_output_symbols): Likewise.
(_bfd_generic_reloc_link_order): Likewise.
(default_indirect_link_order): Likewise.
@@ -4269,7 +6556,7 @@ Tue Jan 30 12:09:04 1996 Ian Lance Taylor <ian@cygnus.com>
Mon Jan 29 14:27:24 1996 Kim Knuttila <krk@cygnus.com>
- * libcoff-in.h: aligned newly exported names with bfd naming
+ * libcoff-in.h: aligned newly exported names with bfd naming
conventions. Removed an erroneous define of POWERPC_LE_PE.
* libcoff.h: Rebuild.
* cofflink.c, coff-ppc.c: the above function name changes
@@ -4312,10 +6599,10 @@ Mon Jan 29 11:34:36 1996 Kim Knuttila <krk@cygnus.com>
* libcoff-in.h: promoted the following from cofflink.c to allow
_bfd_coff_final_link to be overridden - STRING_SIZE_SIZE,
- coff_debug_merge_element, struct coff_debug_merge_type,
+ coff_debug_merge_element, struct coff_debug_merge_type,
coff_debug_merge_hash_entry, coff_debug_merge_hash_table,
coff_debug_merge_hash_table_init, coff_debug_merge_hash_table_free,
- coff_debug_merge_hash_lookup, coff_link_section_info,
+ coff_debug_merge_hash_lookup, coff_link_section_info,
coff_final_link_info, coff_debug_merge_hash_newfunc,
coff_write_global_sym, coff_link_input_bfd, coff_reloc_link_order.
@@ -4525,13 +6812,13 @@ Thu Jan 18 18:25:34 1996 Kim Knuttila <krk@cygnus.com>
(dump_toc): fix diagnosing code to identify out-of-toc-bounds entries.
Also begin the toc at 4 as an eye catcher ('31313131' marks the first
toc entry in an objdump) for now.
- (ppc_do_last, ppc_get_last): New function - needed to save processing
+ (ppc_do_last, ppc_get_last): New function - needed to save processing
the toc owner to the end.
- (ppc_coff_swap_sym_in_hook): Removed an incorrect hack for doing the
+ (ppc_coff_swap_sym_in_hook): Removed an incorrect hack for doing the
toc owner last.
- * cofflink.c (_bfd_coff_final_link): Added a new hack to keep the
- toc owner from being done till last. Must define POWERPC_LE_PC
+ * cofflink.c (_bfd_coff_final_link): Added a new hack to keep the
+ toc owner from being done till last. Must define POWERPC_LE_PC
to enable it.
* coffcode.h (coff_set_alignment_hook): alignment setting for .stab
@@ -4647,7 +6934,7 @@ Thu Jan 11 11:23:30 1996 Ian Lance Taylor <ian@cygnus.com>
* xcofflink.c (xcoff_link_add_symbols): Create the special
sections if we see a DYNAMIC object, in case that is the only
XCOFF input object we see.
-
+
* elf32-mips.c: Extensive changes for a start at dynamic linking
support, from Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
@@ -4793,7 +7080,7 @@ Thu Jan 4 17:12:37 1996 Fred Fish <fnf@cygnus.com>
(bfd_target_vector): Add i386freebsd_vec.
* i386linux.c (SEGMENT_SIZE): Define as TARGET_PAGE_SIZE
* i386netbsd.c (SEGMENT_SIZE): Define as TARGET_PAGE_SIZE
-
+
Thu Jan 4 16:27:46 1996 Ian Lance Taylor <ian@cygnus.com>
* ieee.c (ieee_slurp_debug): New static function.
@@ -5037,7 +7324,7 @@ Fri Dec 1 14:46:51 1995 Ian Lance Taylor <ian@cygnus.com>
Thu Nov 30 19:32:26 1995 Kim Knuttila <krk@cygnus.com>
* coff-ppc.c: Added macros to tidy up toc cell treatment. Numerous
- uses as well. Added a new howto to deal with TOCREL16 relocs that
+ uses as well. Added a new howto to deal with TOCREL16 relocs that
are TOCDEFN as well.
(coff_ppc_relocate_section): Expanded treatment of ADDR32NB relocs
to handle RVA relocs from dlltool.
@@ -5045,7 +7332,7 @@ Thu Nov 30 19:32:26 1995 Kim Knuttila <krk@cygnus.com>
(coff_ppc_rtype_to_howto): TOCDEFN reloc addition.
(ppc_coff_reloc_type_lookup): TOCDEFN reloc addition.
- * coffcode.h (coff_set_alignment_hook): check idata$X sections
+ * coffcode.h (coff_set_alignment_hook): check idata$X sections
to get the right section alignment.
Thu Nov 30 16:48:18 1995 Ian Lance Taylor <ian@cygnus.com>
@@ -5264,7 +7551,7 @@ Wed Nov 15 04:09:14 1995 Ken Raeburn <raeburn@cygnus.com>
(BFD_LIBS_CFILES, ALL_MACHINES_CFILES, BFD32_BACKENDS_CFILES,
BFD64_BACKENDS_CFILES): New variables.
(CFILES): Use them.
-
+
Tue Nov 14 11:52:23 1995 Ian Lance Taylor <ian@cygnus.com>
* peicode.h (coff_swap_aouthdr_out): For PPC PE, start isize at 0,
@@ -5551,7 +7838,7 @@ Mon Nov 6 17:13:15 1995 Harry Dolan <dolan@ssd.intel.com>
(BFD32_BACKENDS): Add coff-i860.o.
(CFILES): Add cpu-i860.c and coff-i860.c.
* targets.c (i860coff_vec): Declare.
- (bfd_target_vector): Add &i860coff_vec.
+ (bfd_target_vector): Add &i860coff_vec.
* archures.c (bfd_i860_arch): Declare.
(bfd_archures_list): Add &bfd_i860_arch.
* coffcode.h (coff_set_arch_mach_hook): Handle I860 magic number.
@@ -5616,7 +7903,7 @@ Sat Nov 4 12:23:26 1995 Fred Fish <fnf@cygnus.com>
* core.c: Renamed to corefile.c
* makefile.dos (OBJS): Change core.o to corefile.o
* Makefile.in (CFILES, BFD_LIBS): Use corefile.c instead of core.c
-
+
Fri Nov 3 15:54:59 1995 Ian Lance Taylor <ian@cygnus.com>
* xcofflink.c (xcoff_link_add_symbols): Rename local variable sub
@@ -5792,14 +8079,14 @@ Fri Oct 27 14:42:15 1995 Niklas Hallqvist <niklas@appli.se>
* libaout.h: Added M_68K4K_NETBSD magic.
* m68k4knetbsd.c: New file.
-
+
* hosts/{m68k,sparc}nbsd.h: Don't define HOST_BIG_ENDIAN_P.
* hosts/nbsd.h: Define HOST_BIG_ENDIAN_P according to
<machine/endian.h>.
* hosts/mipsnbsd.h: New file.
-
+
Thu Oct 26 14:16:47 1995 Ian Lance Taylor <ian@cygnus.com>
* xcofflink.c: Numerous changes to get closer to a working XCOFF
@@ -5820,7 +8107,7 @@ Thu Oct 26 14:16:47 1995 Ian Lance Taylor <ian@cygnus.com>
(rs6000coff_vec): Set symbol_leading_char to '.'.
* coffgen.c (coff_get_symbol_info): If fix_value is set, fix the
value stored in ret rather than returning a pointer value.
-
+
Wed Oct 25 23:10:39 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* config.bfd (powerpc{,le}-{elf,sysv4,eabi,solaris2}): Remove MAC
@@ -5872,7 +8159,7 @@ Tue Oct 24 17:44:20 1995 Stan Shebs <shebs@andros.cygnus.com>
* xcofflink.c (xcoff_link_add_symbols): Declare a local as PTR.
* mpw-make.sed: Generalize subdir_do edit.
-
+
Tue Oct 24 10:25:01 1995 Jeffrey A Law (law@cygnus.com)
* hppabsd-core.c (make_bfd_asection): Initialize asect->filepos
@@ -5896,7 +8183,7 @@ Wed Oct 18 16:20:08 1995 steve chamberlain <sac@slash.cygnus.com>
calc correct.
* peicode.h (add_data_entry): Use _cooked_size of data directory.
(coff_swap_outhdr_out): Hardwire in version number.
-
+
Wed Oct 18 16:50:54 1995 Ken Raeburn <raeburn@cygnus.com>
* sunos.c (sunos_add_dynamic_symbols): Rename local variables
@@ -6395,13 +8682,13 @@ Wed Sep 27 10:37:14 1995 Ian Lance Taylor <ian@cygnus.com>
Wed Sep 27 07:23:39 1995 Kim Knuttila <krk@nellie>
- * coff-ppc.c, pe-ppc.c, pei-ppc.c: Initial bfd for coff/PE
+ * coff-ppc.c, pe-ppc.c, pei-ppc.c: Initial bfd for coff/PE
support on powerpc.
* Makefile.in: added *-ppc files
* coffcode.h: ppc MAGIC, and use peicode.h rather than coffswap.h to
allow pe based .o's to be shared with other tools on ppc/NT
* config.bfd: added powerpc[le]-[pe|winnt] config support
- * configure, configure.in: added bfd_powerpc[le]_pe[i]_vec
+ * configure, configure.in: added bfd_powerpc[le]_pe[i]_vec
* peicode.h: Added more section flags for PE on ppc
Added coff_swap_filehdr_out to allow peicode.h to be
used for non-image PE files on ppc.
@@ -6661,7 +8948,7 @@ Wed Sep 13 13:27:53 1995 Ian Lance Taylor <ian@cygnus.com>
Thu Sep 12 12:45:34 1995 steve chamberlain <sac@slash.cygnus.com>
* coffcode.h (coff_compute_section_file_positions): Keep the
- raw size safe.
+ raw size safe.
(coff_write_object_contents): Remember if it's a relocatable
file.
* libcoff-in.h (pe_data_type): New member 'has_reloc_section'
diff --git a/contrib/binutils/bfd/Makefile.am b/contrib/binutils/bfd/Makefile.am
new file mode 100644
index 0000000..b8e5544
--- /dev/null
+++ b/contrib/binutils/bfd/Makefile.am
@@ -0,0 +1,977 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus
+
+INCDIR = $(srcdir)/../include
+CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
+DEP = mkdep
+
+SUBDIRS = doc
+
+docdir = doc
+
+lib_LTLIBRARIES = libbfd.la
+
+# bfd.h goes here, for now
+BFD_H = bfd.h
+
+# Jim Kingdon notes:
+# Writing S-records should be included in all (or at least most)
+# *-*-coff, *-*-aout, etc., configurations, because people will want to
+# be able to use objcopy to create S-records. (S-records are not useful
+# for the debugger, so if you are downloading things as S-records you
+# need two copies of the executable, one to download and one for the
+# debugger).
+BFD_LIBS = \
+ archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo \
+ format.lo init.lo libbfd.lo opncls.lo reloc.lo \
+ section.lo syms.lo targets.lo hash.lo linker.lo \
+ srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo
+
+BFD_LIBS_CFILES = \
+ archive.c archures.c bfd.c cache.c coffgen.c corefile.c \
+ format.c init.c libbfd.c opncls.c reloc.c \
+ section.c syms.c targets.c hash.c linker.c \
+ srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c
+
+# This list is alphabetized to make it easier to keep in sync
+# with the decls and initializer in archures.c.
+ALL_MACHINES = \
+ cpu-a29k.lo \
+ cpu-alpha.lo \
+ cpu-arc.lo \
+ cpu-arm.lo \
+ cpu-d10v.lo \
+ cpu-h8300.lo \
+ cpu-h8500.lo \
+ cpu-hppa.lo \
+ cpu-i386.lo \
+ cpu-i860.lo \
+ cpu-i960.lo \
+ cpu-m32r.lo \
+ cpu-m68k.lo \
+ cpu-m88k.lo \
+ cpu-mips.lo \
+ cpu-m10200.lo \
+ cpu-m10300.lo \
+ cpu-ns32k.lo \
+ cpu-powerpc.lo \
+ cpu-rs6000.lo \
+ cpu-sh.lo \
+ cpu-sparc.lo \
+ cpu-tic30.lo \
+ cpu-v850.lo \
+ cpu-vax.lo \
+ cpu-we32k.lo \
+ cpu-w65.lo \
+ cpu-z8k.lo
+
+ALL_MACHINES_CFILES = \
+ cpu-a29k.c \
+ cpu-alpha.c \
+ cpu-arc.c \
+ cpu-arm.c \
+ cpu-h8300.c \
+ cpu-h8500.c \
+ cpu-hppa.c \
+ cpu-i386.c \
+ cpu-i860.c \
+ cpu-i960.c \
+ cpu-m32r.c \
+ cpu-m68k.c \
+ cpu-m88k.c \
+ cpu-mips.c \
+ cpu-m10200.c \
+ cpu-m10300.c \
+ cpu-ns32k.c \
+ cpu-powerpc.c \
+ cpu-rs6000.c \
+ cpu-sh.c \
+ cpu-sparc.c \
+ cpu-tic30.c \
+ cpu-v850.c \
+ cpu-vax.c \
+ cpu-we32k.c \
+ cpu-w65.c \
+ cpu-z8k.c
+
+# The .o files needed by all of the 32 bit vectors that are configured into
+# target_vector in targets.c if configured with --enable-targets=all.
+BFD32_BACKENDS = \
+ aout-adobe.lo \
+ aout-arm.lo \
+ aout-ns32k.lo \
+ aout-sparcle.lo \
+ aout-tic30.lo \
+ aout0.lo \
+ aout32.lo \
+ bout.lo \
+ cf-i386lynx.lo \
+ cf-m68klynx.lo \
+ cf-sparclynx.lo \
+ coff-a29k.lo \
+ coff-apollo.lo \
+ coff-arm.lo \
+ coff-aux.lo \
+ coff-h8300.lo \
+ coff-h8500.lo \
+ coff-i386.lo \
+ coff-go32.lo \
+ coff-i860.lo \
+ coff-i960.lo \
+ coff-m68k.lo \
+ coff-m88k.lo \
+ coff-mips.lo \
+ coff-pmac.lo \
+ coff-rs6000.lo \
+ coff-sh.lo \
+ coff-sparc.lo \
+ coff-stgo32.lo \
+ coff-svm68k.lo \
+ coff-tic30.lo \
+ coff-u68k.lo \
+ coff-we32k.lo \
+ coff-w65.lo \
+ coff-z8k.lo \
+ cofflink.lo \
+ dwarf2.lo \
+ ecoff.lo \
+ ecofflink.lo \
+ elf.lo \
+ elf32-arc.lo \
+ elf32-d10v.lo \
+ elf32-gen.lo \
+ elf32-hppa.lo \
+ elf32-i386.lo \
+ elf32-i860.lo \
+ elf32-m32r.lo \
+ elf32-m68k.lo \
+ elf32-m88k.lo \
+ elf32-mips.lo \
+ elf-m10200.lo \
+ elf-m10300.lo \
+ elf32-ppc.lo \
+ elf32-sh.lo \
+ elf32-sparc.lo \
+ elf32-v850.lo \
+ elf32.lo \
+ elflink.lo \
+ hp300bsd.lo \
+ hp300hpux.lo \
+ som.lo \
+ i386aout.lo \
+ i386bsd.lo \
+ i386dynix.lo \
+ i386freebsd.lo \
+ i386linux.lo \
+ i386lynx.lo \
+ i386msdos.lo \
+ i386netbsd.lo \
+ i386mach3.lo \
+ i386os9k.lo \
+ ieee.lo \
+ m68k4knetbsd.lo \
+ m68klinux.lo \
+ m68klynx.lo \
+ m68knetbsd.lo \
+ m88kmach3.lo \
+ mipsbsd.lo \
+ newsos3.lo \
+ nlm.lo \
+ nlm32-i386.lo \
+ nlm32-sparc.lo \
+ nlm32-ppc.lo \
+ nlm32.lo \
+ ns32knetbsd.lo \
+ oasys.lo \
+ pc532-mach.lo \
+ pe-arm.lo \
+ pei-arm.lo \
+ pe-i386.lo \
+ pei-i386.lo \
+ pe-ppc.lo \
+ pei-ppc.lo \
+ ppcboot.lo \
+ reloc16.lo \
+ riscix.lo \
+ sparclinux.lo \
+ sparclynx.lo \
+ sparcnetbsd.lo \
+ sunos.lo \
+ vaxnetbsd.lo \
+ versados.lo \
+ xcofflink.lo
+
+BFD32_BACKENDS_CFILES = \
+ aout-adobe.c \
+ aout-arm.c \
+ aout-ns32k.c \
+ aout-sparcle.c \
+ aout-tic30.c \
+ aout0.c \
+ aout32.c \
+ bout.c \
+ cf-i386lynx.c \
+ cf-m68klynx.c \
+ cf-sparclynx.c \
+ coff-a29k.c \
+ coff-apollo.c \
+ coff-arm.c \
+ coff-aux.c \
+ coff-h8300.c \
+ coff-h8500.c \
+ coff-i386.c \
+ coff-i860.c \
+ coff-go32.c \
+ coff-i960.c \
+ coff-m68k.c \
+ coff-m88k.c \
+ coff-mips.c \
+ coff-pmac.c \
+ coff-rs6000.c \
+ coff-sh.c \
+ coff-sparc.c \
+ coff-stgo32.c \
+ coff-svm68k.c \
+ coff-tic30.c \
+ coff-u68k.c \
+ coff-we32k.c \
+ coff-w65.c \
+ coff-z8k.c \
+ cofflink.c \
+ dwarf2.c \
+ ecoff.c \
+ ecofflink.c \
+ elf.c \
+ elf32-arc.c \
+ elf32-d10v.c \
+ elf32-gen.c \
+ elf32-hppa.c \
+ elf32-i386.c \
+ elf32-i860.c \
+ elf32-m32r.c \
+ elf32-m68k.c \
+ elf32-m88k.c \
+ elf32-mips.c \
+ elf-m10200.c \
+ elf-m10300.c \
+ elf32-ppc.c \
+ elf32-sh.c \
+ elf32-sparc.c \
+ elf32-v850.c \
+ elf32.c \
+ elflink.c \
+ hp300bsd.c \
+ hp300hpux.c \
+ som.c \
+ i386aout.c \
+ i386bsd.c \
+ i386dynix.c \
+ i386freebsd.c \
+ i386linux.c \
+ i386lynx.c \
+ i386msdos.c \
+ i386netbsd.c \
+ i386mach3.c \
+ i386os9k.c \
+ ieee.c \
+ m68k4knetbsd.c \
+ m68klinux.c \
+ m68klynx.c \
+ m68knetbsd.c \
+ m88kmach3.c \
+ mipsbsd.c \
+ newsos3.c \
+ nlm.c \
+ nlm32-i386.c \
+ nlm32-sparc.c \
+ nlm32-ppc.c \
+ nlm32.c \
+ ns32knetbsd.c \
+ oasys.c \
+ pc532-mach.c \
+ pe-arm.c \
+ pei-arm.c \
+ pe-i386.c \
+ pei-i386.c \
+ pe-ppc.c \
+ pei-ppc.c \
+ ppcboot.c \
+ reloc16.c \
+ riscix.c \
+ sparclinux.c \
+ sparclynx.c \
+ sparcnetbsd.c \
+ sunos.c \
+ vaxnetbsd.c \
+ versados.c \
+ xcofflink.c
+
+# The .o files needed by all of the 64 bit vectors that are configured into
+# target_vector in targets.c if configured with --enable-targets=all
+# and --enable-64-bit-bfd.
+BFD64_BACKENDS = \
+ aout64.lo \
+ coff-alpha.lo \
+ demo64.lo \
+ elf64-alpha.lo \
+ elf64-gen.lo \
+ elf64-mips.lo \
+ elf64-sparc.lo \
+ elf64.lo \
+ evax-alpha.lo \
+ evax-egsd.lo \
+ evax-etir.lo \
+ evax-emh.lo \
+ evax-misc.lo \
+ nlm32-alpha.lo \
+ nlm64.lo
+
+BFD64_BACKENDS_CFILES = \
+ aout64.c \
+ coff-alpha.c \
+ demo64.c \
+ elf64-alpha.c \
+ elf64-gen.c \
+ elf64-mips.c \
+ elf64-sparc.c \
+ elf64.c \
+ evax-alpha.c \
+ evax-egsd.c \
+ evax-etir.c \
+ evax-emh.c \
+ evax-misc.c \
+ nlm32-alpha.c \
+ nlm64.c
+
+OPTIONAL_BACKENDS = \
+ aix386-core.lo \
+ hpux-core.lo \
+ irix-core.lo \
+ lynx-core.lo \
+ osf-core.lo \
+ trad-core.lo \
+ cisco-core.lo
+
+OPTIONAL_BACKENDS_CFILES = \
+ aix386-core.c \
+ hpux-core.c \
+ irix-core.c \
+ lynx-core.c \
+ osf-core.c \
+ trad-core.c \
+ cisco-core.c
+
+# These are defined by configure.in:
+WORDSIZE = @wordsize@
+ALL_BACKENDS = @all_backends@
+BFD_BACKENDS = @bfd_backends@
+BFD_MACHINES = @bfd_machines@
+TDEFAULTS = @tdefaults@
+
+INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES)
+
+# C source files that correspond to .o's.
+CFILES = \
+ $(BFD_LIBS_CFILES) \
+ $(ALL_MACHINES_CFILES) \
+ $(BFD32_BACKENDS_CFILES) \
+ $(BFD64_BACKENDS_CFILES) \
+ $(OPTIONAL_BACKENDS_CFILES)
+
+HFILES = \
+ aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
+ ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
+ elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+ libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
+ libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
+ targmatch.h
+
+diststuff: info
+
+# Various kinds of .o files to put in libbfd.a:
+# BFD_BACKENDS Routines the configured targets need.
+# BFD_MACHINES Architecture-specific routines the configured targets need.
+# COREFILE Core file routines for a native configuration
+OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
+
+stamp-ofiles: Makefile
+ rm -f tofiles
+ f=""; \
+ for i in $(OFILES) ; do \
+ case " $$f " in \
+ *" $$i "*) ;; \
+ *) f="$$f $$i" ;; \
+ esac ; \
+ done ; \
+ echo $$f > tofiles
+ $(SHELL) $(srcdir)/../move-if-change tofiles ofiles
+ touch stamp-ofiles
+
+ofiles: stamp-ofiles ; @true
+
+libbfd_la_SOURCES = $(BFD_LIBS_CFILES)
+libbfd_la_DEPENDENCIES = $(OFILES) ofiles
+libbfd_la_LIBADD = `cat ofiles`
+libbfd_la_LDFLAGS = -release $(VERSION)
+
+# libtool will build .libs/libbfd.a. We create libbfd.a in the build
+# directory so that we don't have to convert all the programs that use
+# libbfd.a simultaneously. This is a hack which should be removed if
+# everything else starts using libtool. FIXME.
+
+noinst_LIBRARIES = libbfd.a
+libbfd_a_SOURCES =
+
+stamp-lib: libbfd.la
+ if [ -f .libs/libbfd.a ]; then \
+ cp .libs/libbfd.a libbfd.tmp; \
+ $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
+ else true; fi
+ touch stamp-lib
+
+libbfd.a: stamp-lib ; @true
+
+# This file holds an array associating configuration triplets and
+# vector names. It is built from config.bfd. It is not compiled by
+# itself, but is included by targets.c.
+targmatch.h: config.bfd targmatch.sed
+ rm -f targmatch.h
+ sed -f $(srcdir)/targmatch.sed < $(srcdir)/config.bfd > targmatch.new
+ mv -f targmatch.new targmatch.h
+
+# When compiling archures.c and targets.c, supply the default target
+# info from configure.
+
+targets.lo: targets.c config.status
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/targets.c
+
+archures.lo: archures.c config.status
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c
+
+elf32-target.h : elfxx-target.h
+ rm -f elf32-target.h
+ sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new
+ mv -f elf32-target.new elf32-target.h
+
+elf64-target.h : elfxx-target.h
+ rm -f elf64-target.h
+ sed -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new
+ mv -f elf64-target.new elf64-target.h
+
+BFD_H_DEPS= $(INCDIR)/ansidecl.h
+LOCAL_H_DEPS= libbfd.h sysdep.h config.h
+$(BFD_LIBS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
+$(BFD_MACHINES): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
+$(BFD_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
+$(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
+
+# Install BFD include file, and others that it needs.
+install-data-local: $(BFD_H)
+ $(INSTALL_DATA) $(BFD_H) $(includedir)/bfd.h
+ $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(includedir)/ansidecl.h
+ $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(includedir)/bfdlink.h
+
+# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
+.dep: dep.sed $(CFILES) $(HFILES) bfd.h
+ rm -f .dep1
+ $(MAKE) DEP=$(DEP) .dep1
+ sed -f dep.sed <.dep1 >.dep
+
+# This rule really wants a mkdep that runs "gcc -MM".
+# The NetBSD mkdep overwrites any existing file contents, and doesn't insert
+# the "DO NOT DELETE" line.
+# Other mkdep versions require a file that already exists, and do insert it.
+# Hence the weirdness....
+.dep1: $(CFILES)
+ rm -f .dep2 .dep2a
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
+ echo > .dep2a
+ $(DEP) -f .dep2a $(INCLUDES) $(CFLAGS) $?
+ sed -e '/DO NOT DELETE/d' -e '/^$$/d' < .dep2a >> .dep2
+ rm -f .dep2a
+ $(SHELL) $(srcdir)/../move-if-change .dep2 .dep1
+
+dep.sed: dep-in.sed config.status
+ sed <$(srcdir)/dep-in.sed >dep.sed \
+ -e 's!@BFD_H@!$(BFD_H)!' \
+ -e 's!@INCDIR@!$(INCDIR)!' \
+ -e 's!@SRCDIR@!$(srcdir)!'
+
+dep: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
+ cat .dep >> tmp-Makefile
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
+
+dep-in: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
+ cat .dep >> tmp-Makefile.in
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
+
+dep-am: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
+ cat .dep >> tmp-Makefile.am
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
+
+host-aout.lo: Makefile
+
+# The following program can be used to generate a simple config file
+# which can be folded into an h-XXX file for a new host, with some editing.
+aout-params.h: gen-aout
+ ./gen-aout host > aout-params.h
+gen-aout: $(srcdir)/gen-aout.c Makefile
+ $(CC) -o gen-aout $(CFLAGS) $(LFLAGS) $(srcdir)/gen-aout.c
+
+$(BFD_H): stmp-bfd-h ; @true
+
+stmp-bfd-h: bfd-in3.h
+ rm -f bfd-tmp.h
+ cp bfd-in3.h bfd-tmp.h
+ $(SHELL) $(srcdir)/../move-if-change bfd-tmp.h $(BFD_H)
+ rm -f bfd-tmp.h
+ touch stmp-bfd-h
+
+BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
+ reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c
+LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c
+LIBCOFF_H_FILES = libcoff-in.h coffcode.h
+
+# Could really use a "copy-if-change"...
+headers:
+ (cd $(docdir); $(MAKE) protos $(FLAGS_TO_PASS))
+ cp $(docdir)/bfd.h bfd-in2.h-new
+ $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
+ cp $(docdir)/libbfd.h libbfd.h-new
+ $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
+ cp $(docdir)/libcoff.h libcoff.h-new
+ $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+
+# We only rebuild the header files automatically if we have been
+# configured with --enable-maintainer-mode.
+
+$(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
+stmp-bin2-h: $(BFD_H_FILES)
+ (cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
+ cp $(docdir)/bfd.h bfd-in2.h-new
+ $(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
+ touch stmp-bin2-h
+
+$(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
+stmp-lbfd-h: $(LIBBFD_H_FILES)
+ (cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
+ cp $(docdir)/libbfd.h libbfd.h-new
+ $(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
+ touch stmp-lbfd-h
+
+$(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
+stmp-lcoff-h: $(LIBCOFF_H_FILES)
+ (cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
+ cp $(docdir)/libcoff.h libcoff.h-new
+ $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+ touch stmp-lcoff-h
+
+MOSTLYCLEANFILES = elf32-target.h elf64-target.h ofiles stamp-ofiles \
+ targmatch.h
+
+CLEANFILES = bfd.h dep.sed stmp-bfd-h .dep .dep1 libbfd.a stamp-lib \
+ stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
+
+
+
+# What appears below is generated by a hacked mkdep using gcc -MM.
+
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+archive.lo: archive.c $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h
+archures.lo: archures.c
+bfd.lo: bfd.c $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \
+ libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
+cache.lo: cache.c
+coffgen.lo: coffgen.c $(INCDIR)/coff/internal.h libcoff.h \
+ $(INCDIR)/bfdlink.h
+corefile.lo: corefile.c
+format.lo: format.c
+init.lo: init.c
+libbfd.lo: libbfd.c
+opncls.lo: opncls.c $(INCDIR)/objalloc.h
+reloc.lo: reloc.c $(INCDIR)/bfdlink.h
+section.lo: section.c
+syms.lo: syms.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def
+targets.lo: targets.c $(INCDIR)/fnmatch.h targmatch.h
+hash.lo: hash.c $(INCDIR)/objalloc.h
+linker.lo: linker.c $(INCDIR)/bfdlink.h genlink.h
+srec.lo: srec.c $(INCDIR)/libiberty.h
+binary.lo: binary.c
+tekhex.lo: tekhex.c $(INCDIR)/libiberty.h
+ihex.lo: ihex.c $(INCDIR)/libiberty.h
+stabs.lo: stabs.c $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
+stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def
+cpu-a29k.lo: cpu-a29k.c
+cpu-alpha.lo: cpu-alpha.c
+cpu-arc.lo: cpu-arc.c
+cpu-arm.lo: cpu-arm.c
+cpu-h8300.lo: cpu-h8300.c
+cpu-h8500.lo: cpu-h8500.c
+cpu-hppa.lo: cpu-hppa.c
+cpu-i386.lo: cpu-i386.c
+cpu-i860.lo: cpu-i860.c
+cpu-i960.lo: cpu-i960.c
+cpu-m32r.lo: cpu-m32r.c
+cpu-m68k.lo: cpu-m68k.c
+cpu-m88k.lo: cpu-m88k.c
+cpu-mips.lo: cpu-mips.c
+cpu-m10200.lo: cpu-m10200.c
+cpu-m10300.lo: cpu-m10300.c
+cpu-ns32k.lo: cpu-ns32k.c ns32k.h
+cpu-powerpc.lo: cpu-powerpc.c
+cpu-rs6000.lo: cpu-rs6000.c
+cpu-sh.lo: cpu-sh.c
+cpu-sparc.lo: cpu-sparc.c
+cpu-tic30.lo: cpu-tic30.c
+cpu-v850.lo: cpu-v850.c
+cpu-vax.lo: cpu-vax.c
+cpu-we32k.lo: cpu-we32k.c
+cpu-w65.lo: cpu-w65.c
+cpu-z8k.lo: cpu-z8k.c
+aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
+ $(INCDIR)/bfdlink.h
+aout-arm.lo: aout-arm.c libaout.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/aout/aout64.h aoutx.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
+aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \
+ ns32k.h libaout.h $(INCDIR)/bfdlink.h
+aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \
+ libaout.h aoutf1.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
+ aout-target.h
+aout-tic30.lo: aout-tic30.c libaout.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
+ $(INCDIR)/aout/ar.h aoutx.h
+aout0.lo: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
+aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
+ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
+ $(INCDIR)/aout/ar.h
+bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h
+cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/coff/m68k.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/coff/sparc.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-a29k.lo: coff-a29k.c $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
+coff-apollo.lo: coff-apollo.c $(INCDIR)/coff/apollo.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-arm.lo: coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
+coff-aux.lo: coff-aux.c $(INCDIR)/coff/aux-coff.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/m68k.h coff-m68k.c libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-h8300.lo: coff-h8300.c $(INCDIR)/bfdlink.h genlink.h \
+ $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h \
+ coffcode.h coffswap.h
+coff-h8500.lo: coff-h8500.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/h8500.h \
+ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
+coff-i386.lo: coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
+coff-i860.lo: coff-i860.c $(INCDIR)/coff/i860.h $(INCDIR)/coff/internal.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
+coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/coff/i386.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-i960.lo: coff-i960.c $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
+coff-m68k.lo: coff-m68k.c $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
+coff-m88k.lo: coff-m88k.c $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
+coff-mips.lo: coff-mips.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
+ $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \
+ ecoffswap.h
+coff-pmac.lo: coff-pmac.c coff-rs6000.c $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
+ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
+coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/coff/i386.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \
+ go32stub.h
+coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-tic30.lo: coff-tic30.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic30.h \
+ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
+coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-we32k.lo: coff-we32k.c $(INCDIR)/coff/we32k.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-w65.lo: coff-w65.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/w65.h \
+ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
+coff-z8k.lo: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \
+ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
+cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
+ libcoff.h
+dwarf2.lo: dwarf2.c $(INCDIR)/libiberty.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
+ecoff.lo: ecoff.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/ar.h \
+ $(INCDIR)/aout/ranlib.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
+ libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
+ libcoff.h libecoff.h
+ecofflink.lo: ecofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/objalloc.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
+ libcoff.h libecoff.h
+elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
+elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/arc.h elf32-target.h
+elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-target.h
+elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-target.h
+elf32-hppa.lo: elf32-hppa.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ elf32-hppa.h libhppa.h $(INCDIR)/elf/hppa.h hppa_stubs.h \
+ elf32-target.h
+elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ elf32-target.h
+elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-target.h
+elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/m32r.h elf32-target.h
+elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ elf32-target.h
+elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-target.h
+elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \
+ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \
+ $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \
+ elf32-target.h
+elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-target.h
+elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-target.h
+elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/ppc.h elf32-target.h
+elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ elf32-target.h
+elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/sparc.h elf32-target.h
+elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/v850.h elf32-target.h
+elf32.lo: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/fnmatch.h elfcore.h elflink.h
+elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
+hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \
+ aoutx.h $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
+ aout-target.h
+som.lo: som.c
+i386aout.lo: i386aout.c $(INCDIR)/aout/aout64.h libaout.h \
+ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+i386bsd.lo: i386bsd.c libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \
+ $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
+ aout-target.h
+i386freebsd.lo: i386freebsd.c freebsd.h libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+i386linux.lo: i386linux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
+ $(INCDIR)/bfdlink.h aout-target.h
+i386lynx.lo: i386lynx.c libaout.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+i386msdos.lo: i386msdos.c libaout.h $(INCDIR)/bfdlink.h
+i386netbsd.lo: i386netbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+i386mach3.lo: i386mach3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
+ $(INCDIR)/bfdlink.h aout-target.h
+i386os9k.lo: i386os9k.c $(INCDIR)/bfdlink.h libaout.h \
+ $(INCDIR)/os9k.h
+ieee.lo: ieee.c $(INCDIR)/ieee.h libieee.h
+m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h libaout.h \
+ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+m68klinux.lo: m68klinux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
+ $(INCDIR)/bfdlink.h aout-target.h
+m68klynx.lo: m68klynx.c libaout.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+m68knetbsd.lo: m68knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+m88kmach3.lo: m88kmach3.c libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+mipsbsd.lo: mipsbsd.c libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+newsos3.lo: newsos3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
+ $(INCDIR)/bfdlink.h aout-target.h
+nlm.lo: nlm.c libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
+ $(INCDIR)/nlm/external.h
+nlm32-i386.lo: nlm32-i386.c $(INCDIR)/nlm/i386-ext.h \
+ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
+ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
+nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/nlm/sparc32-ext.h \
+ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
+ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
+nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/nlm/ppc-ext.h libnlm.h \
+ $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \
+ nlmswap.h nlm-target.h
+nlm32.lo: nlm32.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \
+ $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h
+ns32knetbsd.lo: ns32knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+oasys.lo: oasys.c $(INCDIR)/oasys.h liboasys.h
+pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h
+pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h
+pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h
+pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h
+pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h
+pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ppcboot.lo: ppcboot.c
+reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \
+ $(INCDIR)/coff/internal.h libcoff.h
+riscix.lo: riscix.c libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ aout-target.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
+ $(INCDIR)/aout/ar.h
+sparclinux.lo: sparclinux.c $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
+ libaout.h $(INCDIR)/bfdlink.h aout-target.h
+sparclynx.lo: sparclynx.c $(INCDIR)/aout/sun4.h libaout.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
+sparcnetbsd.lo: sparcnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \
+ $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
+vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+versados.lo: versados.c $(INCDIR)/libiberty.h
+xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
+ libcoff.h
+aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
+ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
+ $(INCDIR)/aout/ar.h
+coff-alpha.lo: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
+ $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \
+ libecoff.h coffswap.h ecoffswap.h
+demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \
+ libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
+ aout-target.h
+elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/alpha.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
+ $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \
+ $(INCDIR)/aout/ar.h libcoff.h libecoff.h ecoffswap.h \
+ elf64-target.h
+elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf64-target.h
+elf64-mips.lo: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \
+ genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \
+ $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \
+ elf64-target.h
+elf64-sparc.lo: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/sparc.h elf64-target.h
+elf64.lo: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/fnmatch.h elfcore.h elflink.h
+evax-alpha.lo: evax-alpha.c $(INCDIR)/bfdlink.h evax.h
+evax-egsd.lo: evax-egsd.c $(INCDIR)/bfdlink.h evax.h
+evax-etir.lo: evax-etir.c $(INCDIR)/bfdlink.h evax.h
+evax-emh.lo: evax-emh.c $(INCDIR)/bfdlink.h evax.h
+evax-misc.lo: evax-misc.c $(INCDIR)/bfdlink.h evax.h
+nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \
+ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
+ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
+nlm64.lo: nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \
+ $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h
+aix386-core.lo: aix386-core.c $(INCDIR)/coff/i386.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h
+hpux-core.lo: hpux-core.c
+irix-core.lo: irix-core.c
+lynx-core.lo: lynx-core.c
+osf-core.lo: osf-core.c
+trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h
+cisco-core.lo: cisco-core.c
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/contrib/binutils/bfd/Makefile.in b/contrib/binutils/bfd/Makefile.in
index e9233cf..d8249a4 100644
--- a/contrib/binutils/bfd/Makefile.in
+++ b/contrib/binutils/bfd/Makefile.in
@@ -1,76 +1,95 @@
-# Makefile template for Configure for the BFD library.
-# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
-# Free Software Foundation, Inc.
-# Written by Cygnus Support.
-#
-# This file is part of BFD, the Binary File Descriptor library.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
+# Makefile.in generated automatically by automake 1.2e from Makefile.am
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
+
# 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.
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-VPATH = @srcdir@
-srcdir = @srcdir@
-prefix = @prefix@
+SHELL = @SHELL@
-program_transform_name = @program_transform_name@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
datadir = @datadir@
-mandir = @mandir@
-man1dir = $(mandir)/man1
-man2dir = $(mandir)/man2
-man3dir = $(mandir)/man3
-man4dir = $(mandir)/man4
-man5dir = $(mandir)/man5
-man6dir = $(mandir)/man6
-man7dir = $(mandir)/man7
-man8dir = $(mandir)/man8
-man9dir = $(mandir)/man9
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
infodir = @infodir@
+mandir = @mandir@
includedir = @includedir@
-oldincludedir =
-docdir = doc
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
-SHELL = /bin/sh
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
AR = @AR@
-AR_FLAGS = rc
+BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@
+BFD_HOST_64_BIT = @BFD_HOST_64_BIT@
+BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@
+BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@
CC = @CC@
-CFLAGS = @CFLAGS@
-MAKEINFO = makeinfo
+CC_FOR_BUILD = @CC_FOR_BUILD@
+COREFILE = @COREFILE@
+COREFLAG = @COREFLAG@
+EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+HDEFINES = @HDEFINES@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
+TDEFINES = @TDEFINES@
+VERSION = @VERSION@
+all_backends = @all_backends@
+bfd_backends = @bfd_backends@
+bfd_machines = @bfd_machines@
+tdefaults = @tdefaults@
+wordsize = @wordsize@
-ALLLIBS = @ALLLIBS@
-
-PICFLAG = @PICFLAG@
-SHLIB = @SHLIB@
-SHLIB_CC = @SHLIB_CC@
-SHLIB_CFLAGS = @SHLIB_CFLAGS@
-SHLIB_LIBS = @SHLIB_LIBS@
-COMMON_SHLIB = @COMMON_SHLIB@
-SHLINK = @SHLINK@
-
-SONAME = lib`echo $(SHLIB) | sed -e 's/^lib//' | sed '$(program_transform_name)'`
-
-CC_FOR_BUILD = @CC_FOR_BUILD@
+AUTOMAKE_OPTIONS = cygnus
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
@@ -78,18 +97,14 @@ DEP = mkdep
SUBDIRS = doc
-TARGETLIB = libbfd.a
+docdir = doc
+
+lib_LTLIBRARIES = libbfd.la
# bfd.h goes here, for now
BFD_H = bfd.h
-# Some of these files should be in BFD*_BACKENDS below, but some programs
-# won't link without them. So, in order for some of the minimal-bfd
-# hacks to work, they're also included here for now.
-# gdb: elf.o
-# objdump: elf.o
-#
-# Also, Jim Kingdon notes:
+# Jim Kingdon notes:
# Writing S-records should be included in all (or at least most)
# *-*-coff, *-*-aout, etc., configurations, because people will want to
# be able to use objcopy to create S-records. (S-records are not useful
@@ -97,49 +112,53 @@ BFD_H = bfd.h
# need two copies of the executable, one to download and one for the
# debugger).
BFD_LIBS = \
- archive.o archures.o bfd.o cache.o coffgen.o corefile.o \
- format.o init.o libbfd.o opncls.o reloc.o \
- section.o syms.o targets.o hash.o linker.o \
- elf.o srec.o binary.o tekhex.o ihex.o stabs.o stab-syms.o
+ archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo \
+ format.lo init.lo libbfd.lo opncls.lo reloc.lo \
+ section.lo syms.lo targets.lo hash.lo linker.lo \
+ srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo
BFD_LIBS_CFILES = \
archive.c archures.c bfd.c cache.c coffgen.c corefile.c \
format.c init.c libbfd.c opncls.c reloc.c \
section.c syms.c targets.c hash.c linker.c \
- elf.c srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c
+ srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c
# This list is alphabetized to make it easier to keep in sync
# with the decls and initializer in archures.c.
ALL_MACHINES = \
- cpu-a29k.o \
- cpu-alpha.o \
- cpu-arm.o \
- cpu-d10v.o \
- cpu-h8300.o \
- cpu-h8500.o \
- cpu-hppa.o \
- cpu-i386.o \
- cpu-i860.o \
- cpu-i960.o \
- cpu-m32r.o \
- cpu-m68k.o \
- cpu-m88k.o \
- cpu-mips.o \
- cpu-m10200.o \
- cpu-m10300.o \
- cpu-ns32k.o \
- cpu-powerpc.o \
- cpu-rs6000.o \
- cpu-sh.o \
- cpu-sparc.o \
- cpu-vax.o \
- cpu-we32k.o \
- cpu-w65.o \
- cpu-z8k.o
+ cpu-a29k.lo \
+ cpu-alpha.lo \
+ cpu-arc.lo \
+ cpu-arm.lo \
+ cpu-d10v.lo \
+ cpu-h8300.lo \
+ cpu-h8500.lo \
+ cpu-hppa.lo \
+ cpu-i386.lo \
+ cpu-i860.lo \
+ cpu-i960.lo \
+ cpu-m32r.lo \
+ cpu-m68k.lo \
+ cpu-m88k.lo \
+ cpu-mips.lo \
+ cpu-m10200.lo \
+ cpu-m10300.lo \
+ cpu-ns32k.lo \
+ cpu-powerpc.lo \
+ cpu-rs6000.lo \
+ cpu-sh.lo \
+ cpu-sparc.lo \
+ cpu-tic30.lo \
+ cpu-v850.lo \
+ cpu-vax.lo \
+ cpu-we32k.lo \
+ cpu-w65.lo \
+ cpu-z8k.lo
ALL_MACHINES_CFILES = \
cpu-a29k.c \
cpu-alpha.c \
+ cpu-arc.c \
cpu-arm.c \
cpu-h8300.c \
cpu-h8500.c \
@@ -158,6 +177,8 @@ ALL_MACHINES_CFILES = \
cpu-rs6000.c \
cpu-sh.c \
cpu-sparc.c \
+ cpu-tic30.c \
+ cpu-v850.c \
cpu-vax.c \
cpu-we32k.c \
cpu-w65.c \
@@ -166,108 +187,116 @@ ALL_MACHINES_CFILES = \
# The .o files needed by all of the 32 bit vectors that are configured into
# target_vector in targets.c if configured with --enable-targets=all.
BFD32_BACKENDS = \
- aout-adobe.o \
- aout-arm.o \
- aout-ns32k.o \
- aout-sparcle.o \
- aout0.o \
- aout32.o \
- bout.o \
- cf-i386lynx.o \
- cf-m68klynx.o \
- cf-sparclynx.o \
- coff-a29k.o \
- coff-apollo.o \
- coff-arm.o \
- coff-aux.o \
- coff-h8300.o \
- coff-h8500.o \
- coff-i386.o \
- coff-go32.o \
- coff-i860.o \
- coff-i960.o \
- coff-m68k.o \
- coff-m88k.o \
- coff-mips.o \
- coff-pmac.o \
- coff-rs6000.o \
- coff-sh.o \
- coff-sparc.o \
- coff-svm68k.o \
- coff-u68k.o \
- coff-we32k.o \
- coff-w65.o \
- coff-z8k.o \
- cofflink.o \
- ecoff.o \
- ecofflink.o \
- elf32-d10v.o \
- elf32-gen.o \
- elf32-hppa.o \
- elf32-i386.o \
- elf32-i860.o \
- elf32-m32r.o \
- elf32-m68k.o \
- elf32-m88k.o \
- elf32-mips.o \
- elf-m10200.o \
- elf-m10300.o \
- elf32-ppc.o \
- elf32-sh.o \
- elf32-sparc.o \
- elf32.o \
- elflink.o \
- hp300bsd.o \
- hp300hpux.o \
- som.o \
- i386aout.o \
- i386bsd.o \
- i386dynix.o \
- i386freebsd.o \
- i386linux.o \
- i386lynx.o \
- i386msdos.o \
- i386netbsd.o \
- i386mach3.o \
- i386os9k.o \
- ieee.o \
- m68k4knetbsd.o \
- m68klinux.o \
- m68klynx.o \
- m68knetbsd.o \
- m88kmach3.o \
- mipsbsd.o \
- newsos3.o \
- nlm.o \
- nlm32-i386.o \
- nlm32-sparc.o \
- nlm32-ppc.o \
- nlm32.o \
- ns32knetbsd.o \
- oasys.o \
- pc532-mach.o \
- pe-arm.o \
- pei-arm.o \
- pe-i386.o \
- pei-i386.o \
- pe-ppc.o \
- pei-ppc.o \
- ppcboot.o \
- reloc16.o \
- riscix.o \
- sparclinux.o \
- sparclynx.o \
- sparcnetbsd.o \
- sunos.o \
- tekhex.o \
- versados.o \
- xcofflink.o
+ aout-adobe.lo \
+ aout-arm.lo \
+ aout-ns32k.lo \
+ aout-sparcle.lo \
+ aout-tic30.lo \
+ aout0.lo \
+ aout32.lo \
+ bout.lo \
+ cf-i386lynx.lo \
+ cf-m68klynx.lo \
+ cf-sparclynx.lo \
+ coff-a29k.lo \
+ coff-apollo.lo \
+ coff-arm.lo \
+ coff-aux.lo \
+ coff-h8300.lo \
+ coff-h8500.lo \
+ coff-i386.lo \
+ coff-go32.lo \
+ coff-i860.lo \
+ coff-i960.lo \
+ coff-m68k.lo \
+ coff-m88k.lo \
+ coff-mips.lo \
+ coff-pmac.lo \
+ coff-rs6000.lo \
+ coff-sh.lo \
+ coff-sparc.lo \
+ coff-stgo32.lo \
+ coff-svm68k.lo \
+ coff-tic30.lo \
+ coff-u68k.lo \
+ coff-we32k.lo \
+ coff-w65.lo \
+ coff-z8k.lo \
+ cofflink.lo \
+ dwarf2.lo \
+ ecoff.lo \
+ ecofflink.lo \
+ elf.lo \
+ elf32-arc.lo \
+ elf32-d10v.lo \
+ elf32-gen.lo \
+ elf32-hppa.lo \
+ elf32-i386.lo \
+ elf32-i860.lo \
+ elf32-m32r.lo \
+ elf32-m68k.lo \
+ elf32-m88k.lo \
+ elf32-mips.lo \
+ elf-m10200.lo \
+ elf-m10300.lo \
+ elf32-ppc.lo \
+ elf32-sh.lo \
+ elf32-sparc.lo \
+ elf32-v850.lo \
+ elf32.lo \
+ elflink.lo \
+ hp300bsd.lo \
+ hp300hpux.lo \
+ som.lo \
+ i386aout.lo \
+ i386bsd.lo \
+ i386dynix.lo \
+ i386freebsd.lo \
+ i386linux.lo \
+ i386lynx.lo \
+ i386msdos.lo \
+ i386netbsd.lo \
+ i386mach3.lo \
+ i386os9k.lo \
+ ieee.lo \
+ m68k4knetbsd.lo \
+ m68klinux.lo \
+ m68klynx.lo \
+ m68knetbsd.lo \
+ m88kmach3.lo \
+ mipsbsd.lo \
+ newsos3.lo \
+ nlm.lo \
+ nlm32-i386.lo \
+ nlm32-sparc.lo \
+ nlm32-ppc.lo \
+ nlm32.lo \
+ ns32knetbsd.lo \
+ oasys.lo \
+ pc532-mach.lo \
+ pe-arm.lo \
+ pei-arm.lo \
+ pe-i386.lo \
+ pei-i386.lo \
+ pe-ppc.lo \
+ pei-ppc.lo \
+ ppcboot.lo \
+ reloc16.lo \
+ riscix.lo \
+ sparclinux.lo \
+ sparclynx.lo \
+ sparcnetbsd.lo \
+ sunos.lo \
+ vaxnetbsd.lo \
+ versados.lo \
+ xcofflink.lo
BFD32_BACKENDS_CFILES = \
aout-adobe.c \
aout-arm.c \
aout-ns32k.c \
aout-sparcle.c \
+ aout-tic30.c \
aout0.c \
aout32.c \
bout.c \
@@ -291,14 +320,20 @@ BFD32_BACKENDS_CFILES = \
coff-rs6000.c \
coff-sh.c \
coff-sparc.c \
+ coff-stgo32.c \
coff-svm68k.c \
+ coff-tic30.c \
coff-u68k.c \
coff-we32k.c \
coff-w65.c \
coff-z8k.c \
cofflink.c \
+ dwarf2.c \
ecoff.c \
ecofflink.c \
+ elf.c \
+ elf32-arc.c \
+ elf32-d10v.c \
elf32-gen.c \
elf32-hppa.c \
elf32-i386.c \
@@ -312,6 +347,7 @@ BFD32_BACKENDS_CFILES = \
elf32-ppc.c \
elf32-sh.c \
elf32-sparc.c \
+ elf32-v850.c \
elf32.c \
elflink.c \
hp300bsd.c \
@@ -356,7 +392,7 @@ BFD32_BACKENDS_CFILES = \
sparclynx.c \
sparcnetbsd.c \
sunos.c \
- tekhex.c \
+ vaxnetbsd.c \
versados.c \
xcofflink.c
@@ -364,21 +400,21 @@ BFD32_BACKENDS_CFILES = \
# target_vector in targets.c if configured with --enable-targets=all
# and --enable-64-bit-bfd.
BFD64_BACKENDS = \
- aout64.o \
- coff-alpha.o \
- demo64.o \
- elf64-alpha.o \
- elf64-gen.o \
- elf64-mips.o \
- elf64-sparc.o \
- elf64.o \
- evax-alpha.o \
- evax-egsd.o \
- evax-etir.o \
- evax-emh.o \
- evax-misc.o \
- nlm32-alpha.o \
- nlm64.o
+ aout64.lo \
+ coff-alpha.lo \
+ demo64.lo \
+ elf64-alpha.lo \
+ elf64-gen.lo \
+ elf64-mips.lo \
+ elf64-sparc.lo \
+ elf64.lo \
+ evax-alpha.lo \
+ evax-egsd.lo \
+ evax-etir.lo \
+ evax-emh.lo \
+ evax-misc.lo \
+ nlm32-alpha.lo \
+ nlm64.lo
BFD64_BACKENDS_CFILES = \
aout64.c \
@@ -398,13 +434,13 @@ BFD64_BACKENDS_CFILES = \
nlm64.c
OPTIONAL_BACKENDS = \
- aix386-core.o \
- hpux-core.o \
- irix-core.o \
- lynx-core.o \
- osf-core.o \
- trad-core.o \
- cisco-core.o
+ aix386-core.lo \
+ hpux-core.lo \
+ irix-core.lo \
+ lynx-core.lo \
+ osf-core.lo \
+ trad-core.lo \
+ cisco-core.lo
OPTIONAL_BACKENDS_CFILES = \
aix386-core.c \
@@ -422,35 +458,7 @@ BFD_BACKENDS = @bfd_backends@
BFD_MACHINES = @bfd_machines@
TDEFAULTS = @tdefaults@
-all:
-
-FLAGS_TO_PASS = \
- "prefix=$(prefix)" \
- "exec_prefix=$(exec_prefix)" \
- "against=$(against)" \
- "AR=$(AR)" \
- "AR_FLAGS=$(AR_FLAGS)" \
- "CC=$(CC)" \
- "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
- "CFLAGS=$(CFLAGS)" \
- "RANLIB=$(RANLIB)" \
- "MAKEINFO=$(MAKEINFO)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
-
-ALL_CFLAGS=-D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) $(CFLAGS)
-.c.o:
- if [ -n "$(PICFLAG)" ]; then \
- $(CC) -c $(PICFLAG) $(ALL_CFLAGS) $< -o pic/$@; \
- else true; fi
- $(CC) -c $(ALL_CFLAGS) $<
-
-bfd_libs_here =
-all_machines_here =
-bfd32_backends_here =
-core_files_here =
-configs_not_included_in_all_targets_option_here =
+INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES)
# C source files that correspond to .o's.
CFILES = \
@@ -463,41 +471,415 @@ CFILES = \
HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
- elfcode.h evax.h genlink.h hppa_stubs.h libaout.h libbfd.h \
- libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h libnlm.h \
- liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
+ elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+ libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
+ libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
targmatch.h
-all: Makefile $(ALLLIBS) @PICLIST@
- @$(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
+# Various kinds of .o files to put in libbfd.a:
+# BFD_BACKENDS Routines the configured targets need.
+# BFD_MACHINES Architecture-specific routines the configured targets need.
+# COREFILE Core file routines for a native configuration
+OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
+
+libbfd_la_SOURCES = $(BFD_LIBS_CFILES)
+libbfd_la_DEPENDENCIES = $(OFILES) ofiles
+libbfd_la_LIBADD = `cat ofiles`
+libbfd_la_LDFLAGS = -release $(VERSION)
-.NOEXPORT:
-MAKEOVERRIDES=
+# libtool will build .libs/libbfd.a. We create libbfd.a in the build
+# directory so that we don't have to convert all the programs that use
+# libbfd.a simultaneously. This is a hack which should be removed if
+# everything else starts using libtool. FIXME.
+
+noinst_LIBRARIES = libbfd.a
+libbfd_a_SOURCES =
+
+BFD_H_DEPS= $(INCDIR)/ansidecl.h
+LOCAL_H_DEPS= libbfd.h sysdep.h config.h
+
+BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
+ reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c
+LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c
+LIBCOFF_H_FILES = libcoff-in.h coffcode.h
+
+MOSTLYCLEANFILES = elf32-target.h elf64-target.h ofiles stamp-ofiles \
+ targmatch.h
+
+CLEANFILES = bfd.h dep.sed stmp-bfd-h .dep .dep1 libbfd.a stamp-lib \
+ stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = bfd-in3.h
+LIBRARIES = $(noinst_LIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I.
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+libbfd_a_LIBADD =
+libbfd_a_OBJECTS =
+LTLIBRARIES = $(lib_LTLIBRARIES)
+
+libbfd_la_OBJECTS = archive.lo archures.lo bfd.lo cache.lo coffgen.lo \
+corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo \
+syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo \
+ihex.lo stabs.lo stab-syms.lo
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in TODO \
+acconfig.h acinclude.m4 aclocal.m4 bfd-in2.h config.in configure \
+configure.in stamp-h.in
-.PHONY: check installcheck
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP = --best
+SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
+OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
+
+default: all
+
+.SUFFIXES:
+.SUFFIXES: .S .c .lo .o .s
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINT@ configure.in acinclude.m4
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+ @:
+stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h
+$(srcdir)/config.in: @MAINT@$(srcdir)/stamp-h.in
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f config.h
+
+maintainer-clean-hdr:
+bfd-in3.h: $(top_builddir)/config.status bfd-in2.h
+ cd $(top_builddir) && CONFIG_FILES=$@:bfd-in2.h CONFIG_HEADERS= ./config.status
+
+mostlyclean-noinstLIBRARIES:
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+distclean-noinstLIBRARIES:
+
+maintainer-clean-noinstLIBRARIES:
+
+.c.o:
+ $(COMPILE) -c $<
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.c.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+mostlyclean-libLTLIBRARIES:
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+
+distclean-libLTLIBRARIES:
+
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(libdir)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo "$(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ $(NORMAL_UNINSTALL)
+ list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$$p; \
+ done
+
+libbfd.la: $(libbfd_la_OBJECTS) $(libbfd_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(libbfd_la_LDFLAGS) $(libbfd_la_OBJECTS) $(libbfd_la_LIBADD) $(LIBS)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ target=`echo $@ | sed s/-recursive//`; \
+ echo "Making $$target in $$subdir"; \
+ (cd $$subdir && $(MAKE) $$target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ done; \
+ for subdir in $$rev; do \
+ target=`echo $@ | sed s/-recursive//`; \
+ echo "Making $$target in $$subdir"; \
+ (cd $$subdir && $(MAKE) $$target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ (cd $$subdir && $(MAKE) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) \
+ && $(MAKE) dvi \
+ && $(MAKE) check \
+ && $(MAKE) install \
+ && $(MAKE) installcheck \
+ && $(MAKE) dist
+ -rm -rf $(distdir)
+ @echo "========================"; \
+ echo "$(distdir).tar.gz is ready for distribution"; \
+ echo "========================"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done
+ for subdir in $(SUBDIRS); do \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ done
+info: info-recursive
+dvi: dvi-recursive
check:
- @echo No testsuites exist for the BFD library. Nothing to check.
+ $(MAKE) check-recursive
+installcheck: installcheck-recursive
+install-info: install-info-recursive
+all-recursive-am: config.h
+ $(MAKE) all-recursive
-installcheck:
- @echo No testsuites exist for the BFD library. Nothing to check.
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
-info dvi : force
- @$(MAKE) subdir_do DO=$@ "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
+install-exec-am: install-libLTLIBRARIES
-clean-info:
- @$(MAKE) subdir_do DO=clean-info "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
+install-data-am: install-data-local
-install-info: force
- @$(MAKE) subdir_do DO=install-info "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
+uninstall-am: uninstall-libLTLIBRARIES
-diststuff: info
+install-exec: install-exec-recursive install-exec-am
+ @$(NORMAL_INSTALL)
-# Various kinds of .o files to put in libbfd.a:
-# BFD_LIBS Generic routines, always needed.
-# BFD_BACKENDS Routines the configured targets need.
-# BFD_MACHINES Architecture-specific routines the configured targets need.
-# COREFILE Core file routines for a native configuration
-OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
+install-data: install-data-recursive install-data-am
+ @$(NORMAL_INSTALL)
+
+install: install-recursive install-exec-am install-data-am
+ @:
+
+uninstall: uninstall-recursive uninstall-am
+
+all: all-recursive-am all-am
+
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs: installdirs-recursive
+ $(mkinstalldirs) $(libdir)
+
+
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean-am: mostlyclean-hdr mostlyclean-noinstLIBRARIES \
+ mostlyclean-compile mostlyclean-libtool \
+ mostlyclean-libLTLIBRARIES mostlyclean-tags \
+ mostlyclean-generic
+
+clean-am: clean-hdr clean-noinstLIBRARIES clean-compile clean-libtool \
+ clean-libLTLIBRARIES clean-tags clean-generic \
+ mostlyclean-am
+
+distclean-am: distclean-hdr distclean-noinstLIBRARIES distclean-compile \
+ distclean-libtool distclean-libLTLIBRARIES \
+ distclean-tags distclean-generic clean-am
+
+maintainer-clean-am: maintainer-clean-hdr \
+ maintainer-clean-noinstLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-libLTLIBRARIES maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
+
+mostlyclean: mostlyclean-recursive mostlyclean-am
+
+clean: clean-recursive clean-am
+
+distclean: distclean-recursive distclean-am
+ -rm -f config.status
+ -rm -f libtool
+
+maintainer-clean: maintainer-clean-recursive maintainer-clean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f config.status
+
+.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
+maintainer-clean-hdr mostlyclean-noinstLIBRARIES \
+distclean-noinstLIBRARIES clean-noinstLIBRARIES \
+maintainer-clean-noinstLIBRARIES mostlyclean-compile distclean-compile \
+clean-compile maintainer-clean-compile mostlyclean-libtool \
+distclean-libtool clean-libtool maintainer-clean-libtool \
+mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
+installcheck install-info all-recursive-am all-am install-exec-am \
+install-data-am uninstall-am install-exec install-data install \
+uninstall all installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
+
+
+diststuff: info
stamp-ofiles: Makefile
rm -f tofiles
@@ -514,48 +896,14 @@ stamp-ofiles: Makefile
ofiles: stamp-ofiles ; @true
-$(TARGETLIB): $(OFILES) ofiles
- rm -f $(TARGETLIB)
- @echo ofiles = `cat ofiles`
- $(AR) $(AR_FLAGS) $(TARGETLIB) `cat ofiles`
- $(RANLIB) $(TARGETLIB)
-
-stamp-piclist: ofiles
- rm -f tpiclist
- if [ -n "$(PICFLAG)" ]; then \
- sed -e 's,\([^ ][^ ]*\),pic/\1,g' ofiles > tpiclist; \
- else \
- cp ofiles tpiclist; \
- fi
- $(SHELL) $(srcdir)/../move-if-change tpiclist piclist
- touch stamp-piclist
-
-piclist: stamp-piclist ; @true
-
-$(SHLIB): stamp-picdir $(OFILES) piclist
- rm -f $(SHLIB)
- $(SHLIB_CC) $(SHLIB_CFLAGS) -o $(SHLIB) `cat piclist` $(SHLIB_LIBS)
-
-# We make a link from libbfd.so to libbfd.so.VERSION for linking, and
-# also a link from libTARGET-bfd.so.VERSION for running.
-$(SHLINK): $(SHLIB)
- ts=lib`echo $(SHLIB) | sed -e 's/^lib//' | sed -e '$(program_transform_name)'`; \
- if [ "$$ts" != "$(SHLIB)" ]; then \
- rm -f $$ts; \
- ln -s $(SHLIB) $$ts; \
- else true; fi
- rm -f $(SHLINK)
- ln -s $(SHLIB) $(SHLINK)
-
-# This target creates libTARGET-bfd.so.VERSION as a symlink to
-# libbfd.so.VERSION. It is used on SunOS, which does not have SONAME.
-stamp-tshlink: $(SHLIB)
- tf=lib`echo $(SHLIB) | sed -e 's/^lib//' | sed '$(program_transform_name)'`; \
- if [ "$$tf" != "$(SHLIB)" ]; then \
- rm -f $$tf; \
- ln -s $(SHLIB) $$tf; \
+stamp-lib: libbfd.la
+ if [ -f .libs/libbfd.a ]; then \
+ cp .libs/libbfd.a libbfd.tmp; \
+ $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
else true; fi
- touch stamp-tshlink
+ touch stamp-lib
+
+libbfd.a: stamp-lib ; @true
# This file holds an array associating configuration triplets and
# vector names. It is built from config.bfd. It is not compiled by
@@ -568,17 +916,11 @@ targmatch.h: config.bfd targmatch.sed
# When compiling archures.c and targets.c, supply the default target
# info from configure.
-targets.o: targets.c Makefile
- if [ -n "$(PICFLAG)" ]; then \
- $(CC) -c $(PICFLAG) $(TDEFAULTS) $(ALL_CFLAGS) $(srcdir)/targets.c -o pic/targets.o; \
- else true; fi
- $(CC) -c $(TDEFAULTS) $(ALL_CFLAGS) $(srcdir)/targets.c
+targets.lo: targets.c config.status
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/targets.c
-archures.o: archures.c Makefile
- if [ -n "$(PICFLAG)" ]; then \
- $(CC) -c $(PICFLAG) $(TDEFAULTS) $(ALL_CFLAGS) $(srcdir)/archures.c -o pic/archures.o; \
- else true; fi
- $(CC) -c $(TDEFAULTS) $(ALL_CFLAGS) $(srcdir)/archures.c
+archures.lo: archures.c config.status
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c
elf32-target.h : elfxx-target.h
rm -f elf32-target.h
@@ -589,152 +931,16 @@ elf64-target.h : elfxx-target.h
rm -f elf64-target.h
sed -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new
mv -f elf64-target.new elf64-target.h
-
-subdir_do: force
- @for i in $(DODIRS); do \
- if [ -d ./$$i ] ; then \
- if (cd ./$$i; \
- $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
- else exit 1 ; fi ; \
- else true ; fi ; \
- done
-
-tags etags: TAGS
-
-TAGS: force
- etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
-
-do_mostlyclean:
- rm -f *.o *~ core *.E *.p *.ip aout-params.h gen-aout pic/*.o
-do_clean: do_mostlyclean
- rm -f libbfd.a TAGS bfd.h stmp-bfd.h bfd-tmp.h ofiles stamp-ofiles \
- elf32-target.h elf64-target.h $(SHLIB) $(SHLINK) \
- piclist stamp-piclist targmatch.h
-do_distclean: do_clean
- rm -f Makefile config.status config.cache config.h config.log \
- stamp-h bfd-in3.h
- rm -rf pic stamp-picdir
-
-# do_maintainer_clean really should remove bfd-in2.h, since it is a
-# generated file. However, the GNU standards say that
-# maintainer-clean should not delete anything which needs to exist in
-# order to run configure, and bfd-in2.h is used by configure.
-do_maintainer_clean: do_distclean
- rm -f $(srcdir)/libbfd.h $(srcdir)/libcoff.h
-
-mostlyclean: do_mostlyclean
- $(MAKE) subdir_do DO=mostlyclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
-clean: do_clean
- $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
-distclean:
- $(MAKE) subdir_do DO=distclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
- $(MAKE) do_distclean
-clobber maintainer-clean realclean:
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- $(MAKE) subdir_do DO=maintainer-clean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
- $(MAKE) do_maintainer_clean
-
-BFD_H_DEPS= $(INCDIR)/ansidecl.h
-LOCAL_H_DEPS= libbfd.h sysdep.h config.h
$(BFD_LIBS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
$(BFD_MACHINES): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
$(BFD_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
$(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
-# Get around a Sun Make bug in SunOS 4.1.1 with VPATH
-cpu-i386.o:cpu-i386.c
-cpu-z8k.o: cpu-z8k.c
-cpu-h8500.o: cpu-h8500.c
-cpu-we32k.o: cpu-we32k.c
-
-saber:
- #suppress 65 on bfd_map_over_sections
- #suppress 66 on bfd_map_over_sections
- #suppress 67 on bfd_map_over_sections
- #suppress 68 on bfd_map_over_sections
- #suppress 69 on bfd_map_over_sections
- #suppress 70 on bfd_map_over_sections
- #suppress 110 in bfd_map_over_sections
- #suppress 112 in bfd_map_over_sections
- #suppress 530
- #suppress 590 in swap_exec_header
- #suppress 590 in _bfd_dummy_core_file_matches_executable_p
- #suppress 590 in bfd_dont_truncate_arname
- #suppress 590 on ignore
- #suppress 590 on abfd
- #setopt load_flags $(CFLAGS)
- #load $(CFILES)
-
-
-#-----------------------------------------------------------------------------
-# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
-#
-# 'VERSION' file must be present and contain a string of the form "x.y"
-#-----------------------------------------------------------------------------
-
-ver960.c: FORCE
- rm -f ver960.c
- echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
-
-
-# This target should be invoked before building a new release.
-# 'VERSION' file must be present and contain a string of the form "x.y"
-#
-roll:
- @V=`cat VERSION` ; \
- MAJ=`sed 's/\..*//' VERSION` ; \
- MIN=`sed 's/.*\.//' VERSION` ; \
- V=$$MAJ.`expr $$MIN + 1` ; \
- rm -f VERSION ; \
- echo $$V >VERSION ; \
- echo Version $$V
-
-# Dummy target to force execution of dependent targets.
-#
-force:
-
-install: $(ALLLIBS)
- for f in $(ALLLIBS); do \
- if [ "$$f" = "stamp-tshlink" ]; then \
- continue; \
- fi; \
- tf=lib`echo $$f | sed -e 's/^lib//' | sed '$(program_transform_name)'`; \
- rm -f $(libdir)/$$tf; \
- if [ "$$f" = "$(SHLINK)" ]; then \
- ts=lib`echo $(SHLIB) | sed -e 's/^lib//' | sed '$(program_transform_name)'`; \
- ln -s $$ts $(libdir)/$$tf; \
- elif [ "$$f" = "$(SHLIB)" ]; then \
- @INSTALL_SHLIB@ \
- else \
- $(INSTALL_DATA) $$f $(libdir)/$$tf; \
- $(RANLIB) $(libdir)/$$tf; \
- chmod a-x $(libdir)/$$tf; \
- fi; \
- done
-# Install BFD include file, and others that it needs. Install them
-# both in GCC's include directory, and in the system include dir
-# if configured as $(oldincludedir) -- which it usually isnt.
+# Install BFD include file, and others that it needs.
+install-data-local: $(BFD_H)
$(INSTALL_DATA) $(BFD_H) $(includedir)/bfd.h
$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(includedir)/ansidecl.h
$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(includedir)/bfdlink.h
- -if test -z "$(oldincludedir)"; then true; else \
- test -d $(oldincludedir) || mkdir $(oldincludedir); \
- $(INSTALL_DATA) $(BFD_H) $(oldincludedir)/bfd.h; \
- $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(oldincludedir)/ansidecl.h; \
- $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(oldincludedir)/bfdlink.h; \
- fi
- $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
-
-Makefile: Makefile.in config.status
- CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
-
-config.h: stamp-h ; @true
-stamp-h: config.in config.status
- CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
-
-config.status: configure configure.host config.bfd VERSION
- $(SHELL) config.status --recheck
# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
.dep: dep.sed $(CFILES) $(HFILES) bfd.h
@@ -751,7 +957,7 @@ config.status: configure configure.host config.bfd VERSION
rm -f .dep2 .dep2a
echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
echo > .dep2a
- $(DEP) -f .dep2a $(ALL_CFLAGS) $?
+ $(DEP) -f .dep2a $(INCLUDES) $(CFLAGS) $?
sed -e '/DO NOT DELETE/d' -e '/^$$/d' < .dep2a >> .dep2
rm -f .dep2a
$(SHELL) $(srcdir)/../move-if-change .dep2 .dep1
@@ -772,7 +978,12 @@ dep-in: .dep
cat .dep >> tmp-Makefile.in
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
-host-aout.o: Makefile
+dep-am: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
+ cat .dep >> tmp-Makefile.am
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
+
+host-aout.lo: Makefile
# The following program can be used to generate a simple config file
# which can be folded into an h-XXX file for a new host, with some editing.
@@ -781,19 +992,14 @@ aout-params.h: gen-aout
gen-aout: $(srcdir)/gen-aout.c Makefile
$(CC) -o gen-aout $(CFLAGS) $(LFLAGS) $(srcdir)/gen-aout.c
-BFDIN_H= $(srcdir)/bfd-in2.h
-
-$(BFD_H): stmp-bfd.h ; @true
+$(BFD_H): stmp-bfd-h ; @true
-stmp-bfd.h: bfd-in3.h
+stmp-bfd-h: bfd-in3.h
rm -f bfd-tmp.h
cp bfd-in3.h bfd-tmp.h
$(SHELL) $(srcdir)/../move-if-change bfd-tmp.h $(BFD_H)
rm -f bfd-tmp.h
- touch stmp-bfd.h
-
-bfd-in3.h: bfd-in2.h config.status
- CONFIG_FILES=bfd-in3.h:bfd-in2.h CONFIG_HEADERS= $(SHELL) ./config.status
+ touch stmp-bfd-h
# Could really use a "copy-if-change"...
headers:
@@ -805,409 +1011,428 @@ headers:
cp $(docdir)/libcoff.h libcoff.h-new
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
-# The rules for the generated header files are here so that people can
-# type `make bfd-in2.h' if they remove it. They are not run by default.
-$(srcdir)/bfd-in2.h:
- (cd $(docdir); $(MAKE) bfd.h $(FLAGS_TO_PASS))
+# We only rebuild the header files automatically if we have been
+# configured with --enable-maintainer-mode.
+
+$(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
+stmp-bin2-h: $(BFD_H_FILES)
+ (cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) bfd.h)
cp $(docdir)/bfd.h bfd-in2.h-new
$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
-$(srcdir)/libbfd.h:
- (cd $(docdir); $(MAKE) libbfd.h $(FLAGS_TO_PASS))
+ touch stmp-bin2-h
+
+$(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
+stmp-lbfd-h: $(LIBBFD_H_FILES)
+ (cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libbfd.h)
cp $(docdir)/libbfd.h libbfd.h-new
$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
-$(srcdir)/libcoff.h:
- (cd $(docdir); $(MAKE) libcoff.h $(FLAGS_TO_PASS))
+ touch stmp-lbfd-h
+
+$(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
+stmp-lcoff-h: $(LIBCOFF_H_FILES)
+ (cd $(docdir); $(MAKE) $(FLAGS_TO_PASS) libcoff.h)
cp $(docdir)/libcoff.h libcoff.h-new
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
-
-bfd.info:
- (cd $(docdir); $(MAKE) bfd.info $(FLAGS_TO_PASS))
-
-bfd.dvi:
- (cd $(docdir); $(MAKE) bfd.dvi $(FLAGS_TO_PASS))
-
-bfd.ps:
- (cd $(docdir); $(MAKE) bfd.ps $(FLAGS_TO_PASS))
-
-
-elf32-d10v.o: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
- elf32-target.h
-
-
-
-
-$(OFILES): stamp-picdir
-
-stamp-picdir:
- if [ -n "$(PICFLAG)" ] && [ ! -d pic ]; then \
- mkdir pic; \
- else true; fi
- touch stamp-picdir
+ touch stmp-lcoff-h
# What appears below is generated by a hacked mkdep using gcc -MM.
# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-archive.o: archive.c $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h
-archures.o: archures.c
-bfd.o: bfd.c $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h \
+archive.lo: archive.c $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h
+archures.lo: archures.c
+bfd.lo: bfd.c $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \
libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
-cache.o: cache.c
-coffgen.o: coffgen.c $(INCDIR)/coff/internal.h libcoff.h \
+cache.lo: cache.c
+coffgen.lo: coffgen.c $(INCDIR)/coff/internal.h libcoff.h \
$(INCDIR)/bfdlink.h
-corefile.o: corefile.c
-format.o: format.c
-init.o: init.c
-libbfd.o: libbfd.c
-opncls.o: opncls.c $(INCDIR)/objalloc.h
-reloc.o: reloc.c $(INCDIR)/bfdlink.h
-section.o: section.c
-syms.o: syms.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h \
+corefile.lo: corefile.c
+format.lo: format.c
+init.lo: init.c
+libbfd.lo: libbfd.c
+opncls.lo: opncls.c $(INCDIR)/objalloc.h
+reloc.lo: reloc.c $(INCDIR)/bfdlink.h
+section.lo: section.c
+syms.lo: syms.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def
-targets.o: targets.c $(INCDIR)/fnmatch.h targmatch.h
-hash.o: hash.c $(INCDIR)/objalloc.h
-linker.o: linker.c $(INCDIR)/bfdlink.h genlink.h
-elf.o: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
-srec.o: srec.c $(INCDIR)/libiberty.h
-binary.o: binary.c
-tekhex.o: tekhex.c $(INCDIR)/libiberty.h
-ihex.o: ihex.c $(INCDIR)/libiberty.h
-stabs.o: stabs.c $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
-stab-syms.o: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \
+targets.lo: targets.c $(INCDIR)/fnmatch.h targmatch.h
+hash.lo: hash.c $(INCDIR)/objalloc.h
+linker.lo: linker.c $(INCDIR)/bfdlink.h genlink.h
+srec.lo: srec.c $(INCDIR)/libiberty.h
+binary.lo: binary.c
+tekhex.lo: tekhex.c $(INCDIR)/libiberty.h
+ihex.lo: ihex.c $(INCDIR)/libiberty.h
+stabs.lo: stabs.c $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
+stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def
-cpu-a29k.o: cpu-a29k.c
-cpu-alpha.o: cpu-alpha.c
-cpu-arm.o: cpu-arm.c
-cpu-h8300.o: cpu-h8300.c
-cpu-h8500.o: cpu-h8500.c
-cpu-hppa.o: cpu-hppa.c
-cpu-i386.o: cpu-i386.c
-cpu-i860.o: cpu-i860.c
-cpu-i960.o: cpu-i960.c
-cpu-m32r.o: cpu-m32r.c
-cpu-m68k.o: cpu-m68k.c
-cpu-m88k.o: cpu-m88k.c
-cpu-mips.o: cpu-mips.c
-cpu-m10200.o: cpu-m10200.c
-cpu-m10300.o: cpu-m10300.c
-cpu-ns32k.o: cpu-ns32k.c ns32k.h
-cpu-powerpc.o: cpu-powerpc.c
-cpu-rs6000.o: cpu-rs6000.c
-cpu-sh.o: cpu-sh.c
-cpu-sparc.o: cpu-sparc.c
-cpu-vax.o: cpu-vax.c
-cpu-we32k.o: cpu-we32k.c
-cpu-w65.o: cpu-w65.c
-cpu-z8k.o: cpu-z8k.c
-aout-adobe.o: aout-adobe.c $(INCDIR)/aout/adobe.h $(INCDIR)/aout/stab_gnu.h \
- $(INCDIR)/aout/stab.def libaout.h $(INCDIR)/bfdlink.h
-aout-arm.o: aout-arm.c libaout.h $(INCDIR)/bfdlink.h \
+cpu-a29k.lo: cpu-a29k.c
+cpu-alpha.lo: cpu-alpha.c
+cpu-arc.lo: cpu-arc.c
+cpu-arm.lo: cpu-arm.c
+cpu-h8300.lo: cpu-h8300.c
+cpu-h8500.lo: cpu-h8500.c
+cpu-hppa.lo: cpu-hppa.c
+cpu-i386.lo: cpu-i386.c
+cpu-i860.lo: cpu-i860.c
+cpu-i960.lo: cpu-i960.c
+cpu-m32r.lo: cpu-m32r.c
+cpu-m68k.lo: cpu-m68k.c
+cpu-m88k.lo: cpu-m88k.c
+cpu-mips.lo: cpu-mips.c
+cpu-m10200.lo: cpu-m10200.c
+cpu-m10300.lo: cpu-m10300.c
+cpu-ns32k.lo: cpu-ns32k.c ns32k.h
+cpu-powerpc.lo: cpu-powerpc.c
+cpu-rs6000.lo: cpu-rs6000.c
+cpu-sh.lo: cpu-sh.c
+cpu-sparc.lo: cpu-sparc.c
+cpu-tic30.lo: cpu-tic30.c
+cpu-v850.lo: cpu-v850.c
+cpu-vax.lo: cpu-vax.c
+cpu-we32k.lo: cpu-we32k.c
+cpu-w65.lo: cpu-w65.c
+cpu-z8k.lo: cpu-z8k.c
+aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
+ $(INCDIR)/bfdlink.h
+aout-arm.lo: aout-arm.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h aoutx.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
-aout-ns32k.o: aout-ns32k.c $(INCDIR)/aout/aout64.h \
+aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \
ns32k.h libaout.h $(INCDIR)/bfdlink.h
-aout-sparcle.o: aout-sparcle.c $(INCDIR)/bfdlink.h \
+aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \
libaout.h aoutf1.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
aout-target.h
-aout0.o: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \
+aout-tic30.lo: aout-tic30.c libaout.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
+ $(INCDIR)/aout/ar.h aoutx.h
+aout0.lo: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
-aout32.o: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
+aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h
-bout.o: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \
+bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h
-cf-i386lynx.o: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \
+cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-cf-m68klynx.o: cf-m68klynx.c coff-m68k.c $(INCDIR)/coff/m68k.h \
+cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-cf-sparclynx.o: cf-sparclynx.c coff-sparc.c $(INCDIR)/coff/sparc.h \
+cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/coff/sparc.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-coff-a29k.o: coff-a29k.c $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h \
+coff-a29k.lo: coff-a29k.c $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
-coff-apollo.o: coff-apollo.c $(INCDIR)/coff/apollo.h \
+coff-apollo.lo: coff-apollo.c $(INCDIR)/coff/apollo.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-coff-arm.o: coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \
+coff-arm.lo: coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
-coff-aux.o: coff-aux.c $(INCDIR)/coff/aux-coff.h $(INCDIR)/coff/internal.h \
+coff-aux.lo: coff-aux.c $(INCDIR)/coff/aux-coff.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/m68k.h coff-m68k.c libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-coff-h8300.o: coff-h8300.c $(INCDIR)/bfdlink.h genlink.h \
+coff-h8300.lo: coff-h8300.c $(INCDIR)/bfdlink.h genlink.h \
$(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h \
coffcode.h coffswap.h
-coff-h8500.o: coff-h8500.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/h8500.h \
+coff-h8500.lo: coff-h8500.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/h8500.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
-coff-i386.o: coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \
+coff-i386.lo: coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
-coff-i860.o: coff-i860.c $(INCDIR)/coff/i860.h $(INCDIR)/coff/internal.h \
+coff-i860.lo: coff-i860.c $(INCDIR)/coff/i860.h $(INCDIR)/coff/internal.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
-coff-go32.o: coff-go32.c coff-i386.c $(INCDIR)/coff/i386.h \
+coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-coff-i960.o: coff-i960.c $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h \
+coff-i960.lo: coff-i960.c $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
-coff-m68k.o: coff-m68k.c $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h \
+coff-m68k.lo: coff-m68k.c $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
-coff-m88k.o: coff-m88k.c $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h \
+coff-m88k.lo: coff-m88k.c $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
-coff-mips.o: coff-mips.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
+coff-mips.lo: coff-mips.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \
ecoffswap.h
-coff-pmac.o: coff-pmac.c coff-rs6000.c $(INCDIR)/coff/internal.h \
+coff-pmac.lo: coff-pmac.c coff-rs6000.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-coff-rs6000.o: coff-rs6000.c $(INCDIR)/coff/internal.h \
+coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-coff-sh.o: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
+coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
-coff-sparc.o: coff-sparc.c $(INCDIR)/coff/sparc.h $(INCDIR)/coff/internal.h \
- libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
-coff-svm68k.o: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
+coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-coff-u68k.o: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
+coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/coff/i386.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \
+ go32stub.h
+coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
-coff-we32k.o: coff-we32k.c $(INCDIR)/coff/we32k.h $(INCDIR)/coff/internal.h \
- libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h
-coff-w65.o: coff-w65.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/w65.h \
+coff-tic30.lo: coff-tic30.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic30.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
-coff-z8k.o: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \
+coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-we32k.lo: coff-we32k.c $(INCDIR)/coff/we32k.h \
+ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
+ coffcode.h coffswap.h
+coff-w65.lo: coff-w65.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/w65.h \
+ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
+coff-z8k.lo: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
-cofflink.o: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
+cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
libcoff.h
-ecoff.o: ecoff.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/ar.h \
+dwarf2.lo: dwarf2.c $(INCDIR)/libiberty.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
+ecoff.lo: ecoff.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/ar.h \
$(INCDIR)/aout/ranlib.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
libcoff.h libecoff.h
-ecofflink.o: ecofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/objalloc.h \
+ecofflink.lo: ecofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/objalloc.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
libcoff.h libecoff.h
-elf32-gen.o: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
+elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
+elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/arc.h elf32-target.h
+elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
-elf32-hppa.o: elf32-hppa.c $(INCDIR)/bfdlink.h elf-bfd.h \
+elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-target.h
+elf32-hppa.lo: elf32-hppa.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
elf32-hppa.h libhppa.h $(INCDIR)/elf/hppa.h hppa_stubs.h \
elf32-target.h
-elf32-i386.o: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \
+elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
elf32-target.h
-elf32-i860.o: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \
+elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
-elf32-m32r.o: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \
+elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/m32r.h elf32-target.h
-elf32-m68k.o: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \
+elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
elf32-target.h
-elf32-m88k.o: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \
+elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
-elf32-mips.o: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \
+elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \
$(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \
elf32-target.h
-elf-m10200.o: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \
+elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
-elf-m10300.o: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \
+elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
-elf32-ppc.o: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \
+elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/elf/ppc.h elf32-target.h
-elf32-sh.o: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \
+elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
elf32-target.h
-elf32-sparc.o: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \
+elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/elf/sparc.h elf32-target.h
-elf32.o: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
+elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/v850.h elf32-target.h
+elf32.lo: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/fnmatch.h elfcore.h elflink.h
-elflink.o: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \
+elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
-hp300bsd.o: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \
+hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-hp300hpux.o: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \
+hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \
aoutx.h $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
aout-target.h
-som.o: som.c
-i386aout.o: i386aout.c $(INCDIR)/aout/aout64.h libaout.h \
+som.lo: som.c
+i386aout.lo: i386aout.c $(INCDIR)/aout/aout64.h libaout.h \
$(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-i386bsd.o: i386bsd.c libaout.h $(INCDIR)/bfdlink.h \
+i386bsd.lo: i386bsd.c libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-i386dynix.o: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \
+i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
aout-target.h
-i386freebsd.o: i386freebsd.c freebsd.h libaout.h $(INCDIR)/bfdlink.h \
+i386freebsd.lo: i386freebsd.c freebsd.h libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-i386linux.o: i386linux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+i386linux.lo: i386linux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
$(INCDIR)/bfdlink.h aout-target.h
-i386lynx.o: i386lynx.c libaout.h $(INCDIR)/bfdlink.h \
+i386lynx.lo: i386lynx.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-i386msdos.o: i386msdos.c libaout.h $(INCDIR)/bfdlink.h
-i386netbsd.o: i386netbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+i386msdos.lo: i386msdos.c libaout.h $(INCDIR)/bfdlink.h
+i386netbsd.lo: i386netbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-i386mach3.o: i386mach3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+i386mach3.lo: i386mach3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
$(INCDIR)/bfdlink.h aout-target.h
-i386os9k.o: i386os9k.c $(INCDIR)/bfdlink.h libaout.h \
+i386os9k.lo: i386os9k.c $(INCDIR)/bfdlink.h libaout.h \
$(INCDIR)/os9k.h
-ieee.o: ieee.c $(INCDIR)/ieee.h libieee.h
-m68k4knetbsd.o: m68k4knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
- aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
- $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-m68klinux.o: m68klinux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ieee.lo: ieee.c $(INCDIR)/ieee.h libieee.h
+m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h libaout.h \
+ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+m68klinux.lo: m68klinux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
$(INCDIR)/bfdlink.h aout-target.h
-m68klynx.o: m68klynx.c libaout.h $(INCDIR)/bfdlink.h \
+m68klynx.lo: m68klynx.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-m68knetbsd.o: m68knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+m68knetbsd.lo: m68knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-m88kmach3.o: m88kmach3.c libaout.h $(INCDIR)/bfdlink.h \
+m88kmach3.lo: m88kmach3.c libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-mipsbsd.o: mipsbsd.c libaout.h $(INCDIR)/bfdlink.h \
+mipsbsd.lo: mipsbsd.c libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-newsos3.o: newsos3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+newsos3.lo: newsos3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
$(INCDIR)/bfdlink.h aout-target.h
-nlm.o: nlm.c libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
+nlm.lo: nlm.c libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h
-nlm32-i386.o: nlm32-i386.c $(INCDIR)/nlm/i386-ext.h \
+nlm32-i386.lo: nlm32-i386.c $(INCDIR)/nlm/i386-ext.h \
libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
-nlm32-sparc.o: nlm32-sparc.c $(INCDIR)/nlm/sparc32-ext.h \
+nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/nlm/sparc32-ext.h \
libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
-nlm32-ppc.o: nlm32-ppc.c $(INCDIR)/nlm/ppc-ext.h libnlm.h \
+nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/nlm/ppc-ext.h libnlm.h \
$(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \
nlmswap.h nlm-target.h
-nlm32.o: nlm32.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \
+nlm32.lo: nlm32.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h
-ns32knetbsd.o: ns32knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+ns32knetbsd.lo: ns32knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-oasys.o: oasys.c $(INCDIR)/oasys.h liboasys.h
-pc532-mach.o: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \
+oasys.lo: oasys.c $(INCDIR)/oasys.h liboasys.h
+pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-pe-arm.o: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
+pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
-pei-arm.o: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
+pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
-pe-i386.o: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
+pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
-pei-i386.o: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
+pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
-pe-ppc.o: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
+pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
-pei-ppc.o: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
+pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
-ppcboot.o: ppcboot.c
-reloc16.o: reloc16.c $(INCDIR)/bfdlink.h genlink.h \
+ppcboot.lo: ppcboot.c
+reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \
$(INCDIR)/coff/internal.h libcoff.h
-riscix.o: riscix.c libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+riscix.lo: riscix.c libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
aout-target.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h
-sparclinux.o: sparclinux.c $(INCDIR)/aout/aout64.h \
+sparclinux.lo: sparclinux.c $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
libaout.h $(INCDIR)/bfdlink.h aout-target.h
-sparclynx.o: sparclynx.c $(INCDIR)/aout/sun4.h libaout.h \
+sparclynx.lo: sparclynx.c $(INCDIR)/aout/sun4.h libaout.h \
$(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
-sparcnetbsd.o: sparcnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+sparcnetbsd.lo: sparcnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
-sunos.o: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \
+sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \
$(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
-versados.o: versados.c $(INCDIR)/libiberty.h
-xcofflink.o: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
+vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
+versados.lo: versados.c $(INCDIR)/libiberty.h
+xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
libcoff.h
-aout64.o: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
+aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h
-coff-alpha.o: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
+coff-alpha.lo: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \
libecoff.h coffswap.h ecoffswap.h
-demo64.o: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
- $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h
-elf64-alpha.o: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \
+demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \
+ libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \
+ aout-target.h
+elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/alpha.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
$(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \
$(INCDIR)/aout/ar.h libcoff.h libecoff.h ecoffswap.h \
elf64-target.h
-elf64-gen.o: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
+elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf64-target.h
-elf64-mips.o: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \
+elf64-mips.lo: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \
genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \
$(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \
elf64-target.h
-elf64-sparc.o: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \
+elf64-sparc.lo: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
$(INCDIR)/elf/sparc.h elf64-target.h
-elf64.o: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
+elf64.lo: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/fnmatch.h elfcore.h elflink.h
-evax-alpha.o: evax-alpha.c $(INCDIR)/bfdlink.h evax.h
-evax-egsd.o: evax-egsd.c $(INCDIR)/bfdlink.h evax.h
-evax-etir.o: evax-etir.c $(INCDIR)/bfdlink.h evax.h
-evax-emh.o: evax-emh.c $(INCDIR)/bfdlink.h evax.h
-evax-misc.o: evax-misc.c $(INCDIR)/bfdlink.h evax.h
-nlm32-alpha.o: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \
+evax-alpha.lo: evax-alpha.c $(INCDIR)/bfdlink.h evax.h
+evax-egsd.lo: evax-egsd.c $(INCDIR)/bfdlink.h evax.h
+evax-etir.lo: evax-etir.c $(INCDIR)/bfdlink.h evax.h
+evax-emh.lo: evax-emh.c $(INCDIR)/bfdlink.h evax.h
+evax-misc.lo: evax-misc.c $(INCDIR)/bfdlink.h evax.h
+nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \
libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
-nlm64.o: nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \
+nlm64.lo: nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h
-aix386-core.o: aix386-core.c $(INCDIR)/coff/i386.h \
+aix386-core.lo: aix386-core.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h
-hpux-core.o: hpux-core.c
-irix-core.o: irix-core.c
-lynx-core.o: lynx-core.c
-osf-core.o: osf-core.c
-trad-core.o: trad-core.c libaout.h $(INCDIR)/bfdlink.h
-cisco-core.o: cisco-core.c
+hpux-core.lo: hpux-core.c
+irix-core.lo: irix-core.c
+lynx-core.lo: lynx-core.c
+osf-core.lo: osf-core.c
+trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h
+cisco-core.lo: cisco-core.c
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/binutils/bfd/README b/contrib/binutils/bfd/README
index 0daf3af..a9232bc 100644
--- a/contrib/binutils/bfd/README
+++ b/contrib/binutils/bfd/README
@@ -27,13 +27,11 @@ BFD supports the following configure options:
bit integer type, such as gcc.
--enable-shared
Build BFD as a shared library.
- --enable-commonbfdlib
- Build BFD, opcodes, and libiberty as a single shared library.
--with-mmap
Use mmap when accessing files. This is faster on some hosts,
but slower on others. It may not work on all hosts.
-Report bugs with BFD to bug-gnu-utils@prep.ai.mit.edu.
+Report bugs with BFD to bug-gnu-utils@gnu.org.
Patches are encouraged. When sending patches, always send the output
of diff -u or diff -c from the original file to the new file. Do not
diff --git a/contrib/binutils/bfd/acconfig.h b/contrib/binutils/bfd/acconfig.h
index f3c4e99..1d5e819 100644
--- a/contrib/binutils/bfd/acconfig.h
+++ b/contrib/binutils/bfd/acconfig.h
@@ -1,4 +1,10 @@
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
+
/* Whether strstr must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSTR
diff --git a/contrib/binutils/bfd/acinclude.m4 b/contrib/binutils/bfd/acinclude.m4
new file mode 100644
index 0000000..6bd25ab
--- /dev/null
+++ b/contrib/binutils/bfd/acinclude.m4
@@ -0,0 +1,67 @@
+dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
+AC_DEFUN(BFD_BINARY_FOPEN,
+[AC_REQUIRE([AC_CANONICAL_SYSTEM])
+case "${host}" in
+changequote(,)dnl
+i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
+changequote([,])dnl
+ AC_DEFINE(USE_BINARY_FOPEN) ;;
+esac])dnl
+
+dnl Get a default for CC_FOR_BUILD to put into Makefile.
+AC_DEFUN(BFD_CC_FOR_BUILD,
+[# Put a plausible default for CC_FOR_BUILD in Makefile.
+if test -z "$CC_FOR_BUILD"; then
+ if test "x$cross_compiling" = "xno"; then
+ CC_FOR_BUILD='$(CC)'
+ else
+ CC_FOR_BUILD=gcc
+ fi
+fi
+AC_SUBST(CC_FOR_BUILD)
+# Also set EXEEXT_FOR_BUILD.
+if test "x$cross_compiling" = "xno"; then
+ EXEEXT_FOR_BUILD='$(EXEEXT)'
+else
+ AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
+ [cat > ac_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+ ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
+ bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
+ rm -f ac_c_test*
+ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
+ EXEEXT_FOR_BUILD=""
+ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
+fi
+AC_SUBST(EXEEXT_FOR_BUILD)])dnl
+
+dnl See whether we need a declaration for a function.
+AC_DEFUN(BFD_NEED_DECLARATION,
+[AC_MSG_CHECKING([whether $1 must be declared])
+AC_CACHE_VAL(bfd_cv_decl_needed_$1,
+[AC_TRY_COMPILE([
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif],
+[char *(*pfn) = (char *(*)) $1],
+bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
+AC_MSG_RESULT($bfd_cv_decl_needed_$1)
+if test $bfd_cv_decl_needed_$1 = yes; then
+ bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ AC_DEFINE_UNQUOTED($bfd_tr_decl)
+fi
+])dnl
diff --git a/contrib/binutils/bfd/aclocal.m4 b/contrib/binutils/bfd/aclocal.m4
index ecb4c79..9d84a59 100644
--- a/contrib/binutils/bfd/aclocal.m4
+++ b/contrib/binutils/bfd/aclocal.m4
@@ -1,9 +1,21 @@
+dnl aclocal.m4 generated automatically by aclocal 1.2e
+
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
AC_DEFUN(BFD_BINARY_FOPEN,
[AC_REQUIRE([AC_CANONICAL_SYSTEM])
case "${host}" in
changequote(,)dnl
-i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
+i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
changequote([,])dnl
AC_DEFINE(USE_BINARY_FOPEN) ;;
esac])dnl
@@ -18,7 +30,25 @@ if test -z "$CC_FOR_BUILD"; then
CC_FOR_BUILD=gcc
fi
fi
-AC_SUBST(CC_FOR_BUILD)])dnl
+AC_SUBST(CC_FOR_BUILD)
+# Also set EXEEXT_FOR_BUILD.
+if test "x$cross_compiling" = "xno"; then
+ EXEEXT_FOR_BUILD='$(EXEEXT)'
+else
+ AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
+ [cat > ac_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+ ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
+ bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
+ rm -f ac_c_test*
+ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
+ EXEEXT_FOR_BUILD=""
+ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
+fi
+AC_SUBST(EXEEXT_FOR_BUILD)])dnl
dnl See whether we need a declaration for a function.
AC_DEFUN(BFD_NEED_DECLARATION,
@@ -47,3 +77,450 @@ if test $bfd_cv_decl_needed_$1 = yes; then
AC_DEFINE_UNQUOTED($bfd_tr_decl)
fi
])dnl
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AM_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+
+# serial 1
+
+AC_DEFUN(AM_PROG_INSTALL,
+[AC_REQUIRE([AC_PROG_INSTALL])
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+AC_SUBST(INSTALL_SCRIPT)dnl
+])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+
+# serial 24 AM_PROG_LIBTOOL
+AC_DEFUN(AM_PROG_LIBTOOL,
+[AC_REQUIRE([AM_ENABLE_SHARED])dnl
+AC_REQUIRE([AM_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_RANLIB])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AM_PROG_LD])dnl
+AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+dnl
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+])
+
+# AM_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_SHARED,
+[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
+changequote([, ])dnl
+[ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AM_DISABLE_SHARED,
+[AM_ENABLE_SHARED(no)])
+
+# AM_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AM_DISABLE_STATIC,
+[AM_ENABLE_STATIC(no)])
+
+# AM_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_STATIC,
+[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
+changequote([, ])dnl
+[ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+])
+
+
+# AM_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AM_PROG_LD,
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+changequote(,)dnl
+ /* | [A-Za-z]:\\*)
+changequote([,])dnl
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(ac_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_SUBST(LD)
+AM_PROG_LD_GNU
+])
+
+AC_DEFUN(AM_PROG_LD_GNU,
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi])
+])
+
+# AM_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AM_PROG_NM,
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(ac_cv_path_NM,
+[case "$NM" in
+changequote(,)dnl
+/* | [A-Za-z]:\\*)
+changequote([,])dnl
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac])
+NM="$ac_cv_path_NM"
+AC_MSG_RESULT([$NM])
+AC_SUBST(NM)
+])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT($USE_MAINTAINER_MODE)
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+ AC_SUBST(MAINT)dnl
+]
+)
+
+# Check to see if we're running under Cygwin32, without using
+# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_CYGWIN32()
+AC_DEFUN(AM_CYGWIN32,
+[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
+[AC_TRY_COMPILE(,[return __CYGWIN32__;],
+am_cv_cygwin32=yes, am_cv_cygwin32=no)
+rm -f conftest*])
+CYGWIN32=
+test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
+
+# Check to see if we're running under Win32, without using
+# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
+# Otherwise set it to "".
+
+dnl AM_EXEEXT()
+dnl This knows we add .exe if we're building in the Cygwin32
+dnl environment. But if we're not, then it compiles a test program
+dnl to see if there is a suffix for executables.
+AC_DEFUN(AM_EXEEXT,
+[AC_REQUIRE([AM_CYGWIN32])
+AC_REQUIRE([AM_MINGW32])
+AC_MSG_CHECKING([for executable suffix])
+AC_CACHE_VAL(am_cv_exeext,
+[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*])
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+AC_MSG_RESULT(${am_cv_exeext})
+AC_SUBST(EXEEXT)])
+
+# Check to see if we're running under Mingw, without using
+# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_MINGW32()
+AC_DEFUN(AM_MINGW32,
+[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
+[AC_TRY_COMPILE(,[return __MINGW32__;],
+am_cv_mingw32=yes, am_cv_mingw32=no)
+rm -f conftest*])
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes])
+
diff --git a/contrib/binutils/bfd/aout-target.h b/contrib/binutils/bfd/aout-target.h
index 011b18f..4e0fc9b 100644
--- a/contrib/binutils/bfd/aout-target.h
+++ b/contrib/binutils/bfd/aout-target.h
@@ -606,7 +606,7 @@ const bfd_target MY(vec) =
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
- (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
MY_symbol_leading_char,
AR_PAD_CHAR, /* ar_pad_char */
15, /* ar_max_namelen */
diff --git a/contrib/binutils/bfd/aout-tic30.c b/contrib/binutils/bfd/aout-tic30.c
new file mode 100644
index 0000000..cb7314e
--- /dev/null
+++ b/contrib/binutils/bfd/aout-tic30.c
@@ -0,0 +1,1062 @@
+/* BFD back-end for TMS320C30 a.out binaries.
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#define TARGET_IS_BIG_ENDIAN_P
+#define N_HEADER_IN_TEXT(x) 1
+#define BYTES_IN_WORD 4
+#define TEXT_START_ADDR 1024
+#define TARGET_PAGE_SIZE 128
+#define SEGMENT_SIZE TARGET_PAGE_SIZE
+#define DEFAULT_ARCH bfd_arch_tic30
+#define ARCH_SIZE 32
+
+#define MY(OP) CAT(tic30_aout_,OP)
+#define TARGETNAME "a.out-tic30"
+#define NAME(x,y) CAT3(tic30_aout,_32_,y)
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libaout.h"
+
+#include "aout/aout64.h"
+#include "aout/stab_gnu.h"
+#include "aout/ar.h"
+
+static bfd_reloc_status_type tic30_aout_fix_16
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type tic30_aout_fix_32
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type tic30_aout_fix_pcrel_16
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static reloc_howto_type *tic30_aout_reloc_howto
+ PARAMS ((bfd *, struct reloc_std_external *, int *, int *, int *));
+static bfd_reloc_status_type tic30_aout_relocate_contents
+ PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *));
+static bfd_reloc_status_type tic30_aout_final_link_relocate
+ PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma,
+ bfd_vma, bfd_vma));
+static const bfd_target *tic30_aout_object_p PARAMS ((bfd *));
+static boolean tic30_aout_write_object_contents PARAMS ((bfd *));
+static boolean tic30_aout_set_sizes PARAMS ((bfd *));
+
+#define MY_reloc_howto(BFD,REL,IN,EX,PC) tic30_aout_reloc_howto(BFD,REL,&IN,&EX,&PC)
+#define MY_final_link_relocate tic30_aout_final_link_relocate
+#define MY_object_p tic30_aout_object_p
+#define MY_mkobject NAME(aout,mkobject)
+#define MY_write_object_contents tic30_aout_write_object_contents
+#define MY_set_sizes tic30_aout_set_sizes
+
+#ifndef MY_exec_hdr_flags
+#define MY_exec_hdr_flags 1
+#endif
+
+#ifndef MY_backend_data
+
+#ifndef MY_zmagic_contiguous
+#define MY_zmagic_contiguous 0
+#endif
+#ifndef MY_text_includes_header
+#define MY_text_includes_header 0
+#endif
+#ifndef MY_entry_is_text_address
+#define MY_entry_is_text_address 0
+#endif
+#ifndef MY_exec_header_not_counted
+#define MY_exec_header_not_counted 1
+#endif
+#ifndef MY_add_dynamic_symbols
+#define MY_add_dynamic_symbols 0
+#endif
+#ifndef MY_add_one_symbol
+#define MY_add_one_symbol 0
+#endif
+#ifndef MY_link_dynamic_object
+#define MY_link_dynamic_object 0
+#endif
+#ifndef MY_write_dynamic_symbol
+#define MY_write_dynamic_symbol 0
+#endif
+#ifndef MY_check_dynamic_reloc
+#define MY_check_dynamic_reloc 0
+#endif
+#ifndef MY_finish_dynamic_link
+#define MY_finish_dynamic_link 0
+#endif
+
+static CONST struct aout_backend_data tic30_aout_backend_data =
+{
+ MY_zmagic_contiguous,
+ MY_text_includes_header,
+ MY_entry_is_text_address,
+ MY_exec_hdr_flags,
+ 0, /* text vma? */
+ MY_set_sizes,
+ MY_exec_header_not_counted,
+ MY_add_dynamic_symbols,
+ MY_add_one_symbol,
+ MY_link_dynamic_object,
+ MY_write_dynamic_symbol,
+ MY_check_dynamic_reloc,
+ MY_finish_dynamic_link
+};
+#define MY_backend_data &tic30_aout_backend_data
+#endif
+
+/* FIXME: This is wrong. aoutx.h should really only be included by
+ aout32.c. */
+
+#include "aoutx.h"
+
+/* This table lists the relocation types for the TMS320C30. There are
+ only a few relocations required, and all must be divided by 4 (>>
+ 2) to get the 32-bit addresses in the format the TMS320C30 likes
+ it. */
+reloc_howto_type tic30_aout_howto_table[] =
+{
+ {-1},
+ HOWTO (1, 2, 1, 16, false, 0, 0, tic30_aout_fix_16,
+ "16", false, 0x0000FFFF, 0x0000FFFF, false),
+ HOWTO (2, 2, 2, 24, false, 0, complain_overflow_bitfield, NULL,
+ "24", false, 0x00FFFFFF, 0x00FFFFFF, false),
+ HOWTO (3, 18, 3, 24, false, 0, complain_overflow_bitfield, NULL,
+ "LDP", false, 0x00FF0000, 0x000000FF, false),
+ HOWTO (4, 2, 4, 32, false, 0, complain_overflow_bitfield, tic30_aout_fix_32,
+ "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
+ HOWTO (5, 2, 1, 16, true, 0, complain_overflow_signed,
+ tic30_aout_fix_pcrel_16, "PCREL", true, 0x0000FFFF, 0x0000FFFF, true),
+ {-1},
+ {-1},
+ {-1},
+ {-1},
+ {-1}
+};
+
+extern reloc_howto_type *NAME (aout, reloc_type_lookup) ();
+
+reloc_howto_type *
+tic30_aout_reloc_type_lookup (abfd, code)
+ bfd *abfd;
+ bfd_reloc_code_real_type code;
+{
+ switch (code)
+ {
+ case BFD_RELOC_8:
+ case BFD_RELOC_TIC30_LDP:
+ return &tic30_aout_howto_table[3];
+ case BFD_RELOC_16:
+ return &tic30_aout_howto_table[1];
+ case BFD_RELOC_24:
+ return &tic30_aout_howto_table[2];
+ case BFD_RELOC_16_PCREL:
+ return &tic30_aout_howto_table[5];
+ case BFD_RELOC_32:
+ return &tic30_aout_howto_table[4];
+ default:
+ return (reloc_howto_type *) NULL;
+ }
+}
+
+static reloc_howto_type *
+tic30_aout_reloc_howto (abfd, relocs, r_index, r_extern, r_pcrel)
+ bfd *abfd;
+ struct reloc_std_external *relocs;
+ int *r_index;
+ int *r_extern;
+ int *r_pcrel;
+{
+ unsigned int r_length;
+ unsigned int r_pcrel_done;
+ int index;
+
+ *r_pcrel = 0;
+ if (bfd_header_big_endian (abfd))
+ {
+ *r_index = ((relocs->r_index[0] << 16) | (relocs->r_index[1] << 8) | relocs->r_index[2]);
+ *r_extern = (0 != (relocs->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
+ r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
+ r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_BIG) >> RELOC_STD_BITS_LENGTH_SH_BIG);
+ }
+ else
+ {
+ *r_index = ((relocs->r_index[2] << 16) | (relocs->r_index[1] << 8) | relocs->r_index[0]);
+ *r_extern = (0 != (relocs->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
+ r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
+ r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) >> RELOC_STD_BITS_LENGTH_SH_LITTLE);
+ }
+ index = r_length + 4 * r_pcrel_done;
+ return tic30_aout_howto_table + index;
+}
+
+/* This function is used as a callback for 16-bit relocs. This is
+ required for relocations between segments. A line in aoutx.h
+ requires that any relocations for the data section should point to
+ the end of the aligned text section, plus an offset. By default,
+ this does not happen, therefore this function takes care of
+ that. */
+
+static bfd_reloc_status_type
+tic30_aout_fix_16 (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;
+{
+ bfd_vma relocation;
+
+ /* Make sure that the symbol's section is defined. */
+ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0)
+ return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
+ /* Get the size of the input section and turn it into the TMS320C30
+ 32-bit address format. */
+ relocation = (symbol->section->vma >> 2);
+ relocation += bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address);
+ bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
+ return bfd_reloc_ok;
+}
+
+/* This function does the same thing as tic30_aout_fix_16 except for 32
+ bit relocations. */
+
+static bfd_reloc_status_type
+tic30_aout_fix_32 (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;
+{
+ bfd_vma relocation;
+
+ /* Make sure that the symbol's section is defined. */
+ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0)
+ return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
+ /* Get the size of the input section and turn it into the TMS320C30
+ 32-bit address format. */
+ relocation = (symbol->section->vma >> 2);
+ relocation += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
+ bfd_put_32 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
+ return bfd_reloc_ok;
+}
+
+/* This function is used to work out pc-relative offsets for the
+ TMS320C30. The data already placed by md_pcrel_from within gas is
+ useless for a relocation, so we just get the offset value and place
+ a version of this within the object code.
+ tic30_aout_final_link_relocate will then calculate the required
+ relocation to add on to the value in the object code. */
+
+static bfd_reloc_status_type
+tic30_aout_fix_pcrel_16 (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;
+{
+ bfd_vma relocation = 1;
+ bfd_byte offset_data = bfd_get_8 (abfd, (bfd_byte *) data + reloc_entry->address - 1);
+
+ /* The byte before the location of the fix contains bits 23-16 of
+ the pcrel instruction. Bit 21 is set for a delayed instruction
+ which requires on offset of 3 instead of 1. */
+ if (offset_data & 0x20)
+ relocation -= 3;
+ else
+ relocation -= 1;
+ bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
+ return bfd_reloc_ok;
+}
+
+/* These macros will get 24-bit values from the bfd definition.
+ Big-endian only. */
+#define bfd_getb_24(BFD,ADDR) (bfd_get_8(BFD,ADDR) << 16) | \
+ (bfd_get_8(BFD,ADDR+1) << 8) | \
+ (bfd_get_8(BFD,ADDR+2))
+
+#define bfd_putb_24(BFD,DATA,ADDR) bfd_put_8(BFD,(bfd_byte)((DATA >> 16) & 0xFF),ADDR); \
+ bfd_put_8(BFD,(bfd_byte)((DATA >> 8) & 0xFF),ADDR+1); \
+ bfd_put_8(BFD,(bfd_byte)(DATA & 0xFF),ADDR+2)
+
+/* Set parameters about this a.out file that are machine-dependent.
+ This routine is called from some_aout_object_p just before it returns. */
+
+static const bfd_target *
+tic30_aout_callback (abfd)
+ bfd *abfd;
+{
+ struct internal_exec *execp = exec_hdr (abfd);
+ unsigned int arch_align_power;
+ unsigned long arch_align;
+
+ /* Calculate the file positions of the parts of a newly read aout header */
+ obj_textsec (abfd)->_raw_size = N_TXTSIZE (*execp);
+
+ /* The virtual memory addresses of the sections */
+ obj_textsec (abfd)->vma = N_TXTADDR (*execp);
+ obj_datasec (abfd)->vma = N_DATADDR (*execp);
+ obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
+
+ obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
+ obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
+ obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
+
+ /* The file offsets of the sections */
+ obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
+ obj_datasec (abfd)->filepos = N_DATOFF (*execp);
+
+ /* The file offsets of the relocation info */
+ obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
+ obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
+
+ /* The file offsets of the string table and symbol table. */
+ obj_sym_filepos (abfd) = N_SYMOFF (*execp);
+ obj_str_filepos (abfd) = N_STROFF (*execp);
+
+ /* Determine the architecture and machine type of the object file. */
+#ifdef SET_ARCH_MACH
+ SET_ARCH_MACH (abfd, *execp);
+#else
+ bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
+#endif
+
+ /* Now that we know the architecture, set the alignments of the
+ sections. This is normally done by NAME(aout,new_section_hook),
+ but when the initial sections were created the architecture had
+ not yet been set. However, for backward compatibility, we don't
+ set the alignment power any higher than as required by the size
+ of the section. */
+ arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
+ arch_align = 1 << arch_align_power;
+ if ((BFD_ALIGN (obj_textsec (abfd)->_raw_size, arch_align)
+ == obj_textsec (abfd)->_raw_size)
+ && (BFD_ALIGN (obj_datasec (abfd)->_raw_size, arch_align)
+ == obj_datasec (abfd)->_raw_size)
+ && (BFD_ALIGN (obj_bsssec (abfd)->_raw_size, arch_align)
+ == obj_bsssec (abfd)->_raw_size))
+ {
+ obj_textsec (abfd)->alignment_power = arch_align_power;
+ obj_datasec (abfd)->alignment_power = arch_align_power;
+ obj_bsssec (abfd)->alignment_power = arch_align_power;
+ }
+ return abfd->xvec;
+}
+
+static bfd_reloc_status_type
+tic30_aout_final_link_relocate (howto, input_bfd, input_section, contents,
+ address, value, addend)
+ reloc_howto_type *howto;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ bfd_vma address;
+ bfd_vma value;
+ bfd_vma addend;
+{
+ bfd_vma relocation;
+
+ if (address > input_section->_raw_size)
+ return bfd_reloc_outofrange;
+
+ relocation = value + addend;
+ if (howto->pc_relative)
+ {
+ relocation -= (input_section->output_section->vma + input_section->output_offset);
+ if (howto->pcrel_offset)
+ relocation -= address;
+ }
+ return tic30_aout_relocate_contents (howto, input_bfd, relocation,
+ contents + address);
+}
+
+bfd_reloc_status_type
+tic30_aout_relocate_contents (howto, input_bfd, relocation, location)
+ reloc_howto_type *howto;
+ bfd *input_bfd;
+ bfd_vma relocation;
+ bfd_byte *location;
+{
+ bfd_vma x;
+ boolean overflow;
+
+ if (howto->size < 0)
+ relocation = -relocation;
+
+ switch (howto->size)
+ {
+ default:
+ case 0:
+ abort ();
+ break;
+ case 1:
+ x = bfd_get_16 (input_bfd, location);
+ break;
+ case 2:
+ x = bfd_getb_24 (input_bfd, location);
+ break;
+ case 3:
+ x = bfd_get_8 (input_bfd, location);
+ break;
+ case 4:
+ x = bfd_get_32 (input_bfd, location);
+ break;
+ }
+ overflow = false;
+ if (howto->complain_on_overflow != complain_overflow_dont)
+ {
+ bfd_vma check;
+ bfd_signed_vma signed_check;
+ bfd_vma add;
+ bfd_signed_vma signed_add;
+
+ if (howto->rightshift == 0)
+ {
+ check = relocation;
+ signed_check = (bfd_signed_vma) relocation;
+ }
+ else
+ {
+ check = relocation >> howto->rightshift;
+ if ((bfd_signed_vma) relocation >= 0)
+ signed_check = check;
+ else
+ signed_check = (check | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->rightshift)));
+ }
+ add = x & howto->src_mask;
+ signed_add = add;
+ if ((add & (((~howto->src_mask) >> 1) & howto->src_mask)) != 0)
+ signed_add -= (((~howto->src_mask) >> 1) & howto->src_mask) << 1;
+ if (howto->bitpos == 0)
+ {
+ check += add;
+ signed_check += signed_add;
+ }
+ else
+ {
+ check += add >> howto->bitpos;
+ if (signed_add >= 0)
+ signed_check += add >> howto->bitpos;
+ else
+ signed_check += ((add >> howto->bitpos) | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->bitpos)));
+ }
+ switch (howto->complain_on_overflow)
+ {
+ case complain_overflow_signed:
+ {
+ bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
+ bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
+ if (signed_check > reloc_signed_max || signed_check < reloc_signed_min)
+ overflow = true;
+ }
+ break;
+ case complain_overflow_unsigned:
+ {
+ bfd_vma reloc_unsigned_max = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
+ if (check > reloc_unsigned_max)
+ overflow = true;
+ }
+ break;
+ case complain_overflow_bitfield:
+ {
+ bfd_vma reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
+ if ((check & ~reloc_bits) != 0 && (((bfd_vma) signed_check & ~reloc_bits) != (-1 & ~reloc_bits)))
+ overflow = true;
+ }
+ break;
+ default:
+ abort ();
+ }
+ }
+ relocation >>= (bfd_vma) howto->rightshift;
+ relocation <<= (bfd_vma) howto->bitpos;
+ x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask));
+ switch (howto->size)
+ {
+ default:
+ case 0:
+ abort ();
+ break;
+ case 1:
+ bfd_put_16 (input_bfd, x, location);
+ break;
+ case 2:
+ bfd_putb_24 (input_bfd, x, location);
+ break;
+ case 3:
+ bfd_put_8 (input_bfd, x, location);
+ break;
+ case 4:
+ bfd_put_32 (input_bfd, x, location);
+ break;
+ }
+ return overflow ? bfd_reloc_overflow : bfd_reloc_ok;
+}
+
+/* Finish up the reading of an a.out file header */
+
+static const bfd_target *
+tic30_aout_object_p (abfd)
+ bfd *abfd;
+{
+ struct external_exec exec_bytes; /* Raw exec header from file */
+ struct internal_exec exec; /* Cleaned-up exec header */
+ const bfd_target *target;
+
+ if (bfd_read ((PTR) & exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
+ != EXEC_BYTES_SIZE)
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+ return 0;
+ }
+
+#ifdef SWAP_MAGIC
+ exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
+#else
+ exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info);
+#endif /* SWAP_MAGIC */
+
+ if (N_BADMAG (exec))
+ return 0;
+#ifdef MACHTYPE_OK
+ if (!(MACHTYPE_OK (N_MACHTYPE (exec))))
+ return 0;
+#endif
+
+ NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
+
+#ifdef SWAP_MAGIC
+ /* swap_exec_header_in read in a_info with the wrong byte order */
+ exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
+#endif /* SWAP_MAGIC */
+
+ target = NAME (aout, some_aout_object_p) (abfd, &exec, tic30_aout_callback);
+
+#ifdef ENTRY_CAN_BE_ZERO
+ /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
+ * means that it isn't obvious if EXEC_P should be set.
+ * All of the following must be true for an executable:
+ * There must be no relocations, the bfd can be neither an
+ * archive nor an archive element, and the file must be executable. */
+
+ if (exec.a_trsize + exec.a_drsize == 0
+ && bfd_get_format (abfd) == bfd_object && abfd->my_archive == NULL)
+ {
+ struct stat buf;
+#ifndef S_IXUSR
+#define S_IXUSR 0100 /* Execute by owner. */
+#endif
+ if (stat (abfd->filename, &buf) == 0 && (buf.st_mode & S_IXUSR))
+ abfd->flags |= EXEC_P;
+ }
+#endif /* ENTRY_CAN_BE_ZERO */
+
+ return target;
+}
+
+/* Copy private section data. This actually does nothing with the
+ sections. It copies the subformat field. We copy it here, because
+ we need to know whether this is a QMAGIC file before we set the
+ section contents, and copy_private_bfd_data is not called until
+ after the section contents have been set. */
+
+/*ARGSUSED */
+static boolean
+MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
+ bfd *ibfd;
+ asection *isec;
+ bfd *obfd;
+ asection *osec;
+{
+ if (bfd_get_flavour (obfd) == bfd_target_aout_flavour)
+ obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
+ return true;
+}
+
+/* Write an object file.
+ Section contents have already been written. We write the
+ file header, symbols, and relocation. */
+
+static boolean
+tic30_aout_write_object_contents (abfd)
+ bfd *abfd;
+{
+ struct external_exec exec_bytes;
+ struct internal_exec *execp = exec_hdr (abfd);
+
+#if CHOOSE_RELOC_SIZE
+ CHOOSE_RELOC_SIZE (abfd);
+#else
+ obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
+#endif
+ {
+ bfd_size_type text_size; /* dummy vars */
+ file_ptr text_end;
+ if (adata (abfd).magic == undecided_magic)
+ NAME (aout, adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
+
+ execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE;
+ execp->a_entry = bfd_get_start_address (abfd);
+
+ execp->a_trsize = ((obj_textsec (abfd)->reloc_count) * obj_reloc_entry_size (abfd));
+ execp->a_drsize = ((obj_datasec (abfd)->reloc_count) * obj_reloc_entry_size (abfd));
+ NAME (aout, swap_exec_header_out) (abfd, execp, &exec_bytes);
+
+ if (adata (abfd).exec_bytes_size > 0)
+ {
+ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
+ return false;
+ if (bfd_write ((PTR) & exec_bytes, 1, adata (abfd).exec_bytes_size, abfd) != adata (abfd).exec_bytes_size)
+ return false;
+ }
+ /* Now write out reloc info, followed by syms and strings */
+
+ if (bfd_get_outsymbols (abfd) != (asymbol **) NULL
+ && bfd_get_symcount (abfd) != 0)
+ {
+ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*execp)), SEEK_SET) != 0)
+ return false;
+
+ if (!NAME (aout, write_syms) (abfd))
+ return false;
+ }
+
+ if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0)
+ return false;
+ if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd)))
+ return false;
+
+ if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0)
+ return false;
+ if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd)))
+ return false;
+ }
+
+ return true;
+}
+
+static boolean
+tic30_aout_set_sizes (abfd)
+ bfd *abfd;
+{
+ adata (abfd).page_size = TARGET_PAGE_SIZE;
+
+#ifdef SEGMENT_SIZE
+ adata (abfd).segment_size = SEGMENT_SIZE;
+#else
+ adata (abfd).segment_size = TARGET_PAGE_SIZE;
+#endif
+
+#ifdef ZMAGIC_DISK_BLOCK_SIZE
+ adata (abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
+#else
+ adata (abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
+#endif
+
+ adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
+
+ return true;
+}
+
+#ifndef MY_final_link_callback
+
+/* Callback for the final_link routine to set the section offsets. */
+
+static void MY_final_link_callback
+ PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
+
+static void
+MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff)
+ bfd *abfd;
+ file_ptr *ptreloff;
+ file_ptr *pdreloff;
+ file_ptr *psymoff;
+{
+ struct internal_exec *execp = exec_hdr (abfd);
+
+ *ptreloff = obj_datasec (abfd)->filepos + execp->a_data;
+ *pdreloff = *ptreloff + execp->a_trsize;
+ *psymoff = *pdreloff + execp->a_drsize;;
+}
+
+#endif
+
+#ifndef MY_bfd_final_link
+
+/* Final link routine. We need to use a call back to get the correct
+ offsets in the output file. */
+
+static boolean
+MY_bfd_final_link (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ struct internal_exec *execp = exec_hdr (abfd);
+ file_ptr pos;
+ bfd_vma vma = 0;
+ int pad;
+
+ /* Set the executable header size to 0, as we don't want one for an
+ output. */
+ adata (abfd).exec_bytes_size = 0;
+ pos = adata (abfd).exec_bytes_size;
+ /* Text. */
+ vma = info->create_object_symbols_section->vma;
+ pos += vma;
+ obj_textsec (abfd)->filepos = pos;
+ obj_textsec (abfd)->vma = vma;
+ obj_textsec (abfd)->user_set_vma = 1;
+ pos += obj_textsec (abfd)->_raw_size;
+ vma += obj_textsec (abfd)->_raw_size;
+
+ /* Data. */
+ if (abfd->flags & D_PAGED)
+ {
+ if (info->create_object_symbols_section->next->vma > 0)
+ obj_datasec (abfd)->vma = info->create_object_symbols_section->next->vma;
+ else
+ obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
+ }
+ else
+ {
+ obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
+ }
+ if (obj_datasec (abfd)->vma < vma)
+ {
+ obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
+ }
+ obj_datasec (abfd)->user_set_vma = 1;
+ vma = obj_datasec (abfd)->vma;
+ obj_datasec (abfd)->filepos = vma + adata (abfd).exec_bytes_size;
+ execp->a_text = vma - obj_textsec (abfd)->vma;
+ obj_textsec (abfd)->_raw_size = execp->a_text;
+
+ /* Since BSS follows data immediately, see if it needs alignment. */
+ vma += obj_datasec (abfd)->_raw_size;
+ pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
+ obj_datasec (abfd)->_raw_size += pad;
+ pos += obj_datasec (abfd)->_raw_size;
+ execp->a_data = obj_datasec (abfd)->_raw_size;
+
+ /* BSS. */
+ obj_bsssec (abfd)->vma = vma;
+ obj_bsssec (abfd)->user_set_vma = 1;
+
+ /* We are fully resized, so don't readjust in final_link. */
+ adata (abfd).magic = z_magic;
+
+ return NAME (aout, final_link) (abfd, info, MY_final_link_callback);
+}
+
+#endif
+
+enum machine_type
+tic30_aout_machine_type (arch, machine, unknown)
+ enum bfd_architecture arch;
+ unsigned long machine;
+ boolean *unknown;
+{
+ enum machine_type arch_flags;
+
+ arch_flags = M_UNKNOWN;
+ *unknown = true;
+
+ switch (arch)
+ {
+ case bfd_arch_tic30:
+ *unknown = false;
+ break;
+ default:
+ arch_flags = M_UNKNOWN;
+ }
+ if (arch_flags != M_UNKNOWN)
+ *unknown = false;
+ return arch_flags;
+}
+
+boolean
+tic30_aout_set_arch_mach (abfd, arch, machine)
+ bfd *abfd;
+ enum bfd_architecture arch;
+ unsigned long machine;
+{
+ if (!bfd_default_set_arch_mach (abfd, arch, machine))
+ return false;
+ if (arch != bfd_arch_unknown)
+ {
+ boolean unknown;
+ tic30_aout_machine_type (arch, machine, &unknown);
+ if (unknown)
+ return false;
+ }
+ obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
+ return (*aout_backend_info (abfd)->set_sizes) (abfd);
+}
+
+/* We assume BFD generic archive files. */
+#ifndef MY_openr_next_archived_file
+#define MY_openr_next_archived_file bfd_generic_openr_next_archived_file
+#endif
+#ifndef MY_get_elt_at_index
+#define MY_get_elt_at_index _bfd_generic_get_elt_at_index
+#endif
+#ifndef MY_generic_stat_arch_elt
+#define MY_generic_stat_arch_elt bfd_generic_stat_arch_elt
+#endif
+#ifndef MY_slurp_armap
+#define MY_slurp_armap bfd_slurp_bsd_armap
+#endif
+#ifndef MY_slurp_extended_name_table
+#define MY_slurp_extended_name_table _bfd_slurp_extended_name_table
+#endif
+#ifndef MY_construct_extended_name_table
+#define MY_construct_extended_name_table \
+ _bfd_archive_bsd_construct_extended_name_table
+#endif
+#ifndef MY_write_armap
+#define MY_write_armap bsd_write_armap
+#endif
+#ifndef MY_read_ar_hdr
+#define MY_read_ar_hdr _bfd_generic_read_ar_hdr
+#endif
+#ifndef MY_truncate_arname
+#define MY_truncate_arname bfd_bsd_truncate_arname
+#endif
+#ifndef MY_update_armap_timestamp
+#define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp
+#endif
+
+/* No core file defined here -- configure in trad-core.c separately. */
+#ifndef MY_core_file_failing_command
+#define MY_core_file_failing_command _bfd_nocore_core_file_failing_command
+#endif
+#ifndef MY_core_file_failing_signal
+#define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal
+#endif
+#ifndef MY_core_file_matches_executable_p
+#define MY_core_file_matches_executable_p \
+ _bfd_nocore_core_file_matches_executable_p
+#endif
+#ifndef MY_core_file_p
+#define MY_core_file_p _bfd_dummy_target
+#endif
+
+#ifndef MY_bfd_debug_info_start
+#define MY_bfd_debug_info_start bfd_void
+#endif
+#ifndef MY_bfd_debug_info_end
+#define MY_bfd_debug_info_end bfd_void
+#endif
+#ifndef MY_bfd_debug_info_accumulate
+#define MY_bfd_debug_info_accumulate \
+ (void (*) PARAMS ((bfd*, struct sec *))) bfd_void
+#endif
+
+#ifndef MY_core_file_failing_command
+#define MY_core_file_failing_command NAME(aout,core_file_failing_command)
+#endif
+#ifndef MY_core_file_failing_signal
+#define MY_core_file_failing_signal NAME(aout,core_file_failing_signal)
+#endif
+#ifndef MY_core_file_matches_executable_p
+#define MY_core_file_matches_executable_p NAME(aout,core_file_matches_executable_p)
+#endif
+#ifndef MY_set_section_contents
+#define MY_set_section_contents NAME(aout,set_section_contents)
+#endif
+#ifndef MY_get_section_contents
+#define MY_get_section_contents aout_32_get_section_contents
+#endif
+#ifndef MY_get_section_contents_in_window
+#define MY_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#endif
+#ifndef MY_new_section_hook
+#define MY_new_section_hook NAME(aout,new_section_hook)
+#endif
+#ifndef MY_get_symtab_upper_bound
+#define MY_get_symtab_upper_bound NAME(aout,get_symtab_upper_bound)
+#endif
+#ifndef MY_get_symtab
+#define MY_get_symtab NAME(aout,get_symtab)
+#endif
+#ifndef MY_get_reloc_upper_bound
+#define MY_get_reloc_upper_bound NAME(aout,get_reloc_upper_bound)
+#endif
+#ifndef MY_canonicalize_reloc
+#define MY_canonicalize_reloc NAME(aout,canonicalize_reloc)
+#endif
+#ifndef MY_make_empty_symbol
+#define MY_make_empty_symbol NAME(aout,make_empty_symbol)
+#endif
+#ifndef MY_print_symbol
+#define MY_print_symbol NAME(aout,print_symbol)
+#endif
+#ifndef MY_get_symbol_info
+#define MY_get_symbol_info NAME(aout,get_symbol_info)
+#endif
+#ifndef MY_get_lineno
+#define MY_get_lineno NAME(aout,get_lineno)
+#endif
+#ifndef MY_set_arch_mach
+#define MY_set_arch_mach tic30_aout_set_arch_mach
+#endif
+#ifndef MY_find_nearest_line
+#define MY_find_nearest_line NAME(aout,find_nearest_line)
+#endif
+#ifndef MY_sizeof_headers
+#define MY_sizeof_headers NAME(aout,sizeof_headers)
+#endif
+#ifndef MY_bfd_get_relocated_section_contents
+#define MY_bfd_get_relocated_section_contents \
+ bfd_generic_get_relocated_section_contents
+#endif
+#ifndef MY_bfd_relax_section
+#define MY_bfd_relax_section bfd_generic_relax_section
+#endif
+#ifndef MY_bfd_reloc_type_lookup
+#define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup
+#endif
+#ifndef MY_bfd_make_debug_symbol
+#define MY_bfd_make_debug_symbol 0
+#endif
+#ifndef MY_read_minisymbols
+#define MY_read_minisymbols NAME(aout,read_minisymbols)
+#endif
+#ifndef MY_minisymbol_to_symbol
+#define MY_minisymbol_to_symbol NAME(aout,minisymbol_to_symbol)
+#endif
+#ifndef MY_bfd_link_hash_table_create
+#define MY_bfd_link_hash_table_create NAME(aout,link_hash_table_create)
+#endif
+#ifndef MY_bfd_link_add_symbols
+#define MY_bfd_link_add_symbols NAME(aout,link_add_symbols)
+#endif
+#ifndef MY_bfd_link_split_section
+#define MY_bfd_link_split_section _bfd_generic_link_split_section
+#endif
+
+
+#ifndef MY_bfd_copy_private_bfd_data
+#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
+#endif
+
+#ifndef MY_bfd_merge_private_bfd_data
+#define MY_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
+#endif
+
+#ifndef MY_bfd_copy_private_symbol_data
+#define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
+#endif
+
+#ifndef MY_bfd_print_private_bfd_data
+#define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
+#endif
+
+#ifndef MY_bfd_set_private_flags
+#define MY_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#endif
+
+#ifndef MY_bfd_is_local_label_name
+#define MY_bfd_is_local_label_name bfd_generic_is_local_label_name
+#endif
+
+#ifndef MY_bfd_free_cached_info
+#define MY_bfd_free_cached_info NAME(aout,bfd_free_cached_info)
+#endif
+
+#ifndef MY_close_and_cleanup
+#define MY_close_and_cleanup MY_bfd_free_cached_info
+#endif
+
+#ifndef MY_get_dynamic_symtab_upper_bound
+#define MY_get_dynamic_symtab_upper_bound \
+ _bfd_nodynamic_get_dynamic_symtab_upper_bound
+#endif
+#ifndef MY_canonicalize_dynamic_symtab
+#define MY_canonicalize_dynamic_symtab \
+ _bfd_nodynamic_canonicalize_dynamic_symtab
+#endif
+#ifndef MY_get_dynamic_reloc_upper_bound
+#define MY_get_dynamic_reloc_upper_bound \
+ _bfd_nodynamic_get_dynamic_reloc_upper_bound
+#endif
+#ifndef MY_canonicalize_dynamic_reloc
+#define MY_canonicalize_dynamic_reloc \
+ _bfd_nodynamic_canonicalize_dynamic_reloc
+#endif
+
+/* Aout symbols normally have leading underscores */
+#ifndef MY_symbol_leading_char
+#define MY_symbol_leading_char '_'
+#endif
+
+/* Aout archives normally use spaces for padding */
+#ifndef AR_PAD_CHAR
+#define AR_PAD_CHAR ' '
+#endif
+
+#ifndef MY_BFD_TARGET
+const bfd_target tic30_aout_vec =
+{
+ TARGETNAME, /* name */
+ bfd_target_aout_flavour,
+ BFD_ENDIAN_BIG, /* target byte order (big) */
+ BFD_ENDIAN_BIG, /* target headers byte order (big) */
+ (HAS_RELOC | /* object flags */
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ MY_symbol_leading_char,
+ AR_PAD_CHAR, /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+ {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, MY_core_file_p},
+ {bfd_false, MY_mkobject, /* bfd_set_format */
+ _bfd_generic_mkarchive, bfd_false},
+ {bfd_false, MY_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (MY),
+ BFD_JUMP_TABLE_COPY (MY),
+ BFD_JUMP_TABLE_CORE (MY),
+ BFD_JUMP_TABLE_ARCHIVE (MY),
+ BFD_JUMP_TABLE_SYMBOLS (MY),
+ BFD_JUMP_TABLE_RELOCS (MY),
+ BFD_JUMP_TABLE_WRITE (MY),
+ BFD_JUMP_TABLE_LINK (MY),
+ BFD_JUMP_TABLE_DYNAMIC (MY),
+
+ (PTR) MY_backend_data,
+};
+#endif /* MY_BFD_TARGET */
diff --git a/contrib/binutils/bfd/aoutf1.h b/contrib/binutils/bfd/aoutf1.h
index 2851117..0446c5d 100644
--- a/contrib/binutils/bfd/aoutf1.h
+++ b/contrib/binutils/bfd/aoutf1.h
@@ -1,5 +1,6 @@
/* A.out "format 1" file handling code for BFD.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -124,19 +125,19 @@ sunos_set_arch_mach (abfd, machtype)
/* Some Sun3s make magic numbers without cpu types in them, so
we'll default to the 68000. */
arch = bfd_arch_m68k;
- machine = 68000;
+ machine = bfd_mach_m68000;
break;
case M_68010:
case M_HP200:
arch = bfd_arch_m68k;
- machine = 68010;
+ machine = bfd_mach_m68010;
break;
case M_68020:
case M_HP300:
arch = bfd_arch_m68k;
- machine = 68020;
+ machine = bfd_mach_m68020;
break;
case M_SPARC:
@@ -213,14 +214,14 @@ sunos_write_object_contents (abfd)
case bfd_arch_m68k:
switch (bfd_get_mach (abfd))
{
- case 68000:
+ case bfd_mach_m68000:
N_SET_MACHTYPE (*execp, M_UNKNOWN);
break;
- case 68010:
+ case bfd_mach_m68010:
N_SET_MACHTYPE (*execp, M_68010);
break;
default:
- case 68020:
+ case bfd_mach_m68020:
N_SET_MACHTYPE (*execp, M_68020);
break;
}
diff --git a/contrib/binutils/bfd/aoutx.h b/contrib/binutils/bfd/aoutx.h
index c6a482f..ff1cdd2 100644
--- a/contrib/binutils/bfd/aoutx.h
+++ b/contrib/binutils/bfd/aoutx.h
@@ -1,5 +1,6 @@
/* BFD semi-generic back-end for a.out binaries.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -715,11 +716,11 @@ NAME(aout,machine_type) (arch, machine, unknown)
case bfd_arch_m68k:
switch (machine) {
- case 0: arch_flags = M_68010; break;
- case 68000: arch_flags = M_UNKNOWN; *unknown = false; break;
- case 68010: arch_flags = M_68010; break;
- case 68020: arch_flags = M_68020; break;
- default: arch_flags = M_UNKNOWN; break;
+ case 0: arch_flags = M_68010; break;
+ case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = false; break;
+ case bfd_mach_m68010: arch_flags = M_68010; break;
+ case bfd_mach_m68020: arch_flags = M_68020; break;
+ default: arch_flags = M_UNKNOWN; break;
}
break;
@@ -3880,10 +3881,29 @@ NAME(aout,final_link) (abfd, info, callback)
obj_datasec (abfd)->reloc_count =
exec_hdr (abfd)->a_drsize / obj_reloc_entry_size (abfd);
- /* Write out the string table. */
- if (bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET) != 0)
- goto error_return;
- return emit_stringtab (abfd, aout_info.strtab);
+ /* Write out the string table, unless there are no symbols. */
+ if (abfd->symcount > 0)
+ {
+ if (bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET) != 0
+ || ! emit_stringtab (abfd, aout_info.strtab))
+ goto error_return;
+ }
+ else if (obj_textsec (abfd)->reloc_count == 0
+ && obj_datasec (abfd)->reloc_count == 0)
+ {
+ bfd_byte b;
+
+ b = 0;
+ if (bfd_seek (abfd,
+ (obj_datasec (abfd)->filepos
+ + exec_hdr (abfd)->a_data
+ - 1),
+ SEEK_SET) != 0
+ || bfd_write (&b, 1, 1, abfd) != 1)
+ goto error_return;
+ }
+
+ return true;
error_return:
if (aout_info.contents != NULL)
diff --git a/contrib/binutils/bfd/archive.c b/contrib/binutils/bfd/archive.c
index 5c81dbd..6b9dbbc 100644
--- a/contrib/binutils/bfd/archive.c
+++ b/contrib/binutils/bfd/archive.c
@@ -1,5 +1,6 @@
/* BFD back-end for archive files (libraries).
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
This file is part of BFD, the Binary File Descriptor library.
@@ -412,8 +413,10 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
}
/* BSD4.4-style long filename.
Only implemented for reading, so far! */
- else if (hdr.ar_name[0] == '#' && hdr.ar_name[1] == '1'
- && hdr.ar_name[2] == '/' && isdigit (hdr.ar_name[3]))
+ else if (hdr.ar_name[0] == '#'
+ && hdr.ar_name[1] == '1'
+ && hdr.ar_name[2] == '/'
+ && isdigit ((unsigned char) hdr.ar_name[3]))
{
/* BSD-4.4 extended name */
namelen = atoi (&hdr.ar_name[3]);
@@ -643,6 +646,8 @@ bfd_generic_archive_p (abfd)
{
bfd_release (abfd, bfd_ardata (abfd));
abfd->tdata.aout_ar_data = tdata_hold;
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
return NULL;
}
@@ -650,6 +655,8 @@ bfd_generic_archive_p (abfd)
{
bfd_release (abfd, bfd_ardata (abfd));
abfd->tdata.aout_ar_data = tdata_hold;
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
return NULL;
}
@@ -1390,10 +1397,12 @@ bfd_ar_hdr_from_filesystem (abfd, filename)
a strong stomach to write this, and it does, but it takes even a
stronger stomach to try to code around such a thing! */
+struct ar_hdr *bfd_special_undocumented_glue PARAMS ((bfd *, const char *));
+
struct ar_hdr *
bfd_special_undocumented_glue (abfd, filename)
bfd *abfd;
- char *filename;
+ const char *filename;
{
struct areltdata *ar_elt = bfd_ar_hdr_from_filesystem (abfd, filename);
if (ar_elt == NULL)
diff --git a/contrib/binutils/bfd/archures.c b/contrib/binutils/bfd/archures.c
index 1b2f4d9..fa6c7cc 100644
--- a/contrib/binutils/bfd/archures.c
+++ b/contrib/binutils/bfd/archures.c
@@ -1,5 +1,5 @@
/* BFD library support routines for architectures.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91-97, 1998 Free Software Foundation, Inc.
Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -70,6 +70,13 @@ DESCRIPTION
. bfd_arch_unknown, {* File arch not known *}
. bfd_arch_obscure, {* Arch known, not one of these *}
. bfd_arch_m68k, {* Motorola 68xxx *}
+.#define bfd_mach_m68000 1
+.#define bfd_mach_m68008 2
+.#define bfd_mach_m68010 3
+.#define bfd_mach_m68020 4
+.#define bfd_mach_m68030 5
+.#define bfd_mach_m68040 6
+.#define bfd_mach_m68060 7
. bfd_arch_vax, {* DEC Vax *}
. bfd_arch_i960, {* Intel 960 *}
. {* The order of the following is important.
@@ -103,6 +110,20 @@ DESCRIPTION
.#define bfd_mach_sparc_v9_p(mach) \
. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
. bfd_arch_mips, {* MIPS Rxxxx *}
+.#define bfd_mach_mips3000 3000
+.#define bfd_mach_mips3900 3900
+.#define bfd_mach_mips4000 4000
+.#define bfd_mach_mips4010 4010
+.#define bfd_mach_mips4100 4100
+.#define bfd_mach_mips4300 4300
+.#define bfd_mach_mips4400 4400
+.#define bfd_mach_mips4600 4600
+.#define bfd_mach_mips4650 4650
+.#define bfd_mach_mips5000 5000
+.#define bfd_mach_mips6000 6000
+.#define bfd_mach_mips8000 8000
+.#define bfd_mach_mips10000 10000
+.#define bfd_mach_mips16 16
. bfd_arch_i386, {* Intel 386 *}
.#define bfd_mach_i386_i386 0
.#define bfd_mach_i386_i8086 1
@@ -127,11 +148,27 @@ DESCRIPTION
.#define bfd_mach_z8002 2
. bfd_arch_h8500, {* Hitachi H8/500 *}
. bfd_arch_sh, {* Hitachi SH *}
+.#define bfd_mach_sh 0
+.#define bfd_mach_sh3 0x30
+.#define bfd_mach_sh3e 0x3e
+.#define bfd_mach_sh4 0x40
. bfd_arch_alpha, {* Dec Alpha *}
. bfd_arch_arm, {* Advanced Risc Machines ARM *}
+.#define bfd_mach_arm_2 1
+.#define bfd_mach_arm_2a 2
+.#define bfd_mach_arm_3 3
+.#define bfd_mach_arm_3M 4
+.#define bfd_mach_arm_4 5
+.#define bfd_mach_arm_4T 6
. bfd_arch_ns32k, {* National Semiconductors ns32000 *}
. bfd_arch_w65, {* WDC 65816 *}
+. bfd_arch_tic30, {* Texas Instruments TMS320C30 *}
+. bfd_arch_v850, {* NEC V850 *}
+.#define bfd_mach_v850 0
+. bfd_arch_arc, {* Argonaut RISC Core *}
+.#define bfd_mach_arc_base 0
. bfd_arch_m32r, {* Mitsubishi M32R/D *}
+.#define bfd_mach_m32r 0 {* backwards compatibility *}
. bfd_arch_mn10200, {* Matsushita MN10200 *}
. bfd_arch_mn10300, {* Matsushita MN10300 *}
. bfd_arch_last
@@ -174,6 +211,7 @@ DESCRIPTION
extern const bfd_arch_info_type bfd_a29k_arch;
extern const bfd_arch_info_type bfd_alpha_arch;
+extern const bfd_arch_info_type bfd_arc_arch;
extern const bfd_arch_info_type bfd_arm_arch;
extern const bfd_arch_info_type bfd_d10v_arch;
extern const bfd_arch_info_type bfd_h8300_arch;
@@ -192,11 +230,13 @@ extern const bfd_arch_info_type bfd_powerpc_arch;
extern const bfd_arch_info_type bfd_rs6000_arch;
extern const bfd_arch_info_type bfd_sh_arch;
extern const bfd_arch_info_type bfd_sparc_arch;
+extern const bfd_arch_info_type bfd_tic30_arch;
extern const bfd_arch_info_type bfd_vax_arch;
extern const bfd_arch_info_type bfd_we32k_arch;
extern const bfd_arch_info_type bfd_z8k_arch;
extern const bfd_arch_info_type bfd_ns32k_arch;
extern const bfd_arch_info_type bfd_w65_arch;
+extern const bfd_arch_info_type bfd_v850_arch;
static const bfd_arch_info_type * const bfd_archures_list[] =
{
@@ -205,6 +245,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
#else
&bfd_a29k_arch,
&bfd_alpha_arch,
+ &bfd_arc_arch,
&bfd_arm_arch,
&bfd_d10v_arch,
&bfd_h8300_arch,
@@ -223,11 +264,13 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_rs6000_arch,
&bfd_sh_arch,
&bfd_sparc_arch,
+ &bfd_tic30_arch,
&bfd_vax_arch,
&bfd_we32k_arch,
&bfd_z8k_arch,
&bfd_ns32k_arch,
&bfd_w65_arch,
+ &bfd_v850_arch,
#endif
0
};
@@ -291,6 +334,61 @@ bfd_scan_arch (string)
/*
FUNCTION
+ bfd_arch_list
+
+SYNOPSIS
+ const char **bfd_arch_list(void);
+
+DESCRIPTION
+ Return a freshly malloced NULL-terminated vector of the names
+ of all the valid BFD architectures. Do not modify the names.
+
+*/
+
+const char **
+bfd_arch_list ()
+{
+ int vec_length = 0;
+ const char **name_ptr;
+ const char **name_list;
+ const bfd_arch_info_type * const *app;
+
+ /* Determine the number of architectures */
+ vec_length = 0;
+ for (app = bfd_archures_list; *app != NULL; app++)
+ {
+ const bfd_arch_info_type *ap;
+ for (ap = *app; ap != NULL; ap = ap->next)
+ {
+ vec_length++;
+ }
+ }
+
+ name_list = (CONST char **)
+ bfd_malloc ((vec_length + 1) * sizeof (char **));
+ if (name_list == NULL)
+ return NULL;
+
+ /* Point the list at each of the names */
+ name_ptr = name_list;
+ for (app = bfd_archures_list; *app != NULL; app++)
+ {
+ const bfd_arch_info_type *ap;
+ for (ap = *app; ap != NULL; ap = ap->next)
+ {
+ *name_ptr = ap->printable_name;
+ name_ptr++;
+ }
+ }
+ *name_ptr = NULL;
+
+ return name_list;
+}
+
+
+
+/*
+FUNCTION
bfd_arch_get_compatible
SYNOPSIS
@@ -540,10 +638,58 @@ bfd_default_scan (info, string)
const char *ptr_tst;
unsigned long number;
enum bfd_architecture arch;
+ const char *printable_name_colon;
+
+ /* Exact match of the architecture name (ARCH_NAME) and also the
+ default architecture? */
+ if (strcasecmp (string, info->arch_name) == 0
+ && info->the_default)
+ return true;
- /* First test for an exact match */
- if (strcmp (string, info->printable_name) == 0)
+ /* Exact match of the machine name (PRINTABLE_NAME)? */
+ if (strcasecmp (string, info->printable_name) == 0)
return true;
+
+ /* Given that printable_name contains no colon, attempt to match:
+ ARCH_NAME [ ":" ] PRINTABLE_NAME? */
+ printable_name_colon = strchr (info->printable_name, ':');
+ if (printable_name_colon == NULL)
+ {
+ int strlen_arch_name = strlen (info->arch_name);
+ if (strncasecmp (string, info->arch_name, strlen_arch_name) == 0)
+ {
+ if (string[strlen_arch_name] == ':')
+ {
+ if (strcasecmp (string + strlen_arch_name + 1,
+ info->printable_name) == 0)
+ return true;
+ }
+ else
+ {
+ if (strcasecmp (string + strlen_arch_name,
+ info->printable_name) == 0)
+ return true;
+ }
+ }
+ }
+
+ /* Given that PRINTABLE_NAME has the form: <arch> ":" <mach>;
+ Attempt to match: <arch> <mach>? */
+ if (printable_name_colon != NULL)
+ {
+ int colon_index = printable_name_colon - info->printable_name;
+ if (strncasecmp (string, info->printable_name, colon_index) == 0
+ && strcasecmp (string + colon_index,
+ info->printable_name + colon_index + 1) == 0)
+ return true;
+ }
+
+ /* Given that PRINTABLE_NAME has the form: <arch> ":" <mach>; Do not
+ attempt to match just <mach>, it could be ambigious. This test
+ is left until later. */
+
+ /* NOTE: The below is retained for compatibility only. Please do not
+ add to this code */
/* See how much of the supplied string matches with the
architecture, eg the string m68k:68020 would match the 68k entry
@@ -569,69 +715,56 @@ bfd_default_scan (info, string)
}
number = 0;
- while (isdigit(*ptr_src))
+ while (isdigit ((unsigned char) *ptr_src))
{
number = number * 10 + *ptr_src - '0';
ptr_src++;
}
+ /* NOTE: The below is retained for compatibility only.
+ PLEASE DO NOT ADD TO THIS CODE. */
+
switch (number)
{
- case 65:
- arch = bfd_arch_w65;
- break;
-
- case 300:
- arch = bfd_arch_h8300;
- break;
-
- case 500:
- arch = bfd_arch_h8500;
+ /* FIXME: These are needed to parse IEEE objects. */
+ case 68000:
+ arch = bfd_arch_m68k;
+ number = bfd_mach_m68000;
break;
-
case 68010:
+ arch = bfd_arch_m68k;
+ number = bfd_mach_m68010;
+ break;
case 68020:
- case 68030:
- case 68040:
- case 68332:
- case 68050:
- case 68000:
- arch = bfd_arch_m68k;
+ arch = bfd_arch_m68k;
+ number = bfd_mach_m68020;
break;
-
- case 386:
- case 80386:
- case 486:
- case 80486:
- arch = bfd_arch_i386;
+ case 68030:
+ arch = bfd_arch_m68k;
+ number = bfd_mach_m68030;
break;
-
- case 29000:
- arch = bfd_arch_a29k;
+ case 68040:
+ arch = bfd_arch_m68k;
+ number = bfd_mach_m68040;
break;
-
- case 8000:
- arch = bfd_arch_z8k;
+ case 68332:
+ arch = bfd_arch_m68k;
+ /* FIXME: This should be cpu32. */
+ number = bfd_mach_m68020;
break;
case 32000:
arch = bfd_arch_we32k;
break;
- case 860:
- case 80860:
- arch = bfd_arch_i860;
- break;
- case 960:
- case 80960:
- arch = bfd_arch_i960;
+ case 3000:
+ arch = bfd_arch_mips;
+ number = bfd_mach_mips3000;
break;
- case 2000:
- case 3000:
case 4000:
- case 4400:
arch = bfd_arch_mips;
+ number = bfd_mach_mips4000;
break;
case 6000:
diff --git a/contrib/binutils/bfd/bfd-in.h b/contrib/binutils/bfd/bfd-in.h
index 3ce24e7..e2ed936 100644
--- a/contrib/binutils/bfd/bfd-in.h
+++ b/contrib/binutils/bfd/bfd-in.h
@@ -1,5 +1,6 @@
/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Contributed by Cygnus Support.
** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them;
@@ -309,6 +310,7 @@ typedef struct sec *sec_ptr;
#define bfd_section_name(bfd, ptr) ((ptr)->name)
#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
+#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
@@ -605,6 +607,8 @@ extern boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean bfd_elf_get_bfd_needed_list
+ PARAMS ((bfd *, struct bfd_link_needed_list **));
extern boolean bfd_elf32_size_dynamic_sections
PARAMS ((bfd *, const char *, const char *, boolean, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
diff --git a/contrib/binutils/bfd/bfd-in2.h b/contrib/binutils/bfd/bfd-in2.h
index f2d857a..9137998 100644
--- a/contrib/binutils/bfd/bfd-in2.h
+++ b/contrib/binutils/bfd/bfd-in2.h
@@ -1,5 +1,6 @@
/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Contributed by Cygnus Support.
** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them;
@@ -309,6 +310,7 @@ typedef struct sec *sec_ptr;
#define bfd_section_name(bfd, ptr) ((ptr)->name)
#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
+#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
@@ -605,6 +607,8 @@ extern boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean bfd_elf_get_bfd_needed_list
+ PARAMS ((bfd *, struct bfd_link_needed_list **));
extern boolean bfd_elf32_size_dynamic_sections
PARAMS ((bfd *, const char *, const char *, boolean, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
@@ -721,77 +725,77 @@ bfd_create PARAMS ((CONST char *filename, bfd *templ));
#define bfd_put_8(abfd, val, ptr) \
(*((unsigned char *)(ptr)) = (unsigned char)(val))
#define bfd_put_signed_8 \
- bfd_put_8
+ bfd_put_8
#define bfd_get_8(abfd, ptr) \
(*(unsigned char *)(ptr))
#define bfd_get_signed_8(abfd, ptr) \
- ((*(unsigned char *)(ptr) ^ 0x80) - 0x80)
+ ((*(unsigned char *)(ptr) ^ 0x80) - 0x80)
#define bfd_put_16(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
#define bfd_put_signed_16 \
- bfd_put_16
+ bfd_put_16
#define bfd_get_16(abfd, ptr) \
BFD_SEND(abfd, bfd_getx16, (ptr))
#define bfd_get_signed_16(abfd, ptr) \
- BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
+ BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
#define bfd_put_32(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
#define bfd_put_signed_32 \
- bfd_put_32
+ bfd_put_32
#define bfd_get_32(abfd, ptr) \
BFD_SEND(abfd, bfd_getx32, (ptr))
#define bfd_get_signed_32(abfd, ptr) \
- BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
+ BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
#define bfd_put_64(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
#define bfd_put_signed_64 \
- bfd_put_64
+ bfd_put_64
#define bfd_get_64(abfd, ptr) \
BFD_SEND(abfd, bfd_getx64, (ptr))
#define bfd_get_signed_64(abfd, ptr) \
- BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
+ BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
/* Byte swapping macros for file header data. */
#define bfd_h_put_8(abfd, val, ptr) \
- bfd_put_8 (abfd, val, ptr)
+ bfd_put_8 (abfd, val, ptr)
#define bfd_h_put_signed_8(abfd, val, ptr) \
- bfd_put_8 (abfd, val, ptr)
+ bfd_put_8 (abfd, val, ptr)
#define bfd_h_get_8(abfd, ptr) \
- bfd_get_8 (abfd, ptr)
+ bfd_get_8 (abfd, ptr)
#define bfd_h_get_signed_8(abfd, ptr) \
- bfd_get_signed_8 (abfd, ptr)
+ bfd_get_signed_8 (abfd, ptr)
#define bfd_h_put_16(abfd, val, ptr) \
BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
#define bfd_h_put_signed_16 \
- bfd_h_put_16
+ bfd_h_put_16
#define bfd_h_get_16(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx16,(ptr))
#define bfd_h_get_signed_16(abfd, ptr) \
- BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
+ BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
#define bfd_h_put_32(abfd, val, ptr) \
BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
#define bfd_h_put_signed_32 \
- bfd_h_put_32
+ bfd_h_put_32
#define bfd_h_get_32(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx32,(ptr))
#define bfd_h_get_signed_32(abfd, ptr) \
- BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
+ BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
#define bfd_h_put_64(abfd, val, ptr) \
BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
#define bfd_h_put_signed_64 \
- bfd_h_put_64
+ bfd_h_put_64
#define bfd_h_get_64(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx64,(ptr))
#define bfd_h_get_signed_64(abfd, ptr) \
- BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
+ BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
typedef struct sec
{
@@ -888,7 +892,7 @@ typedef struct sec
multiple times, the value of a symbol is the amount of
space it requires, and the largest symbol value is the one
used). Most targets have exactly one of these (which we
- translate to bfd_com_section_ptr), but ECOFF has two. */
+ translate to bfd_com_section_ptr), but ECOFF has two. */
#define SEC_IS_COMMON 0x8000
/* The section contains only debugging information. For
@@ -904,76 +908,76 @@ typedef struct sec
#define SEC_IN_MEMORY 0x20000
/* The contents of this section are to be excluded by the
- linker for executable and shared objects unless those
- objects are to be further relocated. */
+ linker for executable and shared objects unless those
+ objects are to be further relocated. */
#define SEC_EXCLUDE 0x40000
- /* The contents of this section are to be sorted by the
- based on the address specified in the associated symbol
- table. */
+ /* The contents of this section are to be sorted by the
+ based on the address specified in the associated symbol
+ table. */
#define SEC_SORT_ENTRIES 0x80000
- /* When linking, duplicate sections of the same name should be
- discarded, rather than being combined into a single section as
- is usually done. This is similar to how common symbols are
- handled. See SEC_LINK_DUPLICATES below. */
+ /* When linking, duplicate sections of the same name should be
+ discarded, rather than being combined into a single section as
+ is usually done. This is similar to how common symbols are
+ handled. See SEC_LINK_DUPLICATES below. */
#define SEC_LINK_ONCE 0x100000
- /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
- should handle duplicate sections. */
+ /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
+ should handle duplicate sections. */
#define SEC_LINK_DUPLICATES 0x600000
- /* This value for SEC_LINK_DUPLICATES means that duplicate
- sections with the same name should simply be discarded. */
+ /* This value for SEC_LINK_DUPLICATES means that duplicate
+ sections with the same name should simply be discarded. */
#define SEC_LINK_DUPLICATES_DISCARD 0x0
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if there are any duplicate sections, although
- it should still only link one copy. */
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if there are any duplicate sections, although
+ it should still only link one copy. */
#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if any duplicate sections are a different size. */
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if any duplicate sections are a different size. */
#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if any duplicate sections contain different
- contents. */
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if any duplicate sections contain different
+ contents. */
#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
- /* This section was created by the linker as part of dynamic
- relocation or other arcane processing. It is skipped when
- going through the first-pass output, trusting that someone
- else up the line will take care of it later. */
+ /* This section was created by the linker as part of dynamic
+ relocation or other arcane processing. It is skipped when
+ going through the first-pass output, trusting that someone
+ else up the line will take care of it later. */
#define SEC_LINKER_CREATED 0x800000
- /* End of section flags. */
+ /* End of section flags. */
- /* Some internal packed boolean fields. */
+ /* Some internal packed boolean fields. */
- /* See the vma field. */
- unsigned int user_set_vma : 1;
+ /* See the vma field. */
+ unsigned int user_set_vma : 1;
- /* Whether relocations have been processed. */
- unsigned int reloc_done : 1;
+ /* Whether relocations have been processed. */
+ unsigned int reloc_done : 1;
- /* A mark flag used by some of the linker backends. */
- unsigned int linker_mark : 1;
+ /* A mark flag used by some of the linker backends. */
+ unsigned int linker_mark : 1;
- /* End of internal packed boolean fields. */
+ /* End of internal packed boolean fields. */
/* The virtual memory address of the section - where it will be
at run time. The symbols are relocated against this. The
- user_set_vma flag is maintained by bfd; if it's not set, the
- backend can assign addresses (for example, in <<a.out>>, where
- the default address for <<.data>> is dependent on the specific
- target and various flags). */
+ user_set_vma flag is maintained by bfd; if it's not set, the
+ backend can assign addresses (for example, in <<a.out>>, where
+ the default address for <<.data>> is dependent on the specific
+ target and various flags). */
bfd_vma vma;
/* The load address of the section - where it would be in a
rom image; really only used for writing section header
- information. */
+ information. */
bfd_vma lma;
@@ -984,8 +988,8 @@ typedef struct sec
bfd_size_type _cooked_size;
/* The original size on disk of the section, in bytes. Normally this
- value is the same as the size, but if some relaxing has
- been done, then this value will be bigger. */
+ value is the same as the size, but if some relaxing has
+ been done, then this value will be bigger. */
bfd_size_type _raw_size;
@@ -1070,7 +1074,7 @@ typedef struct sec
bfd *owner;
- /* A symbol which points at this section only */
+ /* A symbol which points at this section only */
struct symbol_cache_entry *symbol;
struct symbol_cache_entry **symbol_ptr_ptr;
@@ -1080,7 +1084,7 @@ typedef struct sec
/* These sections are global, and are managed by BFD. The application
and target back end are not permitted to change the values in
- these sections. New code should use the section_ptr macros rather
+ these sections. New code should use the section_ptr macros rather
than referring directly to the const sections. The const sections
may eventually vanish. */
#define BFD_ABS_SECTION_NAME "*ABS*"
@@ -1155,12 +1159,19 @@ bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, ase
#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
BFD_SEND (obfd, _bfd_copy_private_section_data, \
- (ibfd, isection, obfd, osection))
+ (ibfd, isection, obfd, osection))
enum bfd_architecture
{
bfd_arch_unknown, /* File arch not known */
bfd_arch_obscure, /* Arch known, not one of these */
bfd_arch_m68k, /* Motorola 68xxx */
+#define bfd_mach_m68000 1
+#define bfd_mach_m68008 2
+#define bfd_mach_m68010 3
+#define bfd_mach_m68020 4
+#define bfd_mach_m68030 5
+#define bfd_mach_m68040 6
+#define bfd_mach_m68060 7
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
@@ -1177,23 +1188,37 @@ enum bfd_architecture
#define bfd_mach_i960_mc 4
#define bfd_mach_i960_xa 5
#define bfd_mach_i960_ca 6
-#define bfd_mach_i960_jx 7
+#define bfd_mach_i960_jx 7
#define bfd_mach_i960_hx 8
bfd_arch_a29k, /* AMD 29000 */
bfd_arch_sparc, /* SPARC */
-#define bfd_mach_sparc 1
+#define bfd_mach_sparc 1
/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
-#define bfd_mach_sparc_sparclet 2
-#define bfd_mach_sparc_sparclite 3
-#define bfd_mach_sparc_v8plus 4
-#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */
-#define bfd_mach_sparc_v9 6
-#define bfd_mach_sparc_v9a 7 /* with ultrasparc add'ns */
+#define bfd_mach_sparc_sparclet 2
+#define bfd_mach_sparc_sparclite 3
+#define bfd_mach_sparc_v8plus 4
+#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */
+#define bfd_mach_sparc_v9 6
+#define bfd_mach_sparc_v9a 7 /* with ultrasparc add'ns */
/* Nonzero if MACH has the v9 instruction set. */
#define bfd_mach_sparc_v9_p(mach) \
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
bfd_arch_mips, /* MIPS Rxxxx */
+#define bfd_mach_mips3000 3000
+#define bfd_mach_mips3900 3900
+#define bfd_mach_mips4000 4000
+#define bfd_mach_mips4010 4010
+#define bfd_mach_mips4100 4100
+#define bfd_mach_mips4300 4300
+#define bfd_mach_mips4400 4400
+#define bfd_mach_mips4600 4600
+#define bfd_mach_mips4650 4650
+#define bfd_mach_mips5000 5000
+#define bfd_mach_mips6000 6000
+#define bfd_mach_mips8000 8000
+#define bfd_mach_mips10000 10000
+#define bfd_mach_mips16 16
bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_i386 0
#define bfd_mach_i386_i8086 1
@@ -1214,15 +1239,31 @@ enum bfd_architecture
bfd_arch_hppa, /* HP PA RISC */
bfd_arch_d10v, /* Mitsubishi D10V */
bfd_arch_z8k, /* Zilog Z8000 */
-#define bfd_mach_z8001 1
-#define bfd_mach_z8002 2
+#define bfd_mach_z8001 1
+#define bfd_mach_z8002 2
bfd_arch_h8500, /* Hitachi H8/500 */
bfd_arch_sh, /* Hitachi SH */
+#define bfd_mach_sh 0
+#define bfd_mach_sh3 0x30
+#define bfd_mach_sh3e 0x3e
+#define bfd_mach_sh4 0x40
bfd_arch_alpha, /* Dec Alpha */
bfd_arch_arm, /* Advanced Risc Machines ARM */
+#define bfd_mach_arm_2 1
+#define bfd_mach_arm_2a 2
+#define bfd_mach_arm_3 3
+#define bfd_mach_arm_3M 4
+#define bfd_mach_arm_4 5
+#define bfd_mach_arm_4T 6
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
+ bfd_arch_tic30, /* Texas Instruments TMS320C30 */
+ bfd_arch_v850, /* NEC V850 */
+#define bfd_mach_v850 0
+ bfd_arch_arc, /* Argonaut RISC Core */
+#define bfd_mach_arc_base 0
bfd_arch_m32r, /* Mitsubishi M32R/D */
+#define bfd_mach_m32r 0 /* backwards compatibility */
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
bfd_arch_last
@@ -1239,10 +1280,10 @@ typedef struct bfd_arch_info
const char *printable_name;
unsigned int section_align_power;
/* true if this is the default machine for the architecture */
- boolean the_default;
+ boolean the_default;
const struct bfd_arch_info * (*compatible)
- PARAMS ((const struct bfd_arch_info *a,
- const struct bfd_arch_info *b));
+ PARAMS ((const struct bfd_arch_info *a,
+ const struct bfd_arch_info *b));
boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
@@ -1254,6 +1295,9 @@ bfd_printable_name PARAMS ((bfd *abfd));
const bfd_arch_info_type *
bfd_scan_arch PARAMS ((const char *string));
+const char **
+bfd_arch_list PARAMS ((void));
+
const bfd_arch_info_type *
bfd_arch_get_compatible PARAMS ((
const bfd *abfd,
@@ -1336,19 +1380,19 @@ typedef struct reloc_cache_entry
} arelent;
enum complain_overflow
{
- /* Do not complain on overflow. */
+ /* Do not complain on overflow. */
complain_overflow_dont,
- /* Complain if the bitfield overflows, whether it is considered
- as signed or unsigned. */
+ /* Complain if the bitfield overflows, whether it is considered
+ as signed or unsigned. */
complain_overflow_bitfield,
- /* Complain if the value overflows when considered as signed
- number. */
+ /* Complain if the value overflows when considered as signed
+ number. */
complain_overflow_signed,
- /* Complain if the value overflows when considered as an
- unsigned number. */
+ /* Complain if the value overflows when considered as an
+ unsigned number. */
complain_overflow_unsigned
};
@@ -1366,13 +1410,13 @@ struct reloc_howto_struct
unwanted data from the relocation. */
unsigned int rightshift;
- /* The size of the item to be relocated. This is *not* a
- power-of-two measure. To get the number of bytes operated
- on by a type of relocation, use bfd_get_reloc_size. */
+ /* The size of the item to be relocated. This is *not* a
+ power-of-two measure. To get the number of bytes operated
+ on by a type of relocation, use bfd_get_reloc_size. */
int size;
/* The number of bits in the item to be relocated. This is used
- when doing overflow checking. */
+ when doing overflow checking. */
unsigned int bitsize;
/* Notes that the relocation is relative to the location in the
@@ -1381,12 +1425,12 @@ struct reloc_howto_struct
being relocated. */
boolean pc_relative;
- /* The bit position of the reloc value in the destination.
- The relocated value is left shifted by this amount. */
+ /* The bit position of the reloc value in the destination.
+ The relocated value is left shifted by this amount. */
unsigned int bitpos;
- /* What type of overflow error should be checked for when
- relocating. */
+ /* What type of overflow error should be checked for when
+ relocating. */
enum complain_overflow complain_on_overflow;
/* If this field is non null, then the supplied function is
@@ -1394,8 +1438,8 @@ struct reloc_howto_struct
strange relocation methods to be accomodated (e.g., i960 callj
instructions). */
bfd_reloc_status_type (*special_function)
- PARAMS ((bfd *abfd,
- arelent *reloc_entry,
+ PARAMS ((bfd *abfd,
+ arelent *reloc_entry,
struct symbol_cache_entry *symbol,
PTR data,
asection *input_section,
@@ -1448,7 +1492,7 @@ struct reloc_howto_struct
} \
} \
}
-int
+unsigned int
bfd_get_reloc_size PARAMS ((reloc_howto_type *));
typedef struct relent_chain {
@@ -1457,6 +1501,14 @@ typedef struct relent_chain {
} arelent_chain;
bfd_reloc_status_type
+bfd_check_overflow
+ PARAMS ((enum complain_overflow how,
+ unsigned int bitsize,
+ unsigned int rightshift,
+ bfd_vma relocation));
+
+bfd_reloc_status_type
+
bfd_perform_relocation
PARAMS ((bfd *abfd,
arelent *reloc_entry,
@@ -1584,7 +1636,7 @@ relocation types already defined. */
BFD_RELOC_SPARC_BASE13,
BFD_RELOC_SPARC_BASE22,
-/* Some relocations we're using for SPARC V9 -- subject to change. */
+/* SPARC64 relocations */
#define BFD_RELOC_SPARC_64 BFD_RELOC_64
BFD_RELOC_SPARC_10,
BFD_RELOC_SPARC_11,
@@ -1597,10 +1649,17 @@ relocation types already defined. */
BFD_RELOC_SPARC_PC_LM22,
BFD_RELOC_SPARC_WDISP16,
BFD_RELOC_SPARC_WDISP19,
- BFD_RELOC_SPARC_GLOB_JMP,
BFD_RELOC_SPARC_7,
BFD_RELOC_SPARC_6,
BFD_RELOC_SPARC_5,
+#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
+ BFD_RELOC_SPARC_PLT64,
+ BFD_RELOC_SPARC_HIX22,
+ BFD_RELOC_SPARC_LOX10,
+ BFD_RELOC_SPARC_H44,
+ BFD_RELOC_SPARC_M44,
+ BFD_RELOC_SPARC_L44,
+ BFD_RELOC_SPARC_REGISTER,
/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
"addend" in some special way.
@@ -1706,6 +1765,7 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_MIPS_CALL_HI16,
BFD_RELOC_MIPS_CALL_LO16,
+
/* i386/elf relocations */
BFD_RELOC_386_GOT32,
BFD_RELOC_386_PLT32,
@@ -1810,6 +1870,22 @@ not stored in the instruction. */
BFD_RELOC_SH_DATA,
BFD_RELOC_SH_LABEL,
+/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
+be zero and is not stored in the instruction. */
+ BFD_RELOC_THUMB_PCREL_BRANCH9,
+ BFD_RELOC_THUMB_PCREL_BRANCH12,
+ BFD_RELOC_THUMB_PCREL_BRANCH23,
+
+/* Argonaut RISC Core (ARC) relocs.
+ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
+not stored in the instruction. The high 20 bits are installed in bits 26
+through 7 of the instruction. */
+ BFD_RELOC_ARC_B22_PCREL,
+
+/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not
+stored in the instruction. The high 24 bits are installed in bits 23
+through 0. */
+ BFD_RELOC_ARC_B26,
/* Mitsubishi D10V relocs.
This is a 10-bit reloc with the right 2 bits
@@ -1861,6 +1937,40 @@ used when the lower 16 bits are treated as signed. */
add3, load, and store instructions. */
BFD_RELOC_M32R_SDA16,
+/* This is a 9-bit reloc */
+ BFD_RELOC_V850_9_PCREL,
+
+/* This is a 22-bit reloc */
+ BFD_RELOC_V850_22_PCREL,
+
+/* This is a 16 bit offset from the short data area pointer. */
+ BFD_RELOC_V850_SDA_16_16_OFFSET,
+
+/* This is a 16 bit offset (of which only 15 bits are used) from the
+short data area pointer. */
+ BFD_RELOC_V850_SDA_15_16_OFFSET,
+
+/* This is a 16 bit offset from the zero data area pointer. */
+ BFD_RELOC_V850_ZDA_16_16_OFFSET,
+
+/* This is a 16 bit offset (of which only 15 bits are used) from the
+zero data area pointer. */
+ BFD_RELOC_V850_ZDA_15_16_OFFSET,
+
+/* This is an 8 bit offset (of which only 6 bits are used) from the
+tiny data area pointer. */
+ BFD_RELOC_V850_TDA_6_8_OFFSET,
+
+/* This is an 8bit offset (of which only 7 bits are used) from the tiny
+data area pointer. */
+ BFD_RELOC_V850_TDA_7_8_OFFSET,
+
+/* This is a 7 bit offset from the tiny data area pointer. */
+ BFD_RELOC_V850_TDA_7_7_OFFSET,
+
+/* This is a 16 bit offset from the tiny data area pointer. */
+ BFD_RELOC_V850_TDA_16_16_OFFSET,
+
/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
instruction. */
@@ -1869,6 +1979,11 @@ instruction. */
/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
instruction. */
BFD_RELOC_MN10300_16_PCREL,
+
+/* This is a 8bit DP reloc for the tms320c30, where the most
+significant 8 bits of a 24 bit word are placed into the least
+significant 8 bits of the opcode. */
+ BFD_RELOC_TIC30_LDP,
BFD_RELOC_UNUSED };
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
reloc_howto_type *
@@ -1881,114 +1996,114 @@ bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code));
typedef struct symbol_cache_entry
{
- /* A pointer to the BFD which owns the symbol. This information
- is necessary so that a back end can work out what additional
- information (invisible to the application writer) is carried
- with the symbol.
+ /* A pointer to the BFD which owns the symbol. This information
+ is necessary so that a back end can work out what additional
+ information (invisible to the application writer) is carried
+ with the symbol.
- This field is *almost* redundant, since you can use section->owner
- instead, except that some symbols point to the global sections
- bfd_{abs,com,und}_section. This could be fixed by making
- these globals be per-bfd (or per-target-flavor). FIXME. */
+ This field is *almost* redundant, since you can use section->owner
+ instead, except that some symbols point to the global sections
+ bfd_{abs,com,und}_section. This could be fixed by making
+ these globals be per-bfd (or per-target-flavor). FIXME. */
struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
- /* The text of the symbol. The name is left alone, and not copied; the
- application may not alter it. */
+ /* The text of the symbol. The name is left alone, and not copied; the
+ application may not alter it. */
CONST char *name;
- /* The value of the symbol. This really should be a union of a
+ /* The value of the symbol. This really should be a union of a
numeric value with a pointer, since some flags indicate that
a pointer to another symbol is stored here. */
symvalue value;
- /* Attributes of a symbol: */
+ /* Attributes of a symbol: */
#define BSF_NO_FLAGS 0x00
- /* The symbol has local scope; <<static>> in <<C>>. The value
- is the offset into the section of the data. */
-#define BSF_LOCAL 0x01
+ /* The symbol has local scope; <<static>> in <<C>>. The value
+ is the offset into the section of the data. */
+#define BSF_LOCAL 0x01
- /* The symbol has global scope; initialized data in <<C>>. The
- value is the offset into the section of the data. */
-#define BSF_GLOBAL 0x02
+ /* The symbol has global scope; initialized data in <<C>>. The
+ value is the offset into the section of the data. */
+#define BSF_GLOBAL 0x02
- /* The symbol has global scope and is exported. The value is
- the offset into the section of the data. */
-#define BSF_EXPORT BSF_GLOBAL /* no real difference */
+ /* The symbol has global scope and is exported. The value is
+ the offset into the section of the data. */
+#define BSF_EXPORT BSF_GLOBAL /* no real difference */
- /* A normal C symbol would be one of:
- <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
- <<BSF_GLOBAL>> */
+ /* A normal C symbol would be one of:
+ <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
+ <<BSF_GLOBAL>> */
- /* The symbol is a debugging record. The value has an arbitary
- meaning. */
-#define BSF_DEBUGGING 0x08
+ /* The symbol is a debugging record. The value has an arbitary
+ meaning. */
+#define BSF_DEBUGGING 0x08
- /* The symbol denotes a function entry point. Used in ELF,
- perhaps others someday. */
+ /* The symbol denotes a function entry point. Used in ELF,
+ perhaps others someday. */
#define BSF_FUNCTION 0x10
- /* Used by the linker. */
+ /* Used by the linker. */
#define BSF_KEEP 0x20
#define BSF_KEEP_G 0x40
- /* A weak global symbol, overridable without warnings by
- a regular global symbol of the same name. */
+ /* A weak global symbol, overridable without warnings by
+ a regular global symbol of the same name. */
#define BSF_WEAK 0x80
/* This symbol was created to point to a section, e.g. ELF's
- STT_SECTION symbols. */
+ STT_SECTION symbols. */
#define BSF_SECTION_SYM 0x100
- /* The symbol used to be a common symbol, but now it is
- allocated. */
+ /* The symbol used to be a common symbol, but now it is
+ allocated. */
#define BSF_OLD_COMMON 0x200
- /* The default value for common data. */
+ /* The default value for common data. */
#define BFD_FORT_COMM_DEFAULT_VALUE 0
- /* In some files the type of a symbol sometimes alters its
- location in an output file - ie in coff a <<ISFCN>> symbol
- which is also <<C_EXT>> symbol appears where it was
- declared and not at the end of a section. This bit is set
- by the target BFD part to convey this information. */
+ /* In some files the type of a symbol sometimes alters its
+ location in an output file - ie in coff a <<ISFCN>> symbol
+ which is also <<C_EXT>> symbol appears where it was
+ declared and not at the end of a section. This bit is set
+ by the target BFD part to convey this information. */
#define BSF_NOT_AT_END 0x400
- /* Signal that the symbol is the label of constructor section. */
+ /* Signal that the symbol is the label of constructor section. */
#define BSF_CONSTRUCTOR 0x800
- /* Signal that the symbol is a warning symbol. The name is a
- warning. The name of the next symbol is the one to warn about;
- if a reference is made to a symbol with the same name as the next
- symbol, a warning is issued by the linker. */
+ /* Signal that the symbol is a warning symbol. The name is a
+ warning. The name of the next symbol is the one to warn about;
+ if a reference is made to a symbol with the same name as the next
+ symbol, a warning is issued by the linker. */
#define BSF_WARNING 0x1000
- /* Signal that the symbol is indirect. This symbol is an indirect
- pointer to the symbol with the same name as the next symbol. */
+ /* Signal that the symbol is indirect. This symbol is an indirect
+ pointer to the symbol with the same name as the next symbol. */
#define BSF_INDIRECT 0x2000
- /* BSF_FILE marks symbols that contain a file name. This is used
- for ELF STT_FILE symbols. */
+ /* BSF_FILE marks symbols that contain a file name. This is used
+ for ELF STT_FILE symbols. */
#define BSF_FILE 0x4000
- /* Symbol is from dynamic linking information. */
-#define BSF_DYNAMIC 0x8000
+ /* Symbol is from dynamic linking information. */
+#define BSF_DYNAMIC 0x8000
/* The symbol denotes a data object. Used in ELF, and perhaps
others someday. */
-#define BSF_OBJECT 0x10000
+#define BSF_OBJECT 0x10000
flagword flags;
- /* A pointer to the section to which this symbol is
- relative. This will always be non NULL, there are special
+ /* A pointer to the section to which this symbol is
+ relative. This will always be non NULL, there are special
sections for undefined and absolute symbols. */
struct sec *section;
- /* Back end special data. */
+ /* Back end special data. */
union
{
PTR p;
@@ -2030,7 +2145,7 @@ bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymb
#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
- (ibfd, isymbol, obfd, osymbol))
+ (ibfd, isymbol, obfd, osymbol))
struct _bfd
{
/* The filename the application opened the BFD with. */
@@ -2230,6 +2345,9 @@ bfd_set_error_handler PARAMS ((bfd_error_handler_type));
void
bfd_set_error_program_name PARAMS ((const char *));
+bfd_error_handler_type
+bfd_get_error_handler PARAMS ((void));
+
long
bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect));
@@ -2238,7 +2356,7 @@ bfd_canonicalize_reloc
PARAMS ((bfd *abfd,
asection *sec,
arelent **loc,
- asymbol **syms));
+ asymbol **syms));
void
bfd_set_reloc
@@ -2272,19 +2390,19 @@ bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
#define bfd_copy_private_bfd_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
- (ibfd, obfd))
+ (ibfd, obfd))
boolean
bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
#define bfd_merge_private_bfd_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
- (ibfd, obfd))
+ (ibfd, obfd))
boolean
bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
#define bfd_set_private_flags(abfd, flags) \
BFD_SEND (abfd, _bfd_set_private_flags, \
- (abfd, flags))
+ (abfd, flags))
#define bfd_sizeof_headers(abfd, reloc) \
BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
@@ -2315,36 +2433,36 @@ bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
#define bfd_link_hash_table_create(abfd) \
- BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
+ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
#define bfd_link_add_symbols(abfd, info) \
- BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
+ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
#define bfd_final_link(abfd, info) \
- BFD_SEND (abfd, _bfd_final_link, (abfd, info))
+ BFD_SEND (abfd, _bfd_final_link, (abfd, info))
#define bfd_free_cached_info(abfd) \
BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
#define bfd_get_dynamic_symtab_upper_bound(abfd) \
- BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
+ BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
#define bfd_print_private_bfd_data(abfd, file)\
- BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
+ BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
- BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
+ BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
#define bfd_get_dynamic_reloc_upper_bound(abfd) \
- BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
+ BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
- BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
+ BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
extern bfd_byte *bfd_get_relocated_section_contents
- PARAMS ((bfd *, struct bfd_link_info *,
- struct bfd_link_order *, bfd_byte *,
- boolean, asymbol **));
+ PARAMS ((bfd *, struct bfd_link_info *,
+ struct bfd_link_order *, bfd_byte *,
+ boolean, asymbol **));
symindex
bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
@@ -2473,10 +2591,10 @@ CAT(NAME,_bfd_set_private_flags),\
CAT(NAME,_bfd_print_private_bfd_data)\
/* Called to copy BFD general private data from one object file
to another. */
- boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
+ boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
/* Called to merge BFD general private data from one object file
to a common output file when linking. */
- boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
+ boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
/* Called to copy BFD private section data from one object file
to another. */
boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
@@ -2484,9 +2602,9 @@ CAT(NAME,_bfd_print_private_bfd_data)\
/* Called to copy BFD private symbol data from one symbol
to another. */
boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
- bfd *, asymbol *));
+ bfd *, asymbol *));
/* Called to set private backend flags */
- boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
+ boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
/* Called to print private BFD data */
boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
@@ -2555,7 +2673,7 @@ CAT(NAME,_minisymbol_to_symbol)
struct symbol_cache_entry *,
symbol_info *));
#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
- boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
+ boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
diff --git a/contrib/binutils/bfd/bfd.c b/contrib/binutils/bfd/bfd.c
index a64a2d5..8293a72 100644
--- a/contrib/binutils/bfd/bfd.c
+++ b/contrib/binutils/bfd/bfd.c
@@ -1,5 +1,5 @@
/* Generic BFD library interface and support routines.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -508,6 +508,24 @@ bfd_set_error_program_name (name)
{
_bfd_error_program_name = name;
}
+
+
+/*
+FUNCTION
+ bfd_get_error_handler
+
+SYNOPSIS
+ bfd_error_handler_type bfd_get_error_handler (void);
+
+DESCRIPTION
+ Return the BFD error handler function.
+*/
+
+bfd_error_handler_type
+bfd_get_error_handler ()
+{
+ return _bfd_error_handler;
+}
/*
SECTION
@@ -910,11 +928,11 @@ bfd_scan_vma (string, end, base)
/* Speed could be improved with a table like hex_value[] in gas. */
#define HEX_VALUE(c) \
- (isxdigit(c) ? \
- (isdigit(c) ? \
- (c - '0') : \
- (10 + c - (islower(c) ? 'a' : 'A'))) : \
- 42)
+ (isxdigit ((unsigned char) c) \
+ ? (isdigit ((unsigned char) c) \
+ ? (c - '0') \
+ : (10 + c - (islower ((unsigned char) c) ? 'a' : 'A'))) \
+ : 42)
for (value = 0; (digit = HEX_VALUE(*string)) < base; string++)
{
diff --git a/contrib/binutils/bfd/binary.c b/contrib/binutils/bfd/binary.c
index c42f143..8fcbadc 100644
--- a/contrib/binutils/bfd/binary.c
+++ b/contrib/binutils/bfd/binary.c
@@ -1,5 +1,5 @@
/* BFD back-end for binary objects.
- Copyright 1994, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1994, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -155,7 +155,7 @@ mangle_name (abfd, suffix)
/* Change any non-alphanumeric characters to underscores. */
for (p = buf; *p; p++)
- if (! isalnum (*p))
+ if (! isalnum ((unsigned char) *p))
*p = '_';
return buf;
@@ -260,6 +260,8 @@ binary_set_section_contents (abfd, sec, data, offset, size)
meaningful in the binary format. */
if ((sec->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
return true;
+ if ((sec->flags & SEC_NEVER_LOAD) != 0)
+ return true;
if (! abfd->output_has_begun)
{
diff --git a/contrib/binutils/bfd/coff-i386.c b/contrib/binutils/bfd/coff-i386.c
index d459303..7898cc1 100644
--- a/contrib/binutils/bfd/coff-i386.c
+++ b/contrib/binutils/bfd/coff-i386.c
@@ -1,5 +1,6 @@
/* BFD back-end for Intel 386 COFF files.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -30,6 +31,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "coff/pe.h"
#endif
+#ifdef COFF_GO32_EXE
+#include "coff/go32exe.h"
+#endif
+
#include "libcoff.h"
static bfd_reloc_status_type coff_i386_reloc
@@ -70,9 +75,9 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
if (output_bfd == (bfd *) NULL)
return bfd_reloc_continue;
-
if (bfd_is_com_section (symbol->section))
{
+#ifndef COFF_WITH_PE
/* We are relocating a common symbol. The current value in the
object file is ORIG + OFFSET, where ORIG is the value of the
common symbol as seen by the object file when it was compiled
@@ -85,6 +90,10 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
the common symbol which we are going to put in the final
object file. NEW is symbol->value. */
diff = symbol->value + reloc_entry->addend;
+#else
+ /* In PE mode, we do not offset the common symbol. */
+ diff = reloc_entry->addend;
+#endif
}
else
{
@@ -95,13 +104,10 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
diff = reloc_entry->addend;
}
-
#ifdef COFF_WITH_PE
- if (reloc_entry->howto->type == 7)
- {
-/* diff -= coff_data(output_bfd)->link_info->pe_info.image_base.value;*/
- exit(1);
- }
+ /* FIXME: How should this case be handled? */
+ if (reloc_entry->howto->type == R_IMAGEBASE && diff != 0)
+ abort ();
#endif
#define DOIT(x) \
@@ -332,9 +338,51 @@ static reloc_howto_type howto_table[] =
cache_ptr->addend += asect->vma; \
}
-/* We use the special COFF backend linker. */
+/* We use the special COFF backend linker. For normal i386 COFF, we
+ can use the generic relocate_section routine. For PE, we need our
+ own routine. */
+
+#ifndef COFF_WITH_PE
+
#define coff_relocate_section _bfd_coff_generic_relocate_section
+#else /* COFF_WITH_PE */
+
+/* The PE relocate section routine. The only difference between this
+ and the regular routine is that we don't want to do anything for a
+ relocateable link. */
+
+static boolean coff_pe_i386_relocate_section
+ PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ struct internal_reloc *, struct internal_syment *, asection **));
+
+static boolean
+coff_pe_i386_relocate_section (output_bfd, info, input_bfd,
+ input_section, contents, relocs, syms,
+ sections)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ struct internal_reloc *relocs;
+ struct internal_syment *syms;
+ asection **sections;
+{
+ if (info->relocateable)
+ return true;
+
+ return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
+ input_section, contents,
+ relocs, syms, sections);
+}
+
+#define coff_relocate_section coff_pe_i386_relocate_section
+
+#endif /* COFF_WITH_PE */
+
+/* Convert an rtype to howto for the COFF backend linker. */
+
static reloc_howto_type *
coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
bfd *abfd;
@@ -366,28 +414,40 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
BFD_ASSERT (h != NULL);
-
#ifndef COFF_WITH_PE
- /* I think we *do* want to bypass this. If we don't, I have seen some data
- parameters get the wrong relcation address. If I link two versions
- with and without this section bypassed and then do a binary comparison,
- the addresses which are different can be looked up in the map. The
- case in which this section has been bypassed has addresses which correspond
- to values I can find in the map */
+ /* I think we *do* want to bypass this. If we don't, I have
+ seen some data parameters get the wrong relocation address.
+ If I link two versions with and without this section bypassed
+ and then do a binary comparison, the addresses which are
+ different can be looked up in the map. The case in which
+ this section has been bypassed has addresses which correspond
+ to values I can find in the map. */
*addendp -= sym->n_value;
#endif
}
+#ifndef COFF_WITH_PE
/* If the output symbol is common (in which case this must be a
relocateable link), we need to add in the final size of the
common symbol. */
if (h != NULL && h->root.type == bfd_link_hash_common)
*addendp += h->root.u.c.size;
-
+#endif
#ifdef COFF_WITH_PE
if (howto->pc_relative)
- *addendp -= 4;
+ {
+ *addendp -= 4;
+
+ /* If the symbol is defined, then the generic code is going to
+ add back the symbol value in order to cancel out an
+ adjustment it made to the addend. However, we set the addend
+ to 0 at the start of this function. We need to adjust here,
+ to avoid the adjustment the generic code will make. FIXME:
+ This is getting a bit hackish. */
+ if (sym != NULL && sym->n_scnum != 0)
+ *addendp -= sym->n_value;
+ }
if (rel->r_type == R_IMAGEBASE)
{
@@ -421,17 +481,94 @@ coff_i386_reloc_type_lookup (abfd, code)
}
}
+#define coff_rtype_to_howto coff_i386_rtype_to_howto
+
+#ifdef TARGET_UNDERSCORE
+/* If i386 gcc uses underscores for symbol names, then it does not use
+ a leading dot for local labels, so if TARGET_UNDERSCORE is defined
+ we treat all symbols starting with L as local. */
-#define coff_rtype_to_howto coff_i386_rtype_to_howto
+static boolean coff_i386_is_local_label_name PARAMS ((bfd *, const char *));
+
+static boolean
+coff_i386_is_local_label_name (abfd, name)
+ bfd *abfd;
+ const char *name;
+{
+ if (name[0] == 'L')
+ return true;
+
+ return _bfd_coff_is_local_label_name (abfd, name);
+}
+
+#define coff_bfd_is_local_label_name coff_i386_is_local_label_name
+
+#endif /* TARGET_UNDERSCORE */
#include "coffcode.h"
static const bfd_target *
-i3coff_object_p(a)
- bfd *a;
+i3coff_object_p (abfd)
+ bfd *abfd;
{
- return coff_object_p(a);
+#ifdef COFF_IMAGE_WITH_PE
+ /* We need to hack badly to handle a PE image correctly. In PE
+ images created by the GNU linker, the offset to the COFF header
+ is always the size. However, this is not the case in images
+ generated by other PE linkers. The PE format stores a four byte
+ offset to the PE signature just before the COFF header at
+ location 0x3c of the file. We pick up that offset, verify that
+ the PE signature is there, and then set ourselves up to read in
+ the COFF header. */
+ {
+ bfd_byte ext_offset[4];
+ file_ptr offset;
+ bfd_byte ext_signature[4];
+ unsigned long signature;
+
+ if (bfd_seek (abfd, 0x3c, SEEK_SET) != 0
+ || bfd_read (ext_offset, 1, 4, abfd) != 4)
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+ offset = bfd_h_get_32 (abfd, ext_offset);
+ if (bfd_seek (abfd, offset, SEEK_SET) != 0
+ || bfd_read (ext_signature, 1, 4, abfd) != 4)
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+ signature = bfd_h_get_32 (abfd, ext_signature);
+
+ if (signature != 0x4550)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ /* Here is the hack. coff_object_p wants to read filhsz bytes to
+ pick up the COFF header. We adjust so that that will work. 20
+ is the size of the i386 COFF filehdr. */
+
+ if (bfd_seek (abfd,
+ (bfd_tell (abfd)
+ - bfd_coff_filhsz (abfd)
+ + 20),
+ SEEK_SET)
+ != 0)
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+ }
+#endif
+
+ return coff_object_p (abfd);
}
const bfd_target
@@ -455,9 +592,11 @@ const bfd_target
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
#ifndef COFF_WITH_PE
- (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
+ | SEC_CODE | SEC_DATA),
#else
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
+ | SEC_CODE | SEC_DATA
| SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
#endif
diff --git a/contrib/binutils/bfd/coff-sh.c b/contrib/binutils/bfd/coff-sh.c
index cf8c2e6..fd4f218 100644
--- a/contrib/binutils/bfd/coff-sh.c
+++ b/contrib/binutils/bfd/coff-sh.c
@@ -1,5 +1,5 @@
/* BFD back-end for Hitachi Super-H COFF binaries.
- Copyright 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
@@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static bfd_reloc_status_type sh_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static long get_symbol_value PARAMS ((asymbol *));
+static boolean sh_merge_private_data PARAMS ((bfd *, bfd *));
static boolean sh_relax_section
PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
static boolean sh_relax_delete_bytes
@@ -275,6 +276,20 @@ static reloc_howto_type sh_coff_howtos[] =
true, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_SH_SWITCH8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ sh_reloc, /* special_function */
+ "r_switch8", /* name */
+ true, /* partial_inplace */
+ 0xff, /* src_mask */
+ 0xff, /* dst_mask */
false) /* pcrel_offset */
};
@@ -347,7 +362,8 @@ get_symbol_value (symbol)
cache_ptr->addend = - (ptr->section->vma + ptr->value); \
else \
cache_ptr->addend = 0; \
- if ((reloc).r_type == R_SH_SWITCH16 \
+ if ((reloc).r_type == R_SH_SWITCH8 \
+ || (reloc).r_type == R_SH_SWITCH16 \
|| (reloc).r_type == R_SH_SWITCH32 \
|| (reloc).r_type == R_SH_USES \
|| (reloc).r_type == R_SH_COUNT \
@@ -426,6 +442,32 @@ sh_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
return bfd_reloc_ok;
}
+/* This routine checks for linking big and little endian objects
+ together. */
+
+static boolean
+sh_merge_private_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ if (ibfd->xvec->byteorder != obfd->xvec->byteorder
+ && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
+ {
+ (*_bfd_error_handler)
+ ("%s: compiled for a %s endian system and target is %s endian",
+ bfd_get_filename (ibfd),
+ bfd_big_endian (ibfd) ? "big" : "little",
+ bfd_big_endian (obfd) ? "big" : "little");
+
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
+
+ return true;
+}
+
+#define coff_bfd_merge_private_bfd_data sh_merge_private_data
+
/* We can do relaxing. */
#define coff_bfd_relax_section sh_relax_section
@@ -557,7 +599,9 @@ sh_relax_section (abfd, sec, link_info, again)
the register load. The 4 is because the r_offset field is
computed as though it were a jump offset, which are based
from 4 bytes after the jump instruction. */
- laddr = irel->r_vaddr - sec->vma + 4 + irel->r_offset;
+ laddr = irel->r_vaddr - sec->vma + 4;
+ /* Careful to sign extend the 32-bit offset. */
+ laddr += ((irel->r_offset & 0xffffffff) ^ 0x80000000) - 0x80000000;
if (laddr >= sec->_raw_size)
{
(*_bfd_error_handler) ("%s: 0x%lx: warning: bad R_SH_USES offset",
@@ -567,8 +611,7 @@ sh_relax_section (abfd, sec, link_info, again)
}
insn = bfd_get_16 (abfd, contents + laddr);
- /* If the instruction is not mov.l NN,rN, we don't know what to
- do. */
+ /* If the instruction is not mov.l NN,rN, we don't know what to do. */
if ((insn & 0xf000) != 0xd000)
{
((*_bfd_error_handler)
@@ -928,11 +971,12 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
/* Adjust all the relocs. */
for (irel = coff_section_data (abfd, sec)->relocs; irel < irelend; irel++)
{
- bfd_vma nraddr, start, stop;
+ bfd_vma nraddr, stop;
+ bfd_vma start = 0;
int insn = 0;
struct internal_syment sym;
int off, adjust, oinsn;
- bfd_signed_vma voff;
+ bfd_signed_vma voff = 0;
boolean overflow;
/* Get the new reloc address. */
@@ -950,7 +994,8 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
&& irel->r_vaddr - sec->vma < addr + count
&& irel->r_type != R_SH_ALIGN
&& irel->r_type != R_SH_CODE
- && irel->r_type != R_SH_DATA)
+ && irel->r_type != R_SH_DATA
+ && irel->r_type != R_SH_LABEL)
irel->r_type = R_SH_UNUSED;
/* If this is a PC relative reloc, see if the range it covers
@@ -1034,6 +1079,7 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
stop = (start &~ (bfd_vma) 3) + 4 + off * 4;
break;
+ case R_SH_SWITCH8:
case R_SH_SWITCH16:
case R_SH_SWITCH32:
/* These relocs types represent
@@ -1059,6 +1105,8 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
if (irel->r_type == R_SH_SWITCH16)
voff = bfd_get_signed_16 (abfd, contents + nraddr);
+ else if (irel->r_type == R_SH_SWITCH8)
+ voff = bfd_get_8 (abfd, contents + nraddr);
else
voff = bfd_get_signed_32 (abfd, contents + nraddr);
stop = (bfd_vma) ((bfd_signed_vma) start + voff);
@@ -1123,6 +1171,13 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
bfd_put_16 (abfd, insn, contents + nraddr);
break;
+ case R_SH_SWITCH8:
+ voff += adjust;
+ if (voff < 0 || voff >= 0xff)
+ overflow = true;
+ bfd_put_8 (abfd, voff, contents + nraddr);
+ break;
+
case R_SH_SWITCH16:
voff += adjust;
if (voff < - 0x8000 || voff >= 0x8000)
@@ -2406,7 +2461,8 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
}
else
{
- if (symndx < 0 || symndx >= obj_raw_syment_count (input_bfd))
+ if (symndx < 0
+ || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
{
(*_bfd_error_handler)
("%s: illegal symbol index %ld in relocs",
@@ -2716,3 +2772,173 @@ const bfd_target shlcoff_vec =
COFF_SWAP_TABLE,
};
+
+/* Some people want versions of the SH COFF target which do not align
+ to 16 byte boundaries. We implement that by adding a couple of new
+ target vectors. These are just like the ones above, but they
+ change the default section alignment. To generate them in the
+ assembler, use -small. To use them in the linker, use -b
+ coff-sh{l}-small and -oformat coff-sh{l}-small.
+
+ Yes, this is a horrible hack. A general solution for setting
+ section alignment in COFF is rather complex. ELF handles this
+ correctly. */
+
+/* Only recognize the small versions if the target was not defaulted.
+ Otherwise we won't recognize the non default endianness. */
+
+static const bfd_target *
+coff_small_object_p (abfd)
+ bfd *abfd;
+{
+ if (abfd->target_defaulted)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+ return coff_object_p (abfd);
+}
+
+/* Set the section alignment for the small versions. */
+
+static boolean
+coff_small_new_section_hook (abfd, section)
+ bfd *abfd;
+ asection *section;
+{
+ if (! coff_new_section_hook (abfd, section))
+ return false;
+
+ /* We must align to at least a four byte boundary, because longword
+ accesses must be on a four byte boundary. */
+ if (section->alignment_power == COFF_DEFAULT_SECTION_ALIGNMENT_POWER)
+ section->alignment_power = 2;
+
+ return true;
+}
+
+/* This is copied from bfd_coff_std_swap_table so that we can change
+ the default section alignment power. */
+
+static const bfd_coff_backend_data bfd_coff_small_swap_table =
+{
+ coff_swap_aux_in, coff_swap_sym_in, coff_swap_lineno_in,
+ coff_swap_aux_out, coff_swap_sym_out,
+ coff_swap_lineno_out, coff_swap_reloc_out,
+ coff_swap_filehdr_out, coff_swap_aouthdr_out,
+ coff_swap_scnhdr_out,
+ FILHSZ, AOUTSZ, SCNHSZ, SYMESZ, AUXESZ, RELSZ, LINESZ,
+#ifdef COFF_LONG_FILENAMES
+ true,
+#else
+ false,
+#endif
+#ifdef COFF_LONG_SECTION_NAMES
+ true,
+#else
+ false,
+#endif
+ 2,
+ coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in,
+ coff_swap_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
+ coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
+ coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
+ coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
+ coff_sym_is_global, coff_compute_section_file_positions,
+ coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
+ coff_adjust_symndx, coff_link_add_one_symbol,
+ coff_link_output_has_begun, coff_final_link_postscript
+};
+
+#define coff_small_close_and_cleanup \
+ coff_close_and_cleanup
+#define coff_small_bfd_free_cached_info \
+ coff_bfd_free_cached_info
+#define coff_small_get_section_contents \
+ coff_get_section_contents
+#define coff_small_get_section_contents_in_window \
+ coff_get_section_contents_in_window
+
+const bfd_target shcoff_small_vec =
+{
+ "coff-sh-small", /* name */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_BIG, /* data byte order is big */
+ BFD_ENDIAN_BIG, /* header byte order is big */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC),
+ '_', /* leading symbol underscore */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+
+ {_bfd_dummy_target, coff_small_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, _bfd_dummy_target},
+ {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
+ bfd_false},
+ {bfd_false, coff_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (coff_small),
+ BFD_JUMP_TABLE_COPY (coff),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ (PTR) &bfd_coff_small_swap_table
+};
+
+const bfd_target shlcoff_small_vec =
+{
+ "coff-shl-small", /* name */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little endian too*/
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC),
+ '_', /* leading symbol underscore */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
+
+ {_bfd_dummy_target, coff_small_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, _bfd_dummy_target},
+ {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
+ bfd_false},
+ {bfd_false, coff_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (coff_small),
+ BFD_JUMP_TABLE_COPY (coff),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ (PTR) &bfd_coff_small_swap_table
+};
diff --git a/contrib/binutils/bfd/coff-tic30.c b/contrib/binutils/bfd/coff-tic30.c
new file mode 100644
index 0000000..3ff8c59
--- /dev/null
+++ b/contrib/binutils/bfd/coff-tic30.c
@@ -0,0 +1,206 @@
+/* BFD back-end for TMS320C30 coff binaries.
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "bfdlink.h"
+#include "coff/tic30.h"
+#include "coff/internal.h"
+#include "libcoff.h"
+
+#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
+
+reloc_howto_type tic30_coff_howto_table[] =
+{
+ HOWTO (R_TIC30_ABS16, 2, 1, 16, false, 0, 0, NULL,
+ "16", false, 0x0000FFFF, 0x0000FFFF, false),
+ HOWTO (R_TIC30_ABS24, 2, 2, 24, false, 8, complain_overflow_bitfield, NULL,
+ "24", false, 0xFFFFFF00, 0xFFFFFF00, false),
+ HOWTO (R_TIC30_LDP, 18, 0, 24, false, 0, complain_overflow_bitfield, NULL,
+ "LDP", false, 0x00FF0000, 0x000000FF, false),
+ HOWTO (R_TIC30_ABS32, 2, 2, 32, false, 0, complain_overflow_bitfield, NULL,
+ "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
+ HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL,
+ "PCREL", false, 0x0000FFFF, 0x0000FFFF, false),
+ {-1}
+};
+
+#ifndef coff_bfd_reloc_type_lookup
+#define coff_bfd_reloc_type_lookup tic30_coff_reloc_type_lookup
+
+/* For the case statement use the code values used in tc_gen_reloc to
+ map to the howto table entries that match those in both the aout
+ and coff implementations. */
+reloc_howto_type *
+tic30_coff_reloc_type_lookup (abfd, code)
+ bfd *abfd;
+ bfd_reloc_code_real_type code;
+{
+ switch (code)
+ {
+ case BFD_RELOC_8:
+ case BFD_RELOC_TIC30_LDP:
+ return &tic30_coff_howto_table[2];
+ case BFD_RELOC_16:
+ return &tic30_coff_howto_table[0];
+ case BFD_RELOC_24:
+ return &tic30_coff_howto_table[1];
+ case BFD_RELOC_16_PCREL:
+ return &tic30_coff_howto_table[4];
+ case BFD_RELOC_32:
+ return &tic30_coff_howto_table[3];
+ default:
+ return (reloc_howto_type *) NULL;
+ }
+}
+
+#endif
+
+/* Turn a howto into a reloc number */
+
+static int
+coff_tic30_select_reloc (howto)
+ reloc_howto_type *howto;
+{
+ return howto->type;
+}
+
+#define SELECT_RELOC(x,howto) x.r_type = coff_tic30_select_reloc(howto)
+
+
+#define BADMAG(x) TIC30BADMAG(x)
+#define TIC30 1 /* Customize coffcode.h */
+#define __A_MAGIC_SET__
+
+/* Code to swap in the reloc */
+#define SWAP_IN_RELOC_OFFSET bfd_h_get_32
+#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
+#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) dst->r_stuff[0] = 'S'; \
+dst->r_stuff[1] = 'C';
+
+/* Code to turn a r_type into a howto ptr, uses the above howto table. */
+
+static void
+rtype2howto (internal, dst)
+ arelent *internal;
+ struct internal_reloc *dst;
+{
+ switch (dst->r_type)
+ {
+ case R_TIC30_ABS16:
+ internal->howto = &tic30_coff_howto_table[0];
+ break;
+ case R_TIC30_ABS24:
+ internal->howto = &tic30_coff_howto_table[1];
+ break;
+ case R_TIC30_ABS32:
+ internal->howto = &tic30_coff_howto_table[3];
+ break;
+ case R_TIC30_LDP:
+ internal->howto = &tic30_coff_howto_table[2];
+ break;
+ case R_TIC30_PC16:
+ internal->howto = &tic30_coff_howto_table[4];
+ break;
+ default:
+ abort ();
+ break;
+ }
+}
+
+#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
+
+/* Perform any necessary magic to the addend in a reloc entry */
+
+#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
+ cache_ptr->addend = ext_reloc.r_offset;
+
+
+#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \
+ reloc_processing(relent, reloc, symbols, abfd, section)
+
+static void
+reloc_processing (relent, reloc, symbols, abfd, section)
+ arelent *relent;
+ struct internal_reloc *reloc;
+ asymbol **symbols;
+ bfd *abfd;
+ asection *section;
+{
+ relent->address = reloc->r_vaddr;
+ rtype2howto (relent, reloc);
+
+ if (reloc->r_symndx > 0)
+ {
+ relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
+ }
+ else
+ {
+ relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ }
+ relent->addend = reloc->r_offset;
+ relent->address -= section->vma;
+}
+
+#include "coffcode.h"
+
+const bfd_target tic30_coff_vec =
+{
+ "coff-tic30", /* name */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_BIG, /* data byte order is big */
+ BFD_ENDIAN_LITTLE, /* header byte order is little */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ '_', /* leading symbol underscore */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
+
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, _bfd_dummy_target},
+ {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
+ bfd_false},
+ {bfd_false, coff_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (coff),
+ BFD_JUMP_TABLE_COPY (coff),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ COFF_SWAP_TABLE
+};
diff --git a/contrib/binutils/bfd/coffcode.h b/contrib/binutils/bfd/coffcode.h
index dd01cb8..f0514c4 100644
--- a/contrib/binutils/bfd/coffcode.h
+++ b/contrib/binutils/bfd/coffcode.h
@@ -1,5 +1,6 @@
/* Support for the generic parts of most COFF variants, for BFD.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -503,7 +504,7 @@ styp_to_sec_flags (abfd, hdr, name)
section VMA and the file offset match. If we don't know
COFF_PAGE_SIZE, we can't ensure the correct correspondence,
and demand page loading of the file will fail. */
-#ifdef COFF_PAGE_SIZE
+#if defined (COFF_PAGE_SIZE) && !defined (COFF_ALIGN_IN_S_FLAGS)
sec_flags |= SEC_DEBUGGING;
#endif
}
@@ -861,6 +862,12 @@ dependent COFF routines:
. boolean collect,
. struct bfd_link_hash_entry **hashp));
.
+. boolean (*_bfd_coff_link_output_has_begun) PARAMS ((
+. bfd * abfd ));
+. boolean (*_bfd_coff_final_link_postscript) PARAMS ((
+. bfd * abfd,
+. struct coff_final_link_info * pfinfo));
+.
.} bfd_coff_backend_data;
.
.#define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
@@ -975,6 +982,11 @@ dependent COFF routines:
. ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
. (info, abfd, name, flags, section, value, string, cp, coll, hashp))
.
+.#define bfd_coff_link_output_has_begun(a) \
+. ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a))
+.#define bfd_coff_final_link_postscript(a,p) \
+. ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p))
+.
*/
/* See whether the magic number matches. */
@@ -1016,6 +1028,8 @@ coff_new_section_hook (abfd, section)
bfd * abfd;
asection * section;
{
+ combined_entry_type *native;
+
section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER;
#ifdef RS6000COFF_C
@@ -1032,9 +1046,21 @@ coff_new_section_hook (abfd, section)
@@ The 10 is a guess at a plausible maximum number of aux entries
(but shouldn't be a constant). */
- coffsymbol (section->symbol)->native =
- (combined_entry_type *) bfd_zalloc (abfd,
- sizeof (combined_entry_type) * 10);
+ native = ((combined_entry_type *)
+ bfd_zalloc (abfd, sizeof (combined_entry_type) * 10));
+ if (native == NULL)
+ return false;
+
+ /* We don't need to set up n_name, n_value, or n_scnum in the native
+ symbol information, since they'll be overriden by the BFD symbol
+ anyhow. However, we do need to set the type and storage class,
+ in case this symbol winds up getting written out. The value 0
+ for n_numaux is already correct. */
+
+ native->u.syment.n_type = T_NULL;
+ native->u.syment.n_sclass = C_STAT;
+
+ coffsymbol (section->symbol)->native = native;
/* The .stab section must be aligned to 2**2 at most, because
otherwise there may be gaps in the section which gdb will not
@@ -1056,7 +1082,7 @@ coff_new_section_hook (abfd, section)
return true;
}
-#ifdef I960
+#ifdef COFF_ALIGN_IN_SECTION_HEADER
/* Set the alignment of a BFD section. */
@@ -1071,13 +1097,16 @@ coff_set_alignment_hook (abfd, section, scnhdr)
struct internal_scnhdr *hdr = (struct internal_scnhdr *) scnhdr;
unsigned int i;
+#ifdef I960
+ /* Extract ALIGN from 2**ALIGN stored in section header */
for (i = 0; i < 32; i++)
if ((1 << i) >= hdr->s_align)
break;
+#endif
section->alignment_power = i;
}
-#else /* ! I960 */
+#else /* ! COFF_ALIGN_IN_SECTION_HEADER */
#ifdef COFF_WITH_PE
/* a couple of macros to help setting the alignment power field */
@@ -1222,7 +1251,7 @@ coff_set_alignment_hook (abfd, section, scnhdr)
#endif /* ! RS6000COFF_C */
#endif /* ! COFF_WITH_PE */
-#endif /* ! I960 */
+#endif /* ! COFF_ALIGN_IN_SECTION_HEADER */
#ifndef coff_mkobject
@@ -1306,6 +1335,12 @@ coff_mkobject_hook (abfd, filehdr, aouthdr)
}
#endif
+#ifdef ARM
+ /* Set the flags field from the COFF header read in */
+ if (! coff_arm_bfd_set_private_flags (abfd, internal_f->f_flags))
+ coff->flags = 0;
+#endif
+
return (PTR) coff;
}
#endif
@@ -1354,7 +1389,16 @@ coff_set_arch_mach_hook (abfd, filehdr)
#ifdef ARMMAGIC
case ARMMAGIC:
arch = bfd_arch_arm;
- machine =0;
+ switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK)
+ {
+ case F_ARM_2: machine = bfd_mach_arm_2; break;
+ case F_ARM_2a: machine = bfd_mach_arm_2a; break;
+ case F_ARM_3: machine = bfd_mach_arm_3; break;
+ default:
+ case F_ARM_3M: machine = bfd_mach_arm_3M; break;
+ case F_ARM_4: machine = bfd_mach_arm_4; break;
+ case F_ARM_4T: machine = bfd_mach_arm_4T; break;
+ }
break;
#endif
#ifdef MC68MAGIC
@@ -1370,7 +1414,7 @@ coff_set_arch_mach_hook (abfd, filehdr)
case LYNXCOFFMAGIC:
#endif
arch = bfd_arch_m68k;
- machine = 68020;
+ machine = bfd_mach_m68020;
break;
#endif
#ifdef MC88MAGIC
@@ -1569,12 +1613,13 @@ coff_set_arch_mach_hook (abfd, filehdr)
break;
#endif
-#ifdef TIC80_ARCH_MAGIC
- case TIC80_ARCH_MAGIC:
- arch = bfd_arch_tic80;
+#ifdef TIC30MAGIC
+ case TIC30MAGIC:
+ arch = bfd_arch_tic30;
break;
#endif
+
default: /* Unreadable input file type */
arch = bfd_arch_obscure;
break;
@@ -1945,9 +1990,38 @@ coff_set_flags (abfd, magicp, flagsp)
}
break;
#endif
+
+#ifdef TIC30MAGIC
+ case bfd_arch_tic30:
+ *magicp = TIC30MAGIC;
+ return true;
+#endif
#ifdef ARMMAGIC
case bfd_arch_arm:
- *magicp = ARMMAGIC;
+ * magicp = ARMMAGIC;
+ * flagsp = 0;
+ if (APCS_SET (abfd))
+ {
+ if (APCS_26_FLAG (abfd))
+ * flagsp |= F_APCS26;
+
+ if (APCS_FLOAT_FLAG (abfd))
+ * flagsp |= F_APCS_FLOAT;
+
+ if (PIC_FLAG (abfd))
+ * flagsp |= F_PIC;
+ }
+ if (INTERWORK_SET (abfd) && INTERWORK_FLAG (abfd))
+ * flagsp |= F_INTERWORK;
+ switch (bfd_get_mach (abfd))
+ {
+ case bfd_mach_arm_2: * flagsp |= F_ARM_2; break;
+ case bfd_mach_arm_2a: * flagsp |= F_ARM_2a; break;
+ case bfd_mach_arm_3: * flagsp |= F_ARM_3; break;
+ case bfd_mach_arm_3M: * flagsp |= F_ARM_3M; break;
+ case bfd_mach_arm_4: * flagsp |= F_ARM_4; break;
+ case bfd_mach_arm_4T: * flagsp |= F_ARM_4T; break;
+ }
return true;
#endif
#ifdef PPCMAGIC
@@ -2101,6 +2175,10 @@ coff_set_arch_mach (abfd, arch, machine)
/* Calculate the file position for each section. */
+#ifndef I960
+#define ALIGN_SECTIONS_IN_FILE
+#endif
+
static boolean
coff_compute_section_file_positions (abfd)
bfd * abfd;
@@ -2109,11 +2187,10 @@ coff_compute_section_file_positions (abfd)
asection *previous = (asection *) NULL;
file_ptr sofar = FILHSZ;
boolean align_adjust;
-
-#ifndef I960
+ unsigned int count;
+#ifdef ALIGN_SECTIONS_IN_FILE
file_ptr old_sofar;
#endif
- unsigned int count;
#ifdef RS6000COFF_C
/* On XCOFF, if we have symbols, set up the .debug section. */
@@ -2199,6 +2276,19 @@ coff_compute_section_file_positions (abfd)
current != (asection *) NULL;
current = current->next, ++count)
{
+#ifdef COFF_IMAGE_WITH_PE
+ /* The NT loader does not want empty section headers, so we omit
+ them. We don't actually remove the section from the BFD,
+ although we probably should. This matches code in
+ coff_write_object_contents. */
+ if (current->_raw_size == 0)
+ {
+ current->target_index = -1;
+ --count;
+ continue;
+ }
+#endif
+
current->target_index = count;
/* Only deal with sections which have contents */
@@ -2209,7 +2299,7 @@ coff_compute_section_file_positions (abfd)
which they are aligned in virtual memory. I960 doesn't
do this (FIXME) so we can stay in sync with Intel. 960
doesn't yet page from files... */
-#ifndef I960
+#ifdef ALIGN_SECTIONS_IN_FILE
if ((abfd->flags & EXEC_P) != 0)
{
/* make sure this section is aligned on the right boundary - by
@@ -2260,7 +2350,7 @@ coff_compute_section_file_positions (abfd)
sofar += current->_raw_size;
-#ifndef I960
+#ifdef ALIGN_SECTIONS_IN_FILE
/* make sure that this section is of the right size too */
if ((abfd->flags & EXEC_P) == 0)
{
@@ -2281,6 +2371,14 @@ coff_compute_section_file_positions (abfd)
}
#endif
+#ifdef COFF_IMAGE_WITH_PE
+ /* For PE we need to make sure we pad out to the aligned
+ _raw_size, in case the caller only writes out data to the
+ unaligned _raw_size. */
+ if (pei_section_data (abfd, current)->virt_size < current->_raw_size)
+ align_adjust = true;
+#endif
+
#ifdef _LIB
/* Force .lib sections to start at zero. The vma is then
incremented in coff_set_section_contents. This is right for
@@ -2599,7 +2697,6 @@ coff_write_object_contents (abfd)
section.s_align = (current->alignment_power
? 1 << current->alignment_power
: 0);
-
#endif
#ifdef COFF_IMAGE_WITH_PE
@@ -2626,13 +2723,22 @@ coff_write_object_contents (abfd)
{
unsigned int i, count;
asymbol **psym;
- coff_symbol_type *csym;
+ coff_symbol_type *csym = NULL;
+ asymbol **psymsec;
+ psymsec = NULL;
count = bfd_get_symcount (abfd);
for (i = 0, psym = abfd->outsymbols; i < count; i++, psym++)
{
- /* Here *PSYM is the section symbol for CURRENT. */
+ if ((*psym)->section != current)
+ continue;
+ /* Remember the location of the first symbol in this
+ section. */
+ if (psymsec == NULL)
+ psymsec = psym;
+
+ /* See if this is the section symbol. */
if (strcmp ((*psym)->name, current->name) == 0)
{
csym = coff_symbol_from (abfd, *psym);
@@ -2642,6 +2748,9 @@ coff_write_object_contents (abfd)
|| csym->native->u.syment.n_sclass != C_STAT
|| csym->native->u.syment.n_type != T_NULL)
continue;
+
+ /* Here *PSYM is the section symbol for CURRENT. */
+
break;
}
}
@@ -2678,6 +2787,24 @@ coff_write_object_contents (abfd)
IMAGE_COMDAT_SELECT_EXACT_MATCH;
break;
}
+
+ /* The COMDAT symbol must be the first symbol from this
+ section in the symbol table. In order to make this
+ work, we move the COMDAT symbol before the first
+ symbol we found in the search above. It's OK to
+ rearrange the symbol table at this point, because
+ coff_renumber_symbols is going to rearrange it
+ further and fix up all the aux entries. */
+ if (psym != psymsec)
+ {
+ asymbol *hold;
+ asymbol **pcopy;
+
+ hold = *psym;
+ for (pcopy = psym; pcopy > psymsec; pcopy--)
+ pcopy[0] = pcopy[-1];
+ *psymsec = hold;
+ }
}
}
#endif /* COFF_WITH_PE */
@@ -2751,6 +2878,7 @@ coff_write_object_contents (abfd)
else
internal_f.f_flags |= F_AR32W;
+
/*
FIXME, should do something about the other byte orders and
architectures.
@@ -2788,10 +2916,6 @@ coff_write_object_contents (abfd)
internal_a.magic = NMAGIC; /* Assume separate i/d */
#define __A_MAGIC_SET__
#endif /* A29K */
-#ifdef TIC80
- internal_a.magic = TIC80_ARCH_MAGIC;
-#define __A_MAGIC_SET__
-#endif /* TIC80 */
#ifdef I860
/* FIXME: What are the a.out magic numbers for the i860? */
internal_a.magic = 0;
@@ -2832,10 +2956,12 @@ coff_write_object_contents (abfd)
#define __A_MAGIC_SET__
internal_a.magic = ZMAGIC;
#endif
+
#if defined(PPC_PE)
#define __A_MAGIC_SET__
internal_a.magic = IMAGE_NT_OPTIONAL_HDR_MAGIC;
#endif
+
#if defined(I386)
#define __A_MAGIC_SET__
#if defined(LYNXOS)
@@ -2852,7 +2978,7 @@ coff_write_object_contents (abfd)
#endif /* LYNXOS */
#endif /* SPARC */
-#if RS6000COFF_C
+#ifdef RS6000COFF_C
#define __A_MAGIC_SET__
internal_a.magic = (abfd->flags & D_PAGED) ? RS6K_AOUTHDR_ZMAGIC :
(abfd->flags & WP_TEXT) ? RS6K_AOUTHDR_NMAGIC :
@@ -3228,7 +3354,8 @@ coff_slurp_line_table (abfd, asect)
warned = false;
symndx = dst.l_addr.l_symndx;
- if (symndx < 0 || symndx >= obj_raw_syment_count (abfd))
+ if (symndx < 0
+ || (unsigned long) symndx >= obj_raw_syment_count (abfd))
{
(*_bfd_error_handler)
("%s: warning: illegal symbol index %ld in line numbers",
@@ -3336,9 +3463,16 @@ coff_slurp_symbol_table (abfd)
#endif
case C_EXT:
+#if defined ARM
+ case C_THUMBEXT:
+ case C_THUMBEXTFUNC:
+#endif
#ifdef RS6000COFF_C
case C_HIDEXT:
#endif
+#ifdef C_SYSTEM
+ case C_SYSTEM: /* System Wide variable */
+#endif
#ifdef COFF_WITH_PE
/* PE uses storage class 0x68 to denote a section symbol */
case C_SECTION:
@@ -3364,8 +3498,15 @@ coff_slurp_symbol_table (abfd)
section */
dst->symbol.flags = BSF_EXPORT | BSF_GLOBAL;
+
+#if defined COFF_WITH_PE
+ /* PE sets the symbol to a value relative to the
+ start of the section. */
+ dst->symbol.value = src->u.syment.n_value;
+#else
dst->symbol.value = (src->u.syment.n_value
- dst->symbol.section->vma);
+#endif
if (ISFCN ((src->u.syment.n_type)))
{
@@ -3395,6 +3536,11 @@ coff_slurp_symbol_table (abfd)
#ifdef I960
case C_LEAFSTAT: /* static leaf procedure */
#endif
+#if defined ARM
+ case C_THUMBSTAT: /* Thumb static */
+ case C_THUMBLABEL: /* Thumb label */
+ case C_THUMBSTATFUNC:/* Thumb static function */
+#endif
case C_LABEL: /* label */
if (src->u.syment.n_scnum == -2)
dst->symbol.flags = BSF_DEBUGGING;
@@ -3404,8 +3550,16 @@ coff_slurp_symbol_table (abfd)
/* Base the value as an index from the base of the
section, if there is one. */
if (dst->symbol.section)
- dst->symbol.value = (src->u.syment.n_value
- - dst->symbol.section->vma);
+ {
+#if defined COFF_WITH_PE
+ /* PE sets the symbol to a value relative to the
+ start of the section. */
+ dst->symbol.value = src->u.syment.n_value;
+#else
+ dst->symbol.value = (src->u.syment.n_value
+ - dst->symbol.section->vma);
+#endif
+ }
else
dst->symbol.value = src->u.syment.n_value;
break;
@@ -3501,10 +3655,16 @@ coff_slurp_symbol_table (abfd)
case C_FCN: /* ".bf" or ".ef" */
case C_EFCN: /* physical end of function */
dst->symbol.flags = BSF_LOCAL;
+#if defined COFF_WITH_PE
+ /* PE sets the symbol to a value relative to the start
+ of the section. */
+ dst->symbol.value = src->u.syment.n_value;
+#else
/* Base the value as an index from the base of the
section. */
dst->symbol.value = (src->u.syment.n_value
- dst->symbol.section->vma);
+#endif
break;
case C_NULL:
@@ -3570,9 +3730,13 @@ coff_slurp_symbol_table (abfd)
#define OTHER_GLOBAL_CLASS C_LEAFEXT
#endif
+#ifdef COFFARM
+#define OTHER_GLOBAL_CLASS C_THUMBEXT || syment->n_sclass == C_THUMBEXTFUNC
+#else
#ifdef COFF_WITH_PE
#define OTHER_GLOBAL_CLASS C_SECTION
#endif
+#endif
#ifdef OTHER_GLOBAL_CLASS
@@ -3580,12 +3744,10 @@ static boolean coff_sym_is_global PARAMS ((bfd *, struct internal_syment *));
static boolean
coff_sym_is_global (abfd, syment)
- bfd *abfd;
- struct internal_syment *syment;
+ bfd * abfd;
+ struct internal_syment * syment;
{
- if (syment->n_sclass == OTHER_GLOBAL_CLASS)
- return true;
- return false;
+ return (syment->n_sclass == OTHER_GLOBAL_CLASS);
}
#undef OTHER_GLOBAL_CLASS
@@ -3906,6 +4068,7 @@ dummy_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
#endif
#define coff_bfd_final_link _bfd_generic_final_link
#endif /* ! defined (coff_relocate_section) */
+
#define coff_bfd_link_split_section _bfd_generic_link_split_section
#ifndef coff_start_final_link
@@ -3920,13 +4083,79 @@ dummy_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
#define coff_link_add_one_symbol _bfd_generic_link_add_one_symbol
#endif
+#ifndef coff_link_output_has_begun
+#define coff_link_output_has_begun _coff_link_output_has_begun
+static boolean
+_coff_link_output_has_begun (abfd)
+ bfd * abfd;
+{
+ return abfd->output_has_begun;
+}
+#endif
+
+#ifndef coff_final_link_postscript
+#define coff_final_link_postscript _coff_final_link_postscript
+static boolean
+_coff_final_link_postscript (abfd, pfinfo)
+ bfd * abfd;
+ struct coff_final_link_info * pfinfo;
+{
+ return true;
+}
+#endif
+
+#ifndef coff_SWAP_aux_in
+#define coff_SWAP_aux_in coff_swap_aux_in
+#endif
+#ifndef coff_SWAP_sym_in
+#define coff_SWAP_sym_in coff_swap_sym_in
+#endif
+#ifndef coff_SWAP_lineno_in
+#define coff_SWAP_lineno_in coff_swap_lineno_in
+#endif
+#ifndef coff_SWAP_aux_out
+#define coff_SWAP_aux_out coff_swap_aux_out
+#endif
+#ifndef coff_SWAP_sym_out
+#define coff_SWAP_sym_out coff_swap_sym_out
+#endif
+#ifndef coff_SWAP_lineno_out
+#define coff_SWAP_lineno_out coff_swap_lineno_out
+#endif
+#ifndef coff_SWAP_reloc_out
+#define coff_SWAP_reloc_out coff_swap_reloc_out
+#endif
+#ifndef coff_SWAP_filehdr_out
+#define coff_SWAP_filehdr_out coff_swap_filehdr_out
+#endif
+#ifndef coff_SWAP_aouthdr_out
+#define coff_SWAP_aouthdr_out coff_swap_aouthdr_out
+#endif
+#ifndef coff_SWAP_scnhdr_out
+#define coff_SWAP_scnhdr_out coff_swap_scnhdr_out
+#endif
+#ifndef coff_SWAP_reloc_in
+#define coff_SWAP_reloc_in coff_swap_reloc_in
+#endif
+#ifndef coff_SWAP_filehdr_in
+#define coff_SWAP_filehdr_in coff_swap_filehdr_in
+#endif
+#ifndef coff_SWAP_aouthdr_in
+#define coff_SWAP_aouthdr_in coff_swap_aouthdr_in
+#endif
+#ifndef coff_SWAP_scnhdr_in
+#define coff_SWAP_scnhdr_in coff_swap_scnhdr_in
+#endif
+
+
+
static CONST bfd_coff_backend_data bfd_coff_std_swap_table =
{
- coff_swap_aux_in, coff_swap_sym_in, coff_swap_lineno_in,
- coff_swap_aux_out, coff_swap_sym_out,
- coff_swap_lineno_out, coff_swap_reloc_out,
- coff_swap_filehdr_out, coff_swap_aouthdr_out,
- coff_swap_scnhdr_out,
+ coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
+ coff_SWAP_aux_out, coff_SWAP_sym_out,
+ coff_SWAP_lineno_out, coff_SWAP_reloc_out,
+ coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
+ coff_SWAP_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ, SYMESZ, AUXESZ, RELSZ, LINESZ,
#ifdef COFF_LONG_FILENAMES
true,
@@ -3939,22 +4168,31 @@ static CONST bfd_coff_backend_data bfd_coff_std_swap_table =
false,
#endif
COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
- coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in,
- coff_swap_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
+ coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
+ coff_SWAP_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
coff_sym_is_global, coff_compute_section_file_positions,
coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
- coff_adjust_symndx, coff_link_add_one_symbol
+ coff_adjust_symndx, coff_link_add_one_symbol,
+ coff_link_output_has_begun, coff_final_link_postscript
};
-#define coff_close_and_cleanup _bfd_generic_close_and_cleanup
-#define coff_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define coff_get_section_contents _bfd_generic_get_section_contents
+#ifndef coff_close_and_cleanup
+#define coff_close_and_cleanup _bfd_generic_close_and_cleanup
+#endif
+
+#ifndef coff_bfd_free_cached_info
+#define coff_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#endif
+
+#ifndef coff_get_section_contents
+#define coff_get_section_contents _bfd_generic_get_section_contents
+#endif
#ifndef coff_bfd_copy_private_symbol_data
-#define coff_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
+#define coff_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
#endif
#ifndef coff_bfd_copy_private_section_data
@@ -3962,36 +4200,44 @@ static CONST bfd_coff_backend_data bfd_coff_std_swap_table =
#endif
#ifndef coff_bfd_copy_private_bfd_data
-#define coff_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
+#define coff_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
+#endif
+
+#ifndef coff_bfd_merge_private_bfd_data
+#define coff_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
#endif
-#define coff_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
-#define coff_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#ifndef coff_bfd_set_private_flags
+#define coff_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#endif
#ifndef coff_bfd_print_private_bfd_data
-#define coff_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
+#define coff_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
#endif
#ifndef coff_bfd_is_local_label_name
-#define coff_bfd_is_local_label_name _bfd_coff_is_local_label_name
+#define coff_bfd_is_local_label_name _bfd_coff_is_local_label_name
#endif
+
#ifndef coff_read_minisymbols
-#define coff_read_minisymbols _bfd_generic_read_minisymbols
+#define coff_read_minisymbols _bfd_generic_read_minisymbols
#endif
+
#ifndef coff_minisymbol_to_symbol
-#define coff_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define coff_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
#endif
/* The reloc lookup routine must be supplied by each individual COFF
backend. */
#ifndef coff_bfd_reloc_type_lookup
-#define coff_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+#define coff_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
#endif
#ifndef coff_bfd_get_relocated_section_contents
#define coff_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#endif
+
#ifndef coff_bfd_relax_section
-#define coff_bfd_relax_section bfd_generic_relax_section
+#define coff_bfd_relax_section bfd_generic_relax_section
#endif
diff --git a/contrib/binutils/bfd/coffgen.c b/contrib/binutils/bfd/coffgen.c
index dfcf02a..b5ecbc9 100644
--- a/contrib/binutils/bfd/coffgen.c
+++ b/contrib/binutils/bfd/coffgen.c
@@ -1,5 +1,6 @@
/* Support for the generic parts of COFF, for BFD.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -62,7 +63,7 @@ static const bfd_target *coff_real_object_p
PARAMS ((bfd *, unsigned, struct internal_filehdr *,
struct internal_aouthdr *));
static void fixup_symbol_value
- PARAMS ((coff_symbol_type *, struct internal_syment *));
+ PARAMS ((bfd *, coff_symbol_type *, struct internal_syment *));
static char *build_debug_section
PARAMS ((bfd *));
static char *copy_name
@@ -283,18 +284,14 @@ coff_object_p (abfd)
opthdr = bfd_alloc (abfd, aoutsz);
if (opthdr == NULL)
return 0;;
- if (bfd_read (opthdr, 1, aoutsz, abfd) != aoutsz)
+ if (bfd_read (opthdr, 1, internal_f.f_opthdr, abfd)
+ != internal_f.f_opthdr)
{
return 0;
}
- bfd_coff_swap_aouthdr_in (abfd, opthdr, (PTR) & internal_a);
+ bfd_coff_swap_aouthdr_in (abfd, opthdr, (PTR) &internal_a);
}
- /* Seek past the opt hdr stuff */
- if (bfd_seek (abfd, (file_ptr) (internal_f.f_opthdr + filhsz), SEEK_SET)
- != 0)
- return NULL;
-
return coff_real_object_p (abfd, nscns, &internal_f,
(internal_f.f_opthdr != 0
? &internal_a
@@ -575,7 +572,8 @@ coff_symbol_from (ignore_abfd, symbol)
}
static void
-fixup_symbol_value (coff_symbol_ptr, syment)
+fixup_symbol_value (abfd, coff_symbol_ptr, syment)
+ bfd *abfd;
coff_symbol_type *coff_symbol_ptr;
struct internal_syment *syment;
{
@@ -603,10 +601,11 @@ fixup_symbol_value (coff_symbol_ptr, syment)
syment->n_scnum =
coff_symbol_ptr->symbol.section->output_section->target_index;
- syment->n_value =
- coff_symbol_ptr->symbol.value +
- coff_symbol_ptr->symbol.section->output_offset +
- coff_symbol_ptr->symbol.section->output_section->vma;
+ syment->n_value = (coff_symbol_ptr->symbol.value
+ + coff_symbol_ptr->symbol.section->output_offset);
+ if (! obj_pe (abfd))
+ syment->n_value +=
+ coff_symbol_ptr->symbol.section->output_section->vma;
}
else
{
@@ -702,7 +701,7 @@ coff_renumber_symbols (bfd_ptr, first_undef)
/* Modify the symbol values according to their section and
type */
- fixup_symbol_value (coff_symbol_ptr, &(s->u.syment));
+ fixup_symbol_value (bfd_ptr, coff_symbol_ptr, &(s->u.syment));
}
for (i = 0; i < s->u.syment.n_numaux + 1; i++)
s[i].offset = native_index++;
@@ -1017,8 +1016,9 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p,
native->u.syment.n_scnum =
symbol->section->output_section->target_index;
native->u.syment.n_value = (symbol->value
- + symbol->section->output_section->vma
+ symbol->section->output_offset);
+ if (! obj_pe (abfd))
+ native->u.syment.n_value += symbol->section->output_section->vma;
/* Copy the any flags from the the file header into the symbol.
FIXME: Why? */
@@ -1417,8 +1417,8 @@ coff_pointerize_aux (abfd, table_base, symbol, indaux, auxent)
unsigned int indaux;
combined_entry_type *auxent;
{
- int type = symbol->u.syment.n_type;
- int class = symbol->u.syment.n_sclass;
+ unsigned int type = symbol->u.syment.n_type;
+ unsigned int class = symbol->u.syment.n_sclass;
if (coff_backend_info (abfd)->_bfd_coff_pointerize_aux_hook)
{
@@ -2146,6 +2146,9 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
/* Find the first C_FILE symbol. */
p = cof->raw_syments;
+ if (!p)
+ return false;
+
pend = p + cof->raw_syment_count;
while (p < pend)
{
@@ -2156,9 +2159,11 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
if (p < pend)
{
+ bfd_vma sec_vma;
bfd_vma maxdiff;
/* Look through the C_FILE symbols to find the best one. */
+ sec_vma = bfd_get_section_vma (abfd, section);
*filename_ptr = (char *) p->u.syment._n._n_n._n_offset;
maxdiff = (bfd_vma) 0 - (bfd_vma) 1;
while (1)
@@ -2182,11 +2187,11 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
}
if (p2 < pend
- && offset >= (bfd_vma) p2->u.syment.n_value
- && offset - (bfd_vma) p2->u.syment.n_value < maxdiff)
+ && offset + sec_vma >= (bfd_vma) p2->u.syment.n_value
+ && offset + sec_vma - (bfd_vma) p2->u.syment.n_value < maxdiff)
{
*filename_ptr = (char *) p->u.syment._n._n_n._n_offset;
- maxdiff = offset - p2->u.syment.n_value;
+ maxdiff = offset + sec_vma - p2->u.syment.n_value;
}
/* Avoid endless loops on erroneous files by ensuring that
@@ -2253,7 +2258,7 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
}
else
{
- if (l->u.offset + bfd_get_section_vma (abfd, section) > offset)
+ if (l->u.offset > offset)
break;
*line_ptr = l->line_number + line_base - 1;
}
diff --git a/contrib/binutils/bfd/cofflink.c b/contrib/binutils/bfd/cofflink.c
index f824158..7b2b830 100644
--- a/contrib/binutils/bfd/cofflink.c
+++ b/contrib/binutils/bfd/cofflink.c
@@ -38,6 +38,7 @@ static char *dores_com PARAMS ((char *, bfd *, int));
static char *get_name PARAMS ((char *, char **));
static int process_embedded_commands
PARAMS ((bfd *, struct bfd_link_info *, bfd *));
+static void mark_relocs PARAMS ((struct coff_final_link_info *, bfd *));
/* Create an entry in a COFF linker hash table. */
@@ -243,6 +244,9 @@ coff_link_check_ar_symbols (abfd, info, pneeded)
bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym);
if ((sym.n_sclass == C_EXT
+#ifdef C_SYSTEM
+ || sym.n_sclass == C_SYSTEM
+#endif
|| (sym_is_global && (*sym_is_global) (abfd, &sym)))
&& (sym.n_scnum != 0 || sym.n_value != 0))
{
@@ -333,6 +337,9 @@ coff_link_add_symbols (abfd, info)
bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym);
if (sym.n_sclass == C_EXT
+#ifdef C_SYSTEM
+ || sym.n_sclass == C_SYSTEM
+#endif
|| (sym_is_global && (*sym_is_global) (abfd, &sym)))
{
const char *name;
@@ -373,7 +380,8 @@ coff_link_add_symbols (abfd, info)
{
flags = BSF_EXPORT | BSF_GLOBAL;
section = coff_section_from_bfd_index (abfd, sym.n_scnum);
- value -= section->vma;
+ if (! obj_pe (abfd))
+ value -= section->vma;
}
if (! (bfd_coff_link_add_one_symbol
@@ -530,6 +538,7 @@ _bfd_coff_final_link (abfd, info)
finfo.contents = NULL;
finfo.external_relocs = NULL;
finfo.internal_relocs = NULL;
+ finfo.global_to_static = false;
debug_merge_allocated = false;
coff_data (abfd)->link_info = info;
@@ -759,7 +768,7 @@ _bfd_coff_final_link (abfd, info)
== bfd_target_coff_flavour))
{
sub = p->u.indirect.section->owner;
- if (! sub->output_has_begun)
+ if (! bfd_coff_link_output_has_begun (sub))
{
if (! _bfd_coff_link_input_bfd (&finfo, sub))
goto error_return;
@@ -780,6 +789,9 @@ _bfd_coff_final_link (abfd, info)
}
}
+ if (! bfd_coff_final_link_postscript (abfd, & finfo))
+ goto error_return;
+
/* Free up the buffers used by _bfd_coff_link_input_bfd. */
coff_debug_merge_hash_table_free (&finfo.debug_merge);
@@ -838,6 +850,18 @@ _bfd_coff_final_link (abfd, info)
return false;
}
+ /* If doing task linking (ld --task-link) then make a pass through the
+ global symbols, writing out any that are defined, and making them
+ static. */
+ if (info->task_link)
+ {
+ finfo.failed = false;
+ coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_task_globals,
+ (PTR) &finfo);
+ if (finfo.failed)
+ goto error_return;
+ }
+
/* Write out the global symbols. */
finfo.failed = false;
coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym,
@@ -1117,6 +1141,60 @@ process_embedded_commands (output_bfd, info, abfd)
return 1;
}
+/* Place a marker against all symbols which are used by relocations.
+ This marker can be picked up by the 'do we skip this symbol ?'
+ loop in _bfd_coff_link_input_bfd() and used to prevent skipping
+ that symbol.
+ */
+
+static void
+mark_relocs (finfo, input_bfd)
+ struct coff_final_link_info * finfo;
+ bfd * input_bfd;
+{
+ asection * a;
+
+ if ((bfd_get_file_flags (input_bfd) & HAS_SYMS) == 0)
+ return;
+
+ for (a = input_bfd->sections; a != (asection *) NULL; a = a->next)
+ {
+ struct internal_reloc * internal_relocs;
+ struct internal_reloc * irel;
+ struct internal_reloc * irelend;
+
+
+ if ((a->flags & SEC_RELOC) == 0 || a->reloc_count < 1)
+ continue;
+
+ /* Read in the relocs. */
+ internal_relocs = _bfd_coff_read_internal_relocs
+ (input_bfd, a, false,
+ finfo->external_relocs,
+ finfo->info->relocateable,
+ (finfo->info->relocateable
+ ? (finfo->section_info[ a->output_section->target_index ].relocs + a->output_section->reloc_count)
+ : finfo->internal_relocs)
+ );
+
+ if (internal_relocs == NULL)
+ continue;
+
+ irel = internal_relocs;
+ irelend = irel + a->reloc_count;
+
+ /* Place a mark in the sym_indices array (whose entries have
+ been initialised to 0) for all of the symbols that are used
+ in the relocation table. This will then be picked up in the
+ skip/don't pass */
+
+ for (; irel < irelend; irel++)
+ {
+ finfo->sym_indices[ irel->r_symndx ] = -1;
+ }
+ }
+}
+
/* Link an input file into the linker output file. This function
handles all the sections and relocations of the input file at once. */
@@ -1190,11 +1268,25 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
return false;
}
+ /* If we are going to perform relocations and also strip/discard some symbols
+ then we must make sure that we do not strip/discard those symbols that are
+ going to be involved in the relocations */
+ if (( finfo->info->strip != strip_none
+ || finfo->info->discard != discard_none)
+ && finfo->info->relocateable)
+ {
+ /* mark the symbol array as 'not-used' */
+ memset (indexp, 0, obj_raw_syment_count (input_bfd) * sizeof * indexp);
+
+ mark_relocs (finfo, input_bfd);
+ }
+
while (esym < esym_end)
{
struct internal_syment isym;
boolean skip;
boolean global;
+ boolean dont_skip_symbol;
int add;
bfd_coff_swap_sym_in (input_bfd, (PTR) esym, (PTR) isymp);
@@ -1215,6 +1307,15 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
*secpp = bfd_com_section_ptr;
}
+ /* Extract the flag indicating if this symbol is used by a
+ relocation. */
+ if ((finfo->info->strip != strip_none
+ || finfo->info->discard != discard_none)
+ && finfo->info->relocateable)
+ dont_skip_symbol = *indexp;
+ else
+ dont_skip_symbol = false;
+
*indexp = -1;
skip = false;
@@ -1222,12 +1323,15 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
add = 1 + isym.n_numaux;
/* If we are stripping all symbols, we want to skip this one. */
- if (finfo->info->strip == strip_all)
+ if (finfo->info->strip == strip_all && ! dont_skip_symbol)
skip = true;
if (! skip)
{
if (isym.n_sclass == C_EXT
+#ifdef C_SYSTEM
+ || isym.n_sclass == C_SYSTEM
+#endif
|| (sym_is_global && (*sym_is_global) (input_bfd, &isym)))
{
/* This is a global symbol. Global symbols come at the
@@ -1242,16 +1346,29 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
{
/* This is a local symbol. Skip it if we are discarding
local symbols. */
- if (finfo->info->discard == discard_all)
+ if (finfo->info->discard == discard_all && ! dont_skip_symbol)
skip = true;
}
}
/* If we stripping debugging symbols, and this is a debugging
- symbol, then skip it. */
+ symbol, then skip it. FIXME: gas sets the section to N_ABS
+ for some types of debugging symbols; I don't know if this is
+ a bug or not. In any case, we handle it here. */
if (! skip
&& finfo->info->strip == strip_debugger
- && isym.n_scnum == N_DEBUG)
+ && ! dont_skip_symbol
+ && (isym.n_scnum == N_DEBUG
+ || (isym.n_scnum == N_ABS
+ && (isym.n_sclass == C_AUTO
+ || isym.n_sclass == C_REG
+ || isym.n_sclass == C_MOS
+ || isym.n_sclass == C_MOE
+ || isym.n_sclass == C_MOU
+ || isym.n_sclass == C_ARG
+ || isym.n_sclass == C_REGPARM
+ || isym.n_sclass == C_FIELD
+ || isym.n_sclass == C_EOS))))
skip = true;
/* If some symbols are stripped based on the name, work out the
@@ -1267,12 +1384,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
if (name == NULL)
return false;
- if ((finfo->info->strip == strip_some
- && (bfd_hash_lookup (finfo->info->keep_hash, name, false,
+ if (! dont_skip_symbol
+ && ((finfo->info->strip == strip_some
+ && (bfd_hash_lookup (finfo->info->keep_hash, name, false,
false) == NULL))
- || (! global
- && finfo->info->discard == discard_l
- && bfd_is_local_label_name (input_bfd, name)))
+ || (! global
+ && finfo->info->discard == discard_l
+ && bfd_is_local_label_name (input_bfd, name))))
skip = true;
}
@@ -1472,9 +1590,11 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
if (isym.n_scnum > 0)
{
isym.n_scnum = (*secpp)->output_section->target_index;
- isym.n_value += ((*secpp)->output_section->vma
- + (*secpp)->output_offset
- - (*secpp)->vma);
+ isym.n_value += (*secpp)->output_offset;
+ if (! obj_pe (input_bfd))
+ isym.n_value -= (*secpp)->vma;
+ if (! obj_pe (finfo->output_bfd))
+ isym.n_value += (*secpp)->output_section->vma;
}
/* The value of a C_FILE symbol is the symbol index of the
@@ -1525,6 +1645,12 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
finfo->last_file = isym;
}
+ /* If doing task linking, convert normal global function symbols to
+ static functions. */
+
+ if (finfo->info->task_link && isym.n_sclass == C_EXT)
+ isym.n_sclass = C_STAT;
+
/* Output the symbol. */
bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) outsym);
@@ -2066,9 +2192,10 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
char buf[SYMNMLEN + 1];
/* This reloc is against a symbol we are
- stripping. It would be possible to
- handle this case, but I don't think it's
- worth it. */
+ stripping. This should have been handled
+ by the 'dont_skip_symbol' code in the while
+ loop at the top of this function. */
+
is = finfo->internal_syms + irel->r_symndx;
name = (_bfd_coff_internal_syment_name
@@ -2166,8 +2293,9 @@ _bfd_coff_write_global_sym (h, data)
else
isym.n_scnum = sec->target_index;
isym.n_value = (h->root.u.def.value
- + sec->vma
+ h->root.u.def.section->output_offset);
+ if (! obj_pe (finfo->output_bfd))
+ isym.n_value += sec->vma;
}
break;
@@ -2209,6 +2337,18 @@ _bfd_coff_write_global_sym (h, data)
if (isym.n_sclass == C_NULL)
isym.n_sclass = C_EXT;
+ /* If doing task linking and this is the pass where we convert defined globals to
+ statics, then do that conversion now. If the symbol is not being converted,
+ just ignore it and it will be output during a later pass. */
+ if (finfo->global_to_static)
+ {
+ if (isym.n_sclass != C_EXT)
+ {
+ return true;
+ }
+ isym.n_sclass = C_STAT;
+ }
+
isym.n_numaux = h->numaux;
bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) finfo->outsyms);
@@ -2247,6 +2387,37 @@ _bfd_coff_write_global_sym (h, data)
return true;
}
+/* Write out task global symbols, converting them to statics. Called
+ via coff_link_hash_traverse. Calls bfd_coff_write_global_sym to do
+ the dirty work, if the symbol we are processing needs conversion. */
+
+boolean
+_bfd_coff_write_task_globals (h, data)
+ struct coff_link_hash_entry *h;
+ PTR data;
+{
+ struct coff_final_link_info *finfo = (struct coff_final_link_info *) data;
+ boolean rtnval = true;
+ boolean save_global_to_static;
+
+ if (h->indx < 0)
+ {
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ save_global_to_static = finfo->global_to_static;
+ finfo->global_to_static = true;
+ rtnval = _bfd_coff_write_global_sym (h, data);
+ finfo->global_to_static = save_global_to_static;
+ break;
+ default:
+ break;
+ }
+ }
+ return (rtnval);
+}
+
/* Handle a link order which is supposed to generate a reloc. */
boolean
@@ -2465,8 +2636,9 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
sec = sections[symndx];
val = (sec->output_section->vma
+ sec->output_offset
- + sym->n_value
- - sec->vma);
+ + sym->n_value);
+ if (! obj_pe (input_bfd))
+ val -= sec->vma;
}
}
else
@@ -2494,19 +2666,26 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
if (info->base_file)
{
/* Emit a reloc if the backend thinks it needs it. */
- if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto))
+ if (sym && pe_data (output_bfd)->in_reloc_p (output_bfd, howto))
{
- /* relocation to a symbol in a section which
- isn't absolute - we output the address here
- to a file */
- bfd_vma addr = rel->r_vaddr
- - input_section->vma
- + input_section->output_offset
- + input_section->output_section->vma;
- if (coff_data(output_bfd)->pe)
+ /* Relocation to a symbol in a section which isn't
+ absolute. We output the address here to a file.
+ This file is then read by dlltool when generating the
+ reloc section. Note that the base file is not
+ portable between systems. We write out a long here,
+ and dlltool reads in a long. */
+ long addr = (rel->r_vaddr
+ - input_section->vma
+ + input_section->output_offset
+ + input_section->output_section->vma);
+ if (coff_data (output_bfd)->pe)
addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
- /* FIXME: Shouldn't 4 be sizeof (addr)? */
- fwrite (&addr, 1,4, (FILE *) info->base_file);
+ if (fwrite (&addr, 1, sizeof (long), (FILE *) info->base_file)
+ != sizeof (long))
+ {
+ bfd_set_error (bfd_error_system_call);
+ return false;
+ }
}
}
diff --git a/contrib/binutils/bfd/coffswap.h b/contrib/binutils/bfd/coffswap.h
index 616bdcf..ff76e9e 100644
--- a/contrib/binutils/bfd/coffswap.h
+++ b/contrib/binutils/bfd/coffswap.h
@@ -1,5 +1,5 @@
/* Generic COFF swapping routines, for BFD.
- Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -168,6 +168,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef PUT_SCNHDR_LNNOPTR
#define PUT_SCNHDR_LNNOPTR bfd_h_put_32
#endif
+#ifndef GET_SCNHDR_NRELOC
+#define GET_SCNHDR_NRELOC bfd_h_get_16
+#endif
+#ifndef PUT_SCNHDR_NRELOC
+#define PUT_SCNHDR_NRELOC bfd_h_put_16
+#endif
+#ifndef GET_SCNHDR_NLNNO
+#define GET_SCNHDR_NLNNO bfd_h_get_16
+#endif
+#ifndef PUT_SCNHDR_NLNNO
+#define PUT_SCNHDR_NLNNO bfd_h_put_16
+#endif
+#ifndef GET_SCNHDR_FLAGS
+#define GET_SCNHDR_FLAGS bfd_h_get_32
+#endif
+#ifndef PUT_SCNHDR_FLAGS
+#define PUT_SCNHDR_FLAGS bfd_h_put_32
+#endif
+
static void coff_swap_aouthdr_in PARAMS ((bfd *, PTR, PTR));
static unsigned int coff_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR));
@@ -258,6 +277,9 @@ coff_swap_filehdr_in (abfd, src, dst)
{
FILHDR *filehdr_src = (FILHDR *) src;
struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst;
+#ifdef COFF_ADJUST_FILEHDR_IN_PRE
+ COFF_ADJUST_FILEHDR_IN_PRE (abfd, src, dst);
+#endif
filehdr_dst->f_magic = bfd_h_get_16(abfd, (bfd_byte *) filehdr_src->f_magic);
filehdr_dst->f_nscns = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_nscns);
filehdr_dst->f_timdat = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_timdat);
@@ -266,6 +288,10 @@ coff_swap_filehdr_in (abfd, src, dst)
filehdr_dst->f_nsyms = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_nsyms);
filehdr_dst->f_opthdr = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_opthdr);
filehdr_dst->f_flags = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_flags);
+
+#ifdef COFF_ADJUST_FILEHDR_IN_POST
+ COFF_ADJUST_FILEHDR_IN_POST (abfd, src, dst);
+#endif
}
static unsigned int
@@ -277,6 +303,9 @@ coff_swap_filehdr_out (abfd, in, out)
struct internal_filehdr *filehdr_in = (struct internal_filehdr *)in;
FILHDR *filehdr_out = (FILHDR *)out;
+#ifdef COFF_ADJUST_FILEHDR_OUT_PRE
+ COFF_ADJUST_FILEHDR_OUT_PRE (abfd, in, out);
+#endif
bfd_h_put_16(abfd, filehdr_in->f_magic, (bfd_byte *) filehdr_out->f_magic);
bfd_h_put_16(abfd, filehdr_in->f_nscns, (bfd_byte *) filehdr_out->f_nscns);
bfd_h_put_32(abfd, filehdr_in->f_timdat, (bfd_byte *) filehdr_out->f_timdat);
@@ -286,6 +315,9 @@ coff_swap_filehdr_out (abfd, in, out)
bfd_h_put_16(abfd, filehdr_in->f_opthdr, (bfd_byte *) filehdr_out->f_opthdr);
bfd_h_put_16(abfd, filehdr_in->f_flags, (bfd_byte *) filehdr_out->f_flags);
+#ifdef COFF_ADJUST_FILEHDR_OUT_POST
+ COFF_ADJUST_FILEHDR_OUT_POST (abfd, in, out);
+#endif
return FILHSZ;
}
@@ -371,6 +403,9 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
AUXENT *ext = (AUXENT *)ext1;
union internal_auxent *in = (union internal_auxent *)in1;
+#ifdef COFF_ADJUST_AUX_IN_PRE
+ COFF_ADJUST_AUX_IN_PRE (abfd, ext1, type, class, indx, numaux, in1);
+#endif
switch (class) {
case C_FILE:
if (ext->x_file.x_fname[0] == 0) {
@@ -384,7 +419,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
#endif
}
- return;
+ goto end;
/* RS/6000 "csect" auxents */
#ifdef RS6000COFF_C
@@ -403,7 +438,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
in->x_csect.x_smclas = bfd_h_get_8 (abfd, ext->x_csect.x_smclas);
in->x_csect.x_stab = bfd_h_get_32 (abfd, ext->x_csect.x_stab);
in->x_csect.x_snstab = bfd_h_get_16 (abfd, ext->x_csect.x_snstab);
- return;
+ goto end;
}
break;
#endif
@@ -424,7 +459,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
in->x_scn.x_associated = 0;
in->x_scn.x_comdat = 0;
- return;
+ goto end;
}
break;
}
@@ -461,6 +496,14 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
in->x_sym.x_misc.x_lnsz.x_lnno = GET_LNSZ_LNNO(abfd, ext);
in->x_sym.x_misc.x_lnsz.x_size = GET_LNSZ_SIZE(abfd, ext);
}
+
+end: ;
+ /* the semicolon is because MSVC doesn't like labels at
+ end of block. */
+
+#ifdef COFF_ADJUST_AUX_IN_POST
+ COFF_ADJUST_AUX_IN_POST (abfd, ext1, type, class, indx, numaux, in1);
+#endif
}
static unsigned int
@@ -476,6 +519,9 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
union internal_auxent *in = (union internal_auxent *)inp;
AUXENT *ext = (AUXENT *)extp;
+#ifdef COFF_ADJUST_AUX_OUT_PRE
+ COFF_ADJUST_AUX_OUT_PRE (abfd, inp, type, class, indx, numaux, extp);
+#endif
memset((PTR)ext, 0, AUXESZ);
switch (class) {
case C_FILE:
@@ -492,7 +538,7 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
#endif
}
- return AUXESZ;
+ goto end;
#ifdef RS6000COFF_C
/* RS/6000 "csect" auxents */
@@ -510,7 +556,7 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas);
PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab);
PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab);
- return AUXESZ;
+ goto end;
}
break;
#endif
@@ -524,7 +570,7 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
PUT_SCN_SCNLEN(abfd, in->x_scn.x_scnlen, ext);
PUT_SCN_NRELOC(abfd, in->x_scn.x_nreloc, ext);
PUT_SCN_NLINNO(abfd, in->x_scn.x_nlinno, ext);
- return AUXESZ;
+ goto end;
}
break;
}
@@ -563,6 +609,10 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
PUT_LNSZ_SIZE (abfd, in->x_sym.x_misc.x_lnsz.x_size, ext);
}
+end:
+#ifdef COFF_ADJUST_AUX_OUT_POST
+ COFF_ADJUST_AUX_OUT_POST (abfd, inp, type, class, indx, numaux, extp);
+#endif
return AUXESZ;
}
@@ -743,6 +793,9 @@ coff_swap_scnhdr_in (abfd, ext, in)
SCNHDR *scnhdr_ext = (SCNHDR *) ext;
struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
+#ifdef COFF_ADJUST_SCNHDR_IN_PRE
+ COFF_ADJUST_SCNHDR_IN_PRE (abfd, ext, in);
+#endif
memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof(scnhdr_int->s_name));
scnhdr_int->s_vaddr =
GET_SCNHDR_VADDR (abfd, (bfd_byte *) scnhdr_ext->s_vaddr);
@@ -757,16 +810,18 @@ coff_swap_scnhdr_in (abfd, ext, in)
GET_SCNHDR_RELPTR (abfd, (bfd_byte *) scnhdr_ext->s_relptr);
scnhdr_int->s_lnnoptr =
GET_SCNHDR_LNNOPTR (abfd, (bfd_byte *) scnhdr_ext->s_lnnoptr);
- scnhdr_int->s_flags = bfd_h_get_32(abfd, (bfd_byte *) scnhdr_ext->s_flags);
-#if defined(M88)
- scnhdr_int->s_nreloc = bfd_h_get_32(abfd, (bfd_byte *) scnhdr_ext->s_nreloc);
- scnhdr_int->s_nlnno = bfd_h_get_32(abfd, (bfd_byte *) scnhdr_ext->s_nlnno);
-#else
- scnhdr_int->s_nreloc = bfd_h_get_16(abfd, (bfd_byte *) scnhdr_ext->s_nreloc);
- scnhdr_int->s_nlnno = bfd_h_get_16(abfd, (bfd_byte *) scnhdr_ext->s_nlnno);
-#endif
+ scnhdr_int->s_flags =
+ GET_SCNHDR_FLAGS (abfd, (bfd_byte *) scnhdr_ext->s_flags);
+ scnhdr_int->s_nreloc =
+ GET_SCNHDR_NRELOC (abfd, (bfd_byte *) scnhdr_ext->s_nreloc);
+ scnhdr_int->s_nlnno =
+ GET_SCNHDR_NLNNO (abfd, (bfd_byte *) scnhdr_ext->s_nlnno);
#ifdef I960
- scnhdr_int->s_align = bfd_h_get_32(abfd, (bfd_byte *) scnhdr_ext->s_align);
+ scnhdr_int->s_align =
+ GET_SCNHDR_ALIGN (abfd, (bfd_byte *) scnhdr_ext->s_align);
+#endif
+#ifdef COFF_ADJUST_SCNHDR_IN_POST
+ COFF_ADJUST_SCNHDR_IN_POST (abfd, ext, in);
#endif
}
@@ -780,6 +835,9 @@ coff_swap_scnhdr_out (abfd, in, out)
SCNHDR *scnhdr_ext = (SCNHDR *)out;
unsigned int ret = SCNHSZ;
+#ifdef COFF_ADJUST_SCNHDR_OUT_PRE
+ COFF_ADJUST_SCNHDR_OUT_PRE (abfd, in, out);
+#endif
memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof(scnhdr_int->s_name));
PUT_SCNHDR_VADDR (abfd, scnhdr_int->s_vaddr,
@@ -797,7 +855,8 @@ coff_swap_scnhdr_out (abfd, in, out)
(bfd_byte *) scnhdr_ext->s_relptr);
PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr,
(bfd_byte *) scnhdr_ext->s_lnnoptr);
- PUTWORD(abfd, scnhdr_int->s_flags, (bfd_byte *) scnhdr_ext->s_flags);
+ PUT_SCNHDR_FLAGS (abfd, scnhdr_int->s_flags,
+ (bfd_byte *) scnhdr_ext->s_flags);
#if defined(M88)
PUTWORD(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno);
PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc);
@@ -833,8 +892,11 @@ coff_swap_scnhdr_out (abfd, in, out)
}
#endif
-#if defined(I960)
- PUTWORD(abfd, scnhdr_int->s_align, (bfd_byte *) scnhdr_ext->s_align);
+#ifdef I960
+ PUT_SCNHDR_ALIGN (abfd, scnhdr_int->s_align, (bfd_byte *) scnhdr_ext->s_align);
+#endif
+#ifdef COFF_ADJUST_SCNHDR_OUT_POST
+ COFF_ADJUST_SCNHDR_OUT_POST (abfd, in, out);
#endif
return ret;
}
diff --git a/contrib/binutils/bfd/config.bfd b/contrib/binutils/bfd/config.bfd
index 477c9b3..589bb8f 100755
--- a/contrib/binutils/bfd/config.bfd
+++ b/contrib/binutils/bfd/config.bfd
@@ -28,7 +28,10 @@ targ_underscore=no
targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
case "${targ_cpu}" in
+alpha*) targ_archs=bfd_alpha_arch ;;
arm*) targ_archs=bfd_arm_arch ;;
+c30*) targ_archs=bfd_tic30_arch ;;
+thumb*) targ_archs=bfd_arm_arch ;;
hppa*) targ_archs=bfd_hppa_arch ;;
i[3456]86) targ_archs=bfd_i386_arch ;;
m68*) targ_archs=bfd_m68k_arch ;;
@@ -37,10 +40,12 @@ mips*) targ_archs=bfd_mips_arch ;;
powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
sparc*) targ_archs=bfd_sparc_arch ;;
+v850*) targ_archs=bfd_v850_arch ;;
z8k*) targ_archs=bfd_z8k_arch ;;
*) targ_archs=bfd_${targ_cpu}_arch ;;
esac
+
# WHEN ADDING ENTRIES TO THIS MATRIX:
# Make sure that the left side always has two dashes. Otherwise you
# can get spurious matches. Even for unambiguous cases, do this as a
@@ -49,26 +54,35 @@ esac
case "${targ}" in
# START OF targmatch.h
#ifdef BFD64
- alpha-*-netware*)
+ alpha*-*-netbsd*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+ alpha*-*-netware*)
targ_defvec=ecoffalpha_little_vec
targ_selvecs=nlm32_alpha_vec
;;
- alpha-*-linuxecoff*)
+ alpha*-*-linuxecoff*)
targ_defvec=ecoffalpha_little_vec
targ_selvecs=bfd_elf64_alpha_vec
;;
- alpha-*-linux* | alpha-*-elf*)
+ alpha*-*-linux-gnu* | alpha*-*-elf*)
targ_defvec=bfd_elf64_alpha_vec
targ_selvecs=ecoffalpha_little_vec
;;
- alpha-*-*vms*)
+ alpha*-*-*vms*)
targ_defvec=evax_alpha_vec
;;
- alpha-*-*)
+ alpha*-*-*)
targ_defvec=ecoffalpha_little_vec
;;
#endif /* BFD64 */
+ arc-*-elf*)
+ targ_defvec=bfd_elf32_littlearc_vec
+ targ_selvecs=bfd_elf32_bigarc_vec
+ ;;
+
arm-*-riscix*)
targ_defvec=riscix_vec
;;
@@ -90,7 +104,16 @@ case "${targ}" in
targ_selvecs=armcoff_big_vec
targ_underscore=yes
;;
-
+ thumb-*-coff)
+ targ_defvec=armcoff_little_vec
+ targ_selvecs=armcoff_big_vec
+ targ_underscore=yes
+ ;;
+ thumb-*-pe*)
+ targ_defvec=armpe_little_vec
+ targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
+ targ_underscore=yes
+ ;;
a29k-*-ebmon* | a29k-*-udi* | a29k-*-coff* | a29k-*-sym1* | \
a29k-*-vxworks* | a29k-*-sysv*)
targ_defvec=a29kcoff_big_vec
@@ -102,11 +125,19 @@ case "${targ}" in
targ_underscore=yes
;;
+ c30-*-*aout* | tic30-*-*aout*)
+ targ_defvec=tic30_aout_vec
+ ;;
+ c30-*-*coff* | tic30-*-*coff*)
+ targ_defvec=tic30_coff_vec
+ ;;
+
d10v-*-*)
targ_defvec=bfd_elf32_d10v_vec
;;
+
h8300*-*-*)
targ_defvec=h8300coff_vec
targ_underscore=yes
@@ -134,14 +165,21 @@ case "${targ}" in
;;
#endif /* defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) */
+ i[3456]86-*-sco3.2v5*coff)
+ targ_defvec=i386coff_vec
+ ;;
i[3456]86-*-sysv4* | i[3456]86-*-unixware | i[3456]86-*-solaris2* | \
- i[3456]86-*-elf | i[3456]86-*-sco*elf* | i[3456]86-*-freebsdelf* | \
+ i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | i[3456]86-*-freebsdelf* | \
i[3456]86-*-dgux*)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
;;
+ i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* )
+ targ_defvec=go32coff_vec
+ targ_selvecs="go32stubbedcoff_vec i386aout_vec"
+ ;;
i[3456]86-*-sysv* | i[3456]86-*-isc* | i[3456]86-*-sco* | i[3456]86-*-coff | \
- i[3456]86-*-aix* | i[3456]86-*-go32* | i[3456]86*-*-rtems*)
+ i[3456]86-*-aix* | i[3456]86*-*-rtems*)
targ_defvec=i386coff_vec
;;
i[3456]86-sequent-bsd*)
@@ -171,7 +209,7 @@ case "${targ}" in
targ_selvecs=bfd_elf32_i386_vec
targ_underscore=yes
;;
- i[3456]86-*-linux*)
+ i[3456]86-*-linux-gnu*)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386linux_vec
;;
@@ -181,8 +219,6 @@ case "${targ}" in
;;
i[3456]86-*-gnu*)
targ_defvec=bfd_elf32_i386_vec
- targ_selvecs=i386mach3_vec
- targ_cflags=-DSTAT_FOR_EXEC
;;
i[3456]86-*-mach* | i[3456]86-*-osf1mk*)
targ_defvec=i386mach3_vec
@@ -200,7 +236,7 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs="i386msdos_vec i386aout_vec"
;;
- i[3456]86-*-cygwin32 | i[3456]86-*-winnt | i[3456]86-*-pe)
+ i[3456]86-*-mingw32* | i[3456]86-*-cygwin32* | i[3456]86-*-winnt | i[3456]86-*-pe)
targ_defvec=i386pe_vec
targ_selvecs="i386pe_vec i386pei_vec"
;;
@@ -277,7 +313,7 @@ case "${targ}" in
targ_selvecs=bfd_elf32_m68k_vec
targ_underscore=yes
;;
- m68*-*-linux*)
+ m68*-*-linux-gnu*)
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs=m68klinux_vec
;;
@@ -335,9 +371,13 @@ case "${targ}" in
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
;;
- mips-dec-netbsd*)
+ mips-dec-netbsd* | mips*el*-*-netbsd*)
targ_defvec=bfd_elf32_littlemips_vec
- targ_selvecs=bfd_elf32_bigmips_vec
+ targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec"
+ ;;
+ mips*-*-netbsd*)
+ targ_defvec=bfd_elf32_bigmips_vec
+ targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
;;
mips*-dec-bsd*)
targ_defvec=aout_mips_little_vec
@@ -395,11 +435,11 @@ case "${targ}" in
targ_defvec=bfd_elf32_bigmips_vec
targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
;;
- mips*el*-*-linux* | mips*el*-*-openbsd*)
+ mips*el*-*-linux-gnu* | mips*el*-*-openbsd*)
targ_defvec=bfd_elf32_littlemips_vec
targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
;;
- mips*-*-linux* | mips*-*-openbsd*)
+ mips*-*-linux-gnu* | mips*-*-openbsd*)
targ_defvec=bfd_elf32_bigmips_vec
targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
;;
@@ -425,7 +465,7 @@ case "${targ}" in
targ_defvec=rs6000coff_vec
;;
powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
- powerpc-*-solaris2* | powerpc-*-linux* | powerpc-*-rtems*)
+ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems*)
targ_defvec=bfd_elf32_powerpc_vec
targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec ppcboot_vec"
;;
@@ -437,12 +477,12 @@ case "${targ}" in
targ_selvecs="nlm32_powerpc_vec rs6000coff_vec"
;;
powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
- powerpcle-*-solaris2* | powerpcle-*-linux*)
+ powerpcle-*-solaris2* | powerpcle-*-linux-gnu*)
targ_defvec=bfd_elf32_powerpcle_vec
targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec ppcboot_vec"
;;
- powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin32)
+ powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin32*)
targ_defvec=bfd_powerpcle_pe_vec
targ_selvecs="bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec"
;;
@@ -453,12 +493,12 @@ case "${targ}" in
sh-*-elf*)
targ_defvec=bfd_elf32_sh_vec
- targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec"
+ targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
targ_underscore=yes
;;
- sh-*-*)
+ sh-*-* | sh-*-rtems*)
targ_defvec=shcoff_vec
- targ_selvecs="shcoff_vec shlcoff_vec"
+ targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
targ_underscore=yes
;;
@@ -467,12 +507,15 @@ case "${targ}" in
targ_selvecs=sparcle_aout_vec
targ_underscore=yes
;;
+ sparclite-*-elf*)
+ targ_defvec=bfd_elf32_sparc_vec
+ ;;
sparc-*-linux*aout*)
targ_defvec=sparclinux_vec
targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
targ_underscore=yes
;;
- sparc-*-linux*)
+ sparc-*-linux-gnu*)
targ_defvec=bfd_elf32_sparc_vec
targ_selvecs="sparclinux_vec sunos_big_vec"
;;
@@ -491,20 +534,24 @@ case "${targ}" in
sparc-*-sysv4*)
targ_defvec=bfd_elf32_sparc_vec
;;
+ sparc-*-netware*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="nlm32_sparc_vec sunos_big_vec"
+ ;;
+#ifdef BFD64
sparc64-*-aout*)
targ_defvec=sunos_big_vec
targ_underscore=yes
;;
-#ifdef BFD64
+ sparc64-*-linux-gnu*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
sparc64-*-elf*)
targ_defvec=bfd_elf64_sparc_vec
targ_selvecs=bfd_elf32_sparc_vec
;;
#endif /* BFD64 */
- sparc-*-netware*)
- targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs="nlm32_sparc_vec sunos_big_vec"
- ;;
sparc*-*-coff*)
targ_defvec=sparccoff_vec
;;
@@ -520,6 +567,9 @@ case "${targ}" in
;;
#endif
+ v850-*-*)
+ targ_defvec=bfd_elf32_v850_vec
+ ;;
#if HAVE_host_aout_vec
vax-*-bsd* | vax-*-ultrix*)
targ_defvec=host_aout_vec
diff --git a/contrib/binutils/bfd/config.in b/contrib/binutils/bfd/config.in
index 183c23e..8df4887 100644
--- a/contrib/binutils/bfd/config.in
+++ b/contrib/binutils/bfd/config.in
@@ -1,5 +1,11 @@
/* config.in. Generated automatically from configure.in by autoheader. */
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
+
/* Whether strstr must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSTR
@@ -39,6 +45,9 @@
/* Define if you have the fcntl function. */
#undef HAVE_FCNTL
+/* Define if you have the fdopen function. */
+#undef HAVE_FDOPEN
+
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
diff --git a/contrib/binutils/bfd/configure b/contrib/binutils/bfd/configure
index 5e1e301..a0643a7 100755
--- a/contrib/binutils/bfd/configure
+++ b/contrib/binutils/bfd/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
+# Generated automatically using autoconf version 2.12.1
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -12,15 +12,26 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
+ --enable-shared build shared libraries [default=no]
+ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list"
+ac_help="$ac_help
+ --enable-static build static libraries [default=yes]
+ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list"
+ac_help="$ac_help
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
+ac_help="$ac_help
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)"
ac_help="$ac_help
--enable-targets alternative target configurations"
ac_help="$ac_help
- --enable-shared build shared BFD library"
-ac_help="$ac_help
--enable-commonbfdlib build shared BFD/opcodes/libiberty library"
ac_help="$ac_help
--with-mmap try using mmap for BFD input files if available"
+ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -59,6 +70,7 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
@@ -342,7 +354,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
+ echo "configure generated by autoconf version 2.12.1"
exit 0 ;;
-with-* | --with-*)
@@ -529,62 +541,8 @@ fi
-# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
-if test "${enable_64_bit_bfd+set}" = set; then
- enableval="$enable_64_bit_bfd"
- case "${enableval}" in
- yes) want64=true ;;
- no) want64=false ;;
- *) { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;;
-esac
-else
- want64=false
-fi
-# Check whether --enable-targets or --disable-targets was given.
-if test "${enable_targets+set}" = set; then
- enableval="$enable_targets"
- case "${enableval}" in
- yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
- ;;
- no) enable_targets= ;;
- *) enable_targets=$enableval ;;
-esac
-fi
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- case "${enableval}" in
- yes) shared=true ;;
- no) shared=false ;;
- *bfd*) shared=true ;;
- *) shared=false ;;
-esac
-fi
-# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
-if test "${enable_commonbfdlib+set}" = set; then
- enableval="$enable_commonbfdlib"
- case "${enableval}" in
- yes) commonbfdlib=true ;;
- no) commonbfdlib=false ;;
- *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
-esac
-fi
-# Check whether --with-mmap or --without-mmap was given.
-if test "${with_mmap+set}" = set; then
- withval="$with_mmap"
- case "${withval}" in
- yes) want_mmap=true ;;
- no) want_mmap=false ;;
- *) { echo "configure: error: bad value ${withval} for BFD with-mmap option" 1>&2; exit 1; } ;;
-esac
-else
- want_mmap=false
-fi
-
-
-
ac_aux_dir=
-for ac_dir in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`; do
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -596,7 +554,7 @@ for ac_dir in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`; do
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`" 1>&2; exit 1; }
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
@@ -625,33 +583,33 @@ esac
# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:634: checking host system type" >&5
+echo "configure:592: checking host system type" >&5
host_alias=$host
case "$host_alias" in
NONE)
case $nonopt in
NONE)
- if host_alias=`$ac_config_guess`; then :
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
fi ;;
*) host_alias=$nonopt ;;
esac ;;
esac
-host=`$ac_config_sub $host_alias`
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:655: checking target system type" >&5
+echo "configure:613: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -662,14 +620,14 @@ NONE)
esac ;;
esac
-target=`$ac_config_sub $target_alias`
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:673: checking build system type" >&5
+echo "configure:631: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -680,7 +638,7 @@ NONE)
esac ;;
esac
-build=`$ac_config_sub $build_alias`
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -691,53 +649,10 @@ test "$host_alias" != "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
-if test -z "$target" ; then
- { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
-fi
-if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $. echo might interpret backslashes.
- cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
-fi
-test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
-
-
-host64=false
-target64=false
-
-# host stuff:
-
-ALLLIBS='$(TARGETLIB)'
-PICFLAG=
-SHLIB=unused-shlib
-SHLINK=unused-shlink
-if test "${shared}" = "true"; then
- PICFLAG=-fpic
- if test "${commonbfdlib}" = "true"; then
- ALLLIBS='$(TARGETLIB)'
- else
- ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
- SHLIB=libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/VERSION`
- SHLINK=libbfd.so
- fi
-fi
-
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:741: checking for $ac_word" >&5
+echo "configure:656: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -766,7 +681,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:770: checking for $ac_word" >&5
+echo "configure:685: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -814,7 +729,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:818: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -824,11 +739,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 828 "configure"
+#line 743 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -848,12 +763,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:852: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:767: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:857: checking whether we are using GNU C" >&5
+echo "configure:772: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -862,7 +777,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -877,7 +792,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:881: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:796: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -904,9 +819,8 @@ else
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
-
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:910: checking for POSIXized ISC" >&5
+echo "configure:824: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -927,8 +841,239 @@ else
fi
-# Permit host specific settings.
-. ${srcdir}/configure.host
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:857: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:911: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:968: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=bfd
+
+VERSION=2.9.1
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:1014: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
+else
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:1027: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:1040: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:1053: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
+else
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:1066: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
if test $host != $build; then
@@ -940,7 +1085,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:944: checking for $ac_word" >&5
+echo "configure:1089: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -971,7 +1116,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:975: checking for $ac_word" >&5
+echo "configure:1120: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1002,7 +1147,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1006: checking for $ac_word" >&5
+echo "configure:1151: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1033,96 +1178,627 @@ else
fi
fi
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1048: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=no
+fi
+
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1233: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:1272: checking for ld used by GCC" >&5
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+ /* | [A-Za-z]:\\*)
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:1290: checking for GNU ld" >&5
+else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:1293: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ echo "$ac_t""$LD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:1329: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
+
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:1345: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$NM" in
+/* | [A-Za-z]:\\*)
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac
+fi
+
+NM="$ac_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1382: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 1418 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
;;
esac
- done
- IFS="$ac_save_IFS"
+ fi
+ rm -rf conftest*
+ ;;
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+
+# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
+if test "${enable_64_bit_bfd+set}" = set; then
+ enableval="$enable_64_bit_bfd"
+ case "${enableval}" in
+ yes) want64=true ;;
+ no) want64=false ;;
+ *) { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;;
+esac
+else
+ want64=false
fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+# Check whether --enable-targets or --disable-targets was given.
+if test "${enable_targets+set}" = set; then
+ enableval="$enable_targets"
+ case "${enableval}" in
+ yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
+ ;;
+ no) enable_targets= ;;
+ *) enable_targets=$enableval ;;
+esac
+fi
+# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
+if test "${enable_commonbfdlib+set}" = set; then
+ enableval="$enable_commonbfdlib"
+ case "${enableval}" in
+ yes) commonbfdlib=true ;;
+ no) commonbfdlib=false ;;
+ *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
+esac
+fi
+# Check whether --with-mmap or --without-mmap was given.
+if test "${with_mmap+set}" = set; then
+ withval="$with_mmap"
+ case "${withval}" in
+ yes) want_mmap=true ;;
+ no) want_mmap=false ;;
+ *) { echo "configure: error: bad value ${withval} for BFD with-mmap option" 1>&2; exit 1; } ;;
+esac
+else
+ want_mmap=false
+fi
+
+
+
+
+
+if test -z "$target" ; then
+ { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
+fi
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:1519: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINT=
else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ MAINT='#M#'
fi
+
+
+echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
+echo "configure:1537: checking for Cygwin32 environment" >&5
+if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1542 "configure"
+#include "confdefs.h"
+
+int main() {
+return __CYGWIN32__;
+; return 0; }
+EOF
+if { (eval echo configure:1549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_cygwin32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_cygwin32=no
+fi
+rm -f conftest*
+rm -f conftest*
fi
-echo "$ac_t""$INSTALL" 1>&6
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+echo "$ac_t""$am_cv_cygwin32" 1>&6
+CYGWIN32=
+test "$am_cv_cygwin32" = yes && CYGWIN32=yes
+echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
+echo "configure:1566: checking for Mingw32 environment" >&5
+if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1571 "configure"
+#include "confdefs.h"
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_mingw32" 1>&6
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes
-if test "${shared}" = "true"; then
- if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
- echo "configure: warning: BFD --enable-shared only supported when using gcc" 1>&2
- shared=false
- ALLLIBS='$(TARGETLIB)'
- PICFLAG=
- SHLIB=unused-shlib
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1597: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*
+fi
+
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+echo "$ac_t""${am_cv_exeext}" 1>&6
+
+
+host64=false
+target64=false
+
+# host stuff:
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1629: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1658: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
fi
fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1706: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+cat > conftest.$ac_ext <<EOF
+#line 1716 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:1720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1740: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1745: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-if test "${commonbfdlib}" = "true"; then
- COMMON_SHLIB=yes
- PICLIST=piclist
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1769: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- COMMON_SHLIB=
- PICLIST=
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
+# Permit host specific settings.
+. ${srcdir}/configure.host
-VERSION=`cat ${srcdir}/VERSION`
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
BFD_HOST_64BIT_LONG=0
@@ -1150,9 +1826,34 @@ if test -z "$CC_FOR_BUILD"; then
fi
fi
+# Also set EXEEXT_FOR_BUILD.
+if test "x$cross_compiling" = "xno"; then
+ EXEEXT_FOR_BUILD='$(EXEEXT)'
+else
+ echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
+echo "configure:1835: 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
+ cat > ac_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+ ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
+ bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
+ rm -f ac_c_test*
+ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no
+fi
+
+echo "$ac_t""$bfd_cv_build_exeext" 1>&6
+ EXEEXT_FOR_BUILD=""
+ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
+fi
+
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1156: checking how to run the C preprocessor" >&5
+echo "configure:1857: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1167,13 +1868,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1171 "configure"
+#line 1872 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1184,13 +1885,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1188 "configure"
+#line 1889 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1216,17 +1917,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:1220: checking for $ac_hdr" >&5
+echo "configure:1921: 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 1225 "configure"
+#line 1926 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1256,17 +1957,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:1260: checking for $ac_hdr" >&5
+echo "configure:1961: 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 1265 "configure"
+#line 1966 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1293,12 +1994,12 @@ fi
done
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1297: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1998: 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 1302 "configure"
+#line 2003 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -1307,7 +2008,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -1327,15 +2028,15 @@ EOF
fi
-for ac_func in fcntl getpagesize setitimer sysconf
+for ac_func in fcntl getpagesize setitimer sysconf fdopen
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1334: checking for $ac_func" >&5
+echo "configure:2035: 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 1339 "configure"
+#line 2040 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1358,7 +2059,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1385,7 +2086,7 @@ done
case "${host}" in
-i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
+i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
cat >> confdefs.h <<\EOF
#define USE_BINARY_FOPEN 1
EOF
@@ -1393,12 +2094,12 @@ EOF
esac
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:1397: checking whether strstr must be declared" >&5
+echo "configure:2098: 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 1402 "configure"
+#line 2103 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1419,7 +2120,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:1423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -1441,12 +2142,12 @@ EOF
fi
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:1445: checking whether malloc must be declared" >&5
+echo "configure:2146: 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 1450 "configure"
+#line 2151 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1467,7 +2168,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:1471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -1489,12 +2190,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:1493: checking whether realloc must be declared" >&5
+echo "configure:2194: 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 1498 "configure"
+#line 2199 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1515,7 +2216,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:1519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -1537,12 +2238,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:1541: checking whether free must be declared" >&5
+echo "configure:2242: 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 1546 "configure"
+#line 2247 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1563,7 +2264,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:1567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -1585,12 +2286,12 @@ EOF
fi
echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:1589: checking whether getenv must be declared" >&5
+echo "configure:2290: 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 1594 "configure"
+#line 2295 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1611,7 +2312,7 @@ int main() {
char *(*pfn) = (char *(*)) getenv
; return 0; }
EOF
-if { (eval echo configure:1615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_getenv=no
else
@@ -1638,21 +2339,22 @@ COREFILE=
COREFLAG=
if test "${target}" = "${host}"; then
case "${host}" in
- alpha*-*-linux*)
- COREFILE=trad-core.o
+ alpha*-*-linux-gnu*)
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/alphalinux.h"
EOF
;;
- alpha*-*-*) COREFILE=osf-core.o ;;
- arm-*-riscix) COREFILE=trad-core.o ;;
- hppa*-*-hpux*) COREFILE=hpux-core.o ;;
- hppa*-*-hiux*) COREFILE=hpux-core.o ;;
- hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
+ alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;;
+ alpha*-*-*) COREFILE=osf-core.lo ;;
+ arm-*-riscix) COREFILE=trad-core.lo ;;
+ hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
+ hppa*-*-hiux*) COREFILE=hpux-core.lo ;;
+ hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo"
COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
i[3456]86-sequent-bsd*)
- COREFILE=trad-core.o;
+ COREFILE=trad-core.lo;
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/symmetry.h"
EOF
@@ -1660,88 +2362,88 @@ EOF
;;
i[3456]86-sequent-sysv4*) ;;
i[3456]86-sequent-sysv*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/symmetry.h"
EOF
;;
i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/i386bsd.h"
EOF
;;
i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
- COREFILE=netbsd-core.o
+ COREFILE=netbsd-core.lo
;;
i[3456]86-esix-sysv3*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/esix.h"
EOF
;;
i[3456]86-*-sco* | i[3456]86-*-isc*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/i386sco.h"
EOF
;;
i[3456]86-*-mach3*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/i386mach3.h"
EOF
;;
- i[3456]86-*-linux*)
- COREFILE=trad-core.o
+ i[3456]86-*-linux-gnu*)
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/i386linux.h"
EOF
;;
- i[3456]86-*-isc*) COREFILE=trad-core.o ;;
- i[3456]86-*-aix*) COREFILE=aix386-core.o ;;
+ i[3456]86-*-isc*) COREFILE=trad-core.lo ;;
+ i[3456]86-*-aix*) COREFILE=aix386-core.lo ;;
i860-*-mach3* | i860-*-osf1*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/i860mach3.h"
EOF
;;
mips-dec-bsd*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/mipsbsd.h"
EOF
;;
mips-dec-mach3*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/mipsmach3.h"
EOF
;;
mips-*-netbsd* | mips*-*-openbsd*)
- COREFILE=netbsd-core.o
+ COREFILE=netbsd-core.lo
;;
mips-dec-*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/decstation.h"
EOF
;;
- mips-sgi-irix4*) COREFILE=irix-core.o ;;
- mips-sgi-irix5*) COREFILE=irix-core.o ;;
- mips-sgi-irix6*) COREFILE=irix-core.o ;;
+ mips-sgi-irix4*) COREFILE=irix-core.lo ;;
+ mips-sgi-irix5*) COREFILE=irix-core.lo ;;
+ mips-sgi-irix6*) COREFILE=irix-core.lo ;;
mips-*-mach3*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/mipsmach3.h"
EOF
@@ -1749,117 +2451,118 @@ EOF
;;
mips-*-sysv4*) ;;
mips-*-sysv* | mips-*-riscos*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/riscos.h"
EOF
;;
mips-sony-bsd*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/news-mips.h"
EOF
;;
m68*-bull*-sysv*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/dpx2.h"
EOF
;;
- m68*-hp-hpux*) COREFILE=hpux-core.o ;;
+ m68*-hp-hpux*) COREFILE=hpux-core.lo ;;
m68*-hp-bsd*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/hp300bsd.h"
EOF
;;
- m68*-*-linux*)
- COREFILE=trad-core.o
+ m68*-*-linux-gnu*)
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/m68klinux.h"
EOF
;;
m68*-motorola-sysv*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/delta68.h"
EOF
;;
m68*-sony-*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/news.h"
EOF
;;
m68*-*-netbsd* | m68*-*-openbsd*)
- COREFILE=netbsd-core.o
+ COREFILE=netbsd-core.lo
;;
m68*-apple-aux*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/m68kaux.h"
EOF
;;
m88*-*-sysv4*) ;;
- m88*-motorola-sysv*) COREFILE=ptrace-core.o ;;
+ m88*-motorola-sysv*) COREFILE=ptrace-core.lo ;;
m88*-*-mach3*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/m88kmach3.h"
EOF
;;
ns32k-pc532-mach)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/pc532mach.h"
EOF
;;
ns32k-*-netbsd* | ns32k-*-openbsd*)
- COREFILE=netbsd-core.o
+ COREFILE=netbsd-core.lo
;;
- rs6000-*-lynx*) COREFILE=lynx-core.o ;;
- rs6000-*-aix4*) COREFILE=rs6000-core.o ;;
- rs6000-*-*) COREFILE=rs6000-core.o ;;
- powerpc-*-*bsd*) COREFILE=netbsd-core.o ;;
- powerpc-*-aix4*) COREFILE=rs6000-core.o ;;
- powerpc-*-aix*) COREFILE=rs6000-core.o ;;
+ rs6000-*-lynx*) COREFILE=lynx-core.lo ;;
+ rs6000-*-aix4*) COREFILE=rs6000-core.lo ;;
+ rs6000-*-*) COREFILE=rs6000-core.lo ;;
+ powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;;
+ powerpc-*-aix4*) COREFILE=rs6000-core.lo ;;
+ powerpc-*-aix*) COREFILE=rs6000-core.lo ;;
powerpc-*-beos*) ;;
+ powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;;
sparc-*-netbsd* | sparc-*-openbsd*)
- COREFILE=netbsd-core.o
+ COREFILE=netbsd-core.lo
;;
tahoe-*-*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/tahoe.h"
EOF
;;
vax-*-ultrix2*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/vaxult2.h"
EOF
;;
vax-*-ultrix*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/vaxult2.h"
EOF
;;
vax-*-*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
cat >> confdefs.h <<\EOF
#define TRAD_HEADER "hosts/vaxbsd.h"
EOF
@@ -1868,34 +2571,35 @@ EOF
esac
case "$COREFILE" in
- aix386-core.o) COREFLAG=-DAIX386_CORE ;;
- hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
- hpux-core.o) COREFLAG=-DHPUX_CORE ;;
- irix-core.o) COREFLAG=-DIRIX_CORE ;;
- lynx-core.o) COREFLAG=-DLYNX_CORE ;;
- osf-core.o) COREFLAG=-DOSF_CORE ;;
- ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
- rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
- trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
+ aix386-core.lo) COREFLAG=-DAIX386_CORE ;;
+ hppabsd-core.lo) COREFLAG=-DHPPABSD_CORE ;;
+ hpux-core.lo) COREFLAG=-DHPUX_CORE ;;
+ irix-core.lo) COREFLAG=-DIRIX_CORE ;;
+ lynx-core.lo) COREFLAG=-DLYNX_CORE ;;
+ netbsd-core.lo) COREFLAG=-DNETBSD_CORE ;;
+ osf-core.lo) COREFLAG=-DOSF_CORE ;;
+ ptrace-core.lo) COREFLAG=-DPTRACE_CORE ;;
+ rs6000-core.lo) COREFLAG="$COREFLAG -DAIX_CORE" ;;
+ trad-core.lo) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
esac
# The ELF code uses the native <sys/procfs.h> to handle core files.
# Define HAVE_SYS_PROCFS_H if the file exists and defines
# prstatus_t.
echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
-echo "configure:1887: checking for sys/procfs.h" >&5
+echo "configure:2591: checking for sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1892 "configure"
+#line 2596 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
prstatus_t t;
; return 0; }
EOF
-if { (eval echo configure:1899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_header_sys_procfs_h=yes
else
@@ -1973,6 +2677,7 @@ for i in $selvecs ; do
done
selvecs="$f"
+
# uniq the architectures in all the configured targets.
f=""
for i in $selarchs ; do
@@ -1986,135 +2691,144 @@ selarchs="$f"
# Target backend .o files.
tb=
-elf="elf.o elflink.o"
+elf="elf.lo elflink.lo dwarf2.lo"
for vec in $selvecs
do
case "$vec" in
# This list is alphabetized to make it easy to compare
# with the two vector lists in targets.c.
- a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
- a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o" ;;
- armcoff_little_vec) tb="$tb coff-arm.o cofflink.o " ;;
- armcoff_big_vec) tb="$tb coff-arm.o cofflink.o " ;;
- armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
- armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
- armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
- armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
- aout0_big_vec) tb="$tb aout0.o aout32.o" ;;
- aout_arm_big_vec) tb="$tb aout-arm.o aout32.o" ;;
- aout_arm_little_vec) tb="$tb aout-arm.o aout32.o" ;;
- aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o" ;;
- aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o" ;;
- apollocoff_vec) tb="$tb coff-apollo.o" ;;
- b_out_vec_big_host) tb="$tb bout.o aout32.o" ;;
- b_out_vec_little_host) tb="$tb bout.o aout32.o" ;;
- bfd_elf64_alpha_vec) tb="$tb elf64-alpha.o elf64.o $elf"
+ a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;;
+ a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
+ armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
+ armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
+ armpe_little_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
+ armpe_big_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
+ armpei_little_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
+ armpei_big_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
+ aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
+ aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
+ aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
+ aout_mips_big_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
+ aout_mips_little_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
+ apollocoff_vec) tb="$tb coff-apollo.lo" ;;
+ b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;;
+ b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;;
+ bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"
target64=true ;;
- bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
- bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
- bfd_elf64_bigmips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
+ bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
+ bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
target64=true ;;
- bfd_elf32_d10v_vec) tb="$tb elf32-d10v.o elf32.o $elf" ;;
- bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
- bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
- bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
- bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
- bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
- bfd_elf64_littlemips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
+ bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
+ bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
+ bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
+ bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
target64=true ;;
- bfd_elf32_m32r_vec) tb="$tb elf32-m32r.o elf32.o $elf" ;;
- bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
- bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
- bfd_elf32_mn10200_vec) tb="$tb elf-m10200.o elf32.o $elf" ;;
- bfd_elf32_mn10300_vec) tb="$tb elf-m10300.o elf32.o $elf" ;;
- bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
- bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
- bfd_elf32_sh_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
- bfd_elf32_shl_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
- bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
- bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
+ bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
+ bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
+ bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
+ bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
+ bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
+ bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
+ bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
+ bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
+ bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
+ bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
+ bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
target64=true ;;
- bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
+ bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
target64=true ;;
- bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
+ bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"
target64=true ;;
- cisco_core_vec) tb="$tb cisco-core.o" ;;
- demo_64_vec) tb="$tb demo64.o aout64.o"
+ cisco_core_vec) tb="$tb cisco-core.lo" ;;
+ demo_64_vec) tb="$tb demo64.lo aout64.lo"
target64=true ;;
- ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
- ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
- ecoff_biglittle_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
- ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
+ ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"
target64=true ;;
- evax_alpha_vec) tb="$tb evax-alpha.o evax-emh.o evax-egsd.o evax-etir.o evax-misc.o"
+ go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
+ go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
+ evax_alpha_vec) tb="$tb evax-alpha.lo evax-emh.lo evax-egsd.lo evax-etir.lo evax-misc.lo"
target64=true ;;
- h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
- h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
- host_aout_vec) tb="$tb host-aout.o aout32.o" ;;
- hp300bsd_vec) tb="$tb hp300bsd.o aout32.o" ;;
- hp300hpux_vec) tb="$tb hp300hpux.o aout32.o" ;;
- i386aout_vec) tb="$tb i386aout.o aout32.o" ;;
- i386bsd_vec) tb="$tb i386bsd.o aout32.o" ;;
- i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
- i386dynix_vec) tb="$tb i386dynix.o aout32.o" ;;
- i386freebsd_vec) tb="$tb i386freebsd.o aout32.o" ;;
- i386msdos_vec) tb="$tb i386msdos.o" ;;
- i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
- i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
- i386linux_vec) tb="$tb i386linux.o aout32.o" ;;
- i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o" ;;
- i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o" ;;
- i386mach3_vec) tb="$tb i386mach3.o aout32.o" ;;
- i386netbsd_vec) tb="$tb i386netbsd.o aout32.o" ;;
- i386os9k_vec) tb="$tb i386os9k.o aout32.o" ;;
- i860coff_vec) tb="$tb coff-i860.o cofflink.o" ;;
- icoff_big_vec) tb="$tb coff-i960.o cofflink.o" ;;
- icoff_little_vec) tb="$tb coff-i960.o cofflink.o" ;;
- ieee_vec) tb="$tb ieee.o" ;;
- m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
- m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
- m68klinux_vec) tb="$tb m68klinux.o aout32.o" ;;
- m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o" ;;
- m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o" ;;
- m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o" ;;
- m68k4knetbsd_vec) tb="$tb m68k4knetbsd.o aout32.o" ;;
- m68kaux_coff_vec) tb="$tb coff-aux.o coff-m68k.o cofflink.o" ;;
- m68ksysvcoff_vec) tb="$tb coff-svm68k.o cofflink.o" ;;
- m88kbcs_vec) tb="$tb coff-m88k.o" ;;
- newsos3_vec) tb="$tb newsos3.o aout32.o" ;;
- nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
- nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
- nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
+ h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
+ h8500coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;;
+ host_aout_vec) tb="$tb host-aout.lo aout32.lo" ;;
+ hp300bsd_vec) tb="$tb hp300bsd.lo aout32.lo" ;;
+ hp300hpux_vec) tb="$tb hp300hpux.lo aout32.lo" ;;
+ i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;;
+ i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;;
+ i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;;
+ i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
+ i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
+ i386msdos_vec) tb="$tb i386msdos.lo" ;;
+ i386pe_vec) tb="$tb pe-i386.lo cofflink.lo " ;;
+ i386pei_vec) tb="$tb pei-i386.lo cofflink.lo" ;;
+ i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
+ i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
+ i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
+ i386mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;;
+ i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;;
+ i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;;
+ i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;;
+ icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
+ icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
+ ieee_vec) tb="$tb ieee.lo" ;;
+ m68kcoff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;;
+ m68kcoffun_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
+ m68klinux_vec) tb="$tb m68klinux.lo aout32.lo" ;;
+ m68klynx_aout_vec) tb="$tb m68klynx.lo lynx-core.lo aout32.lo" ;;
+ m68klynx_coff_vec) tb="$tb cf-m68klynx.lo coff-m68k.lo cofflink.lo lynx-core.lo" ;;
+ m68knetbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;;
+ m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;
+ m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
+ m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
+ m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
+ newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
+ nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
+ nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
+ nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
target64=true ;;
- riscix_vec) tb="$tb aout32.o riscix.o" ;;
- nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
- pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o" ;;
- pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o" ;;
- pmac_xcoff_vec) tb="$tb coff-pmac.o xcofflink.o" ;;
- rs6000coff_vec) tb="$tb coff-rs6000.o xcofflink.o" ;;
- bfd_powerpc_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
- bfd_powerpcle_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
- bfd_powerpc_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
- bfd_powerpcle_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
- ppcboot_vec) tb="$tb ppcboot.o" ;;
- shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
- shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
- som_vec) tb="$tb som.o" ;;
- sparcle_aout_vec) tb="$tb aout-sparcle.o aout32.o" ;;
- sparclinux_vec) tb="$tb sparclinux.o aout32.o stab-syms.o" ;;
- sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o" ;;
- sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o" ;;
- sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o" ;;
- sparccoff_vec) tb="$tb coff-sparc.o" ;;
- srec_vec) tb="$tb srec.o" ;;
- sunos_big_vec) tb="$tb sunos.o aout32.o" ;;
- symbolsrec_vec) tb="$tb srec.o" ;;
- tekhex_vec) tb="$tb tekhex.o" ;;
- we32kcoff_vec) tb="$tb coff-we32k.o" ;;
- z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
- w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
- versados_vec) tb="$tb versados.o" ;;
+ riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
+ nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
+ pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
+ pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
+ pmac_xcoff_vec) tb="$tb coff-pmac.lo xcofflink.lo" ;;
+ rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
+ bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
+ bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
+ bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
+ bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
+ ppcboot_vec) tb="$tb ppcboot.lo" ;;
+ shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ som_vec) tb="$tb som.lo" ;;
+ sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
+ sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
+ sparclynx_aout_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
+ sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
+ sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
+ sparccoff_vec) tb="$tb coff-sparc.lo" ;;
+ srec_vec) tb="$tb srec.lo" ;;
+ sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;;
+ symbolsrec_vec) tb="$tb srec.lo" ;;
+ tekhex_vec) tb="$tb tekhex.lo" ;;
+ tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
+ tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
+ we32kcoff_vec) tb="$tb coff-we32k.lo" ;;
+ z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo" ;;
+ w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
+ versados_vec) tb="$tb versados.lo" ;;
"") ;;
*) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;;
@@ -2124,7 +2838,7 @@ done
# Target architecture .o files.
# A couple of CPUs use shorter file names to avoid problems on DOS
# filesystems.
-ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`
+ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`
# Weed out duplicate .o files.
f=""
@@ -2196,17 +2910,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2200: checking for $ac_hdr" >&5
+echo "configure:2914: 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 2205 "configure"
+#line 2919 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2235,12 +2949,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2239: checking for $ac_func" >&5
+echo "configure:2953: 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 2244 "configure"
+#line 2958 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2263,7 +2977,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2288,7 +3002,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2292: checking for working mmap" >&5
+echo "configure:3006: 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
@@ -2296,7 +3010,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2300 "configure"
+#line 3014 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2436,7 +3150,7 @@ main()
}
EOF
-if { (eval echo configure:2440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -2461,12 +3175,12 @@ fi
for ac_func in madvise mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2465: checking for $ac_func" >&5
+echo "configure:3179: 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 2470 "configure"
+#line 3184 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2489,7 +3203,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2544,7 +3258,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -2611,7 +3325,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -2631,6 +3345,7 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
@@ -2668,27 +3383,32 @@ s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@CC@%$CC%g
-s%@HDEFINES@%$HDEFINES%g
-s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@ALLLIBS@%$ALLLIBS%g
-s%@PICFLAG@%$PICFLAG%g
-s%@SHLIB@%$SHLIB%g
-s%@SHLIB_CC@%$SHLIB_CC%g
-s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
-s%@SHLIB_LIBS@%$SHLIB_LIBS%g
-s%@COMMON_SHLIB@%$COMMON_SHLIB%g
-s%@PICLIST@%$PICLIST%g
-s%@SHLINK@%$SHLINK%g
-s%@INSTALL_SHLIB@%$INSTALL_SHLIB%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@AR@%$AR%g
+s%@RANLIB@%$RANLIB%g
+s%@LD@%$LD%g
+s%@NM@%$NM%g
+s%@LN_S@%$LN_S%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@MAINT@%$MAINT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@HDEFINES@%$HDEFINES%g
s%@BFD_HOST_64BIT_LONG@%$BFD_HOST_64BIT_LONG%g
s%@BFD_HOST_64_BIT_DEFINED@%$BFD_HOST_64_BIT_DEFINED%g
s%@BFD_HOST_64_BIT@%$BFD_HOST_64_BIT%g
s%@BFD_HOST_U_64_BIT@%$BFD_HOST_U_64_BIT%g
s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
+s%@EXEEXT_FOR_BUILD@%$EXEEXT_FOR_BUILD%g
s%@CPP@%$CPP%g
s%@COREFILE@%$COREFILE%g
s%@COREFLAG@%$COREFLAG%g
@@ -2908,9 +3628,11 @@ fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
+
EOF
cat >> $CONFIG_STATUS <<\EOF
-case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
+test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
exit 0
EOF
chmod +x $CONFIG_STATUS
diff --git a/contrib/binutils/bfd/configure.host b/contrib/binutils/bfd/configure.host
index 2983274..769c0a2 100644
--- a/contrib/binutils/bfd/configure.host
+++ b/contrib/binutils/bfd/configure.host
@@ -11,24 +11,15 @@
# host64 set to true if 64 bit types are as fast as 32 bit
# HOST_64BIT_TYPE host 64 bit type
# HOST_U_64BIT_TYPE unsigned 64 bit type (not needed if 64BIT_TYPE is long)
-# SHLIB_CC compiler to use when building shared library
-# SHLIB_CFLAGS flags to use when building shared library
-# SHLIB_LIBS libraries to use when building shared library
-# PICFLAG may be set to flag to use to compile PIC
-# SHLINK may be set to the name to link the shared library to
-# ALLLIBS may be set to libraries to build
-# HLDFLAGS LDFLAGS specific to the host
-# HLDENV environment variable to set when linking for the host
-# RPATH_ENVVAR environment variable used to find shared libraries
-# INSTALL_SHLIB install a shared library
HDEFINES=
host64=false
HOST_64BIT_TYPE=
+HOST_U_64BIT_TYPE=
case "${host}" in
-alpha-*-*) host64=true; HOST_64BIT_TYPE=long ;;
+alpha*-*-*) host64=true; HOST_64BIT_TYPE=long ;;
hppa*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX ;;
hppa*-*-hiux*) HDEFINES=-DHOST_HPPAHPUX ;;
@@ -76,96 +67,3 @@ m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;;
ac_cv_header_unistd_h=no
;;
esac
-
-# If we are configuring with --enable-shared, adjust the shared
-# library support based on the host. This support must work for both
-# the BFD and the opcodes libraries.
-HLDFLAGS=
-HLDENV=
-RPATH_ENVVAR=LD_LIBRARY_PATH
-SHLIB_CC='$(CC)'
-SHLIB_CFLAGS='-shared'
-SHLIB_LIBS=
-INSTALL_SHLIB='$(INSTALL_PROGRAM) $$f $(libdir)/$$tf;'
-if [ "${shared}" = "true" ]; then
- case "${host}" in
- hppa*-*-*) picfrag=${srcdir}/../config/mh-papic ;;
- i[34566]86-*-*) picfrag=${srcdir}/../config/mh-x86pic ;;
- *-*-*) picfrag=${srcdir}/../config/mh-${host_cpu}pic ;;
- esac
- if [ -f "${picfrag}" ]; then
- pic=`sed -n -e 's/^PICFLAG[ ]*=[ ]*\(.*\)$/\1/p' ${picfrag}`
- if [ -n "${pic}" ]; then
- PICFLAG=${pic}
- fi
- fi
-
- case "${host}" in
- *-dec-osf*)
- # -fpic is not needed on the Alpha.
- PICFLAG=
- HLDFLAGS='-rpath $(libdir)'
- SHLIB_CFLAGS='-shared -Wl,-soname,$(SONAME)'
- ;;
- *-*-hpux*)
- # HP/UX uses .sl for shared libraries.
- SHLINK=`echo ${SHLINK} | sed -e 's/so$/sl/'`
- SHLIB_CFLAGS='-shared $(PICFLAG)'
- HLDFLAGS='-Wl,+s,+b,$(libdir)'
- RPATH_ENVVAR=SHLIB_PATH
- INSTALL_SHLIB='$(INSTALL_PROGRAM) $$f $(libdir)/$$tf; chmod -w $(libdir)/$$tf;'
- ;;
- *-*-irix[56]*)
- # -fpic is not needed on Irix 5 or 6.
- PICFLAG=
- SHLIB_CFLAGS='-shared -Wl,-soname,$(SONAME)'
- HLDFLAGS='-Wl,-rpath,$(libdir)'
- ;;
- *-*-linux*aout*)
- ;;
- *-*-linux*)
- SHLIB_CFLAGS='-shared -Wl,-soname,$(SONAME)'
- case "${libdir}" in
- /lib | /usr/lib) ;;
- *) HLDFLAGS='-Wl,-rpath,$(libdir)' ;;
- esac
- # On Linux, apparently, linking against -lc lets ldconfig figure
- # out which version of libc should be used.
- SHLIB_LIBS=-lc
- ;;
- *-*-solaris*)
- SHLIB_CFLAGS='-shared -h $(SONAME)'
- HLDFLAGS='-R $(libdir)'
- ;;
- *-*-sysv4*)
- SHLIB_CFLAGS='-shared -h $(SONAME)'
- HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
- ;;
- *-*-sunos*)
- # Build a libTARGET-bfd.so.VERSION symlink in the object directory.
- ALLLIBS=`echo ${ALLLIBS} | sed -e 's/\$(SHLINK)/stamp-tshlink/'`
- ;;
- esac
-fi
-
-# On SunOS, if the linker supports the -rpath option, use it to
-# prevent ../bfd and ../opcodes from being included in the run time
-# search path.
-case "${host}" in
- *-*-sunos*)
- echo 'main () { }' > conftest.c
- ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
- if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
- :
- elif grep 'No such file' conftest.t >/dev/null 2>&1; then
- :
- elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
- :
- elif [ "${shared}" = "true" ]; then
- HLDFLAGS='-Wl,-rpath=$(libdir)'
- else
- HLDFLAGS='-Wl,-rpath='
- fi
- rm -f conftest.t conftest.c conftest
- ;;
-esac
diff --git a/contrib/binutils/bfd/configure.in b/contrib/binutils/bfd/configure.in
index c62e729..f8951e6 100644
--- a/contrib/binutils/bfd/configure.in
+++ b/contrib/binutils/bfd/configure.in
@@ -1,8 +1,25 @@
dnl Process this file with autoconf to produce a configure script.
dnl
+
AC_PREREQ(2.5)
AC_INIT(libbfd.c)
+AC_CANONICAL_SYSTEM
+AC_ISC_POSIX
+
+AM_INIT_AUTOMAKE(bfd, 2.9.1)
+
+dnl These must be called before AM_PROG_LIBTOOL, because it may want
+dnl to call AC_CHECK_PROG.
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+
+dnl Default to a non shared library. This may be overridden by the
+dnl configure option --enable-shared.
+AM_DISABLE_SHARED
+
+AM_PROG_LIBTOOL
+
AC_ARG_ENABLE(64-bit-bfd,
[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
[case "${enableval}" in
@@ -18,14 +35,6 @@ AC_ARG_ENABLE(targets,
no) enable_targets= ;;
*) enable_targets=$enableval ;;
esac])dnl
-AC_ARG_ENABLE(shared,
-[ --enable-shared build shared BFD library],
-[case "${enableval}" in
- yes) shared=true ;;
- no) shared=false ;;
- *bfd*) shared=true ;;
- *) shared=false ;;
-esac])dnl
AC_ARG_ENABLE(commonbfdlib,
[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
[case "${enableval}" in
@@ -41,79 +50,29 @@ AC_ARG_WITH(mmap,
*) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
esac],[want_mmap=false])dnl
-AC_CONFIG_HEADER(config.h:config.in)
+AM_CONFIG_HEADER(config.h:config.in)
-AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
-AC_CANONICAL_SYSTEM
if test -z "$target" ; then
AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
fi
AC_ARG_PROGRAM
+AM_MAINTAINER_MODE
+AM_CYGWIN32
+AM_EXEEXT
+
host64=false
target64=false
# host stuff:
-ALLLIBS='$(TARGETLIB)'
-PICFLAG=
-SHLIB=unused-shlib
-SHLINK=unused-shlink
-if test "${shared}" = "true"; then
- PICFLAG=-fpic
- if test "${commonbfdlib}" = "true"; then
- ALLLIBS='$(TARGETLIB)'
- else
- ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
-changequote(,)dnl
- SHLIB=libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/VERSION`
-changequote([,])dnl
- SHLINK=libbfd.so
- fi
-fi
-
AC_PROG_CC
-AC_ISC_POSIX
-
# Permit host specific settings.
. ${srcdir}/configure.host
AC_SUBST(HDEFINES)
-AC_CHECK_TOOL(AR, ar)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_PROG_INSTALL
-
-if test "${shared}" = "true"; then
- if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
- AC_MSG_WARN([BFD --enable-shared only supported when using gcc])
- shared=false
- ALLLIBS='$(TARGETLIB)'
- PICFLAG=
- SHLIB=unused-shlib
- fi
-fi
-
-AC_SUBST(ALLLIBS)
-AC_SUBST(PICFLAG)
-AC_SUBST(SHLIB)
-AC_SUBST(SHLIB_CC)
-AC_SUBST(SHLIB_CFLAGS)
-AC_SUBST(SHLIB_LIBS)
-if test "${commonbfdlib}" = "true"; then
- COMMON_SHLIB=yes
- PICLIST=piclist
-else
- COMMON_SHLIB=
- PICLIST=
-fi
-AC_SUBST(COMMON_SHLIB)
-AC_SUBST(PICLIST)
-AC_SUBST(SHLINK)
-AC_SUBST(INSTALL_SHLIB)
-
-VERSION=`cat ${srcdir}/VERSION`
-AC_SUBST(VERSION)
+AM_PROG_INSTALL
BFD_HOST_64BIT_LONG=0
BFD_HOST_64_BIT_DEFINED=0
@@ -136,7 +95,7 @@ BFD_CC_FOR_BUILD
AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
AC_HEADER_TIME
-AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf)
+AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen)
BFD_BINARY_FOPEN
@@ -151,182 +110,185 @@ COREFILE=
COREFLAG=
if test "${target}" = "${host}"; then
case "${host}" in
- alpha*-*-linux*)
- COREFILE=trad-core.o
+ alpha*-*-linux-gnu*)
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/alphalinux.h")
;;
- alpha*-*-*) COREFILE=osf-core.o ;;
- arm-*-riscix) COREFILE=trad-core.o ;;
- hppa*-*-hpux*) COREFILE=hpux-core.o ;;
- hppa*-*-hiux*) COREFILE=hpux-core.o ;;
- hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
+ alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;;
+ alpha*-*-*) COREFILE=osf-core.lo ;;
+ arm-*-riscix) COREFILE=trad-core.lo ;;
+ hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
+ hppa*-*-hiux*) COREFILE=hpux-core.lo ;;
+ hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo"
COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
changequote(,)dnl
i[3456]86-sequent-bsd*)
changequote([,])dnl
- COREFILE=trad-core.o;
+ COREFILE=trad-core.lo;
AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
;;
changequote(,)dnl
i[3456]86-sequent-sysv4*) ;;
i[3456]86-sequent-sysv*)
changequote([,])dnl
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
;;
changequote(,)dnl
i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
changequote([,])dnl
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/i386bsd.h")
;;
changequote(,)dnl
i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
changequote([,])dnl
- COREFILE=netbsd-core.o
+ COREFILE=netbsd-core.lo
;;
changequote(,)dnl
i[3456]86-esix-sysv3*)
changequote([,])dnl
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/esix.h")
;;
changequote(,)dnl
i[3456]86-*-sco* | i[3456]86-*-isc*)
changequote([,])dnl
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/i386sco.h")
;;
changequote(,)dnl
i[3456]86-*-mach3*)
changequote([,])dnl
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/i386mach3.h")
;;
changequote(,)dnl
- i[3456]86-*-linux*)
+ i[3456]86-*-linux-gnu*)
changequote([,])dnl
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/i386linux.h")
;;
changequote(,)dnl
- i[3456]86-*-isc*) COREFILE=trad-core.o ;;
- i[3456]86-*-aix*) COREFILE=aix386-core.o ;;
+ i[3456]86-*-isc*) COREFILE=trad-core.lo ;;
+ i[3456]86-*-aix*) COREFILE=aix386-core.lo ;;
changequote([,])dnl
i860-*-mach3* | i860-*-osf1*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/i860mach3.h")
;;
mips-dec-bsd*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/mipsbsd.h")
;;
mips-dec-mach3*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
;;
mips-*-netbsd* | mips*-*-openbsd*)
- COREFILE=netbsd-core.o
+ COREFILE=netbsd-core.lo
;;
mips-dec-*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/decstation.h")
;;
- mips-sgi-irix4*) COREFILE=irix-core.o ;;
- mips-sgi-irix5*) COREFILE=irix-core.o ;;
- mips-sgi-irix6*) COREFILE=irix-core.o ;;
+ mips-sgi-irix4*) COREFILE=irix-core.lo ;;
+ mips-sgi-irix5*) COREFILE=irix-core.lo ;;
+ mips-sgi-irix6*) COREFILE=irix-core.lo ;;
mips-*-mach3*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
;;
mips-*-sysv4*) ;;
mips-*-sysv* | mips-*-riscos*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/riscos.h")
;;
mips-sony-bsd*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/news-mips.h")
;;
m68*-bull*-sysv*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/dpx2.h")
;;
- m68*-hp-hpux*) COREFILE=hpux-core.o ;;
+ m68*-hp-hpux*) COREFILE=hpux-core.lo ;;
m68*-hp-bsd*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/hp300bsd.h")
;;
- m68*-*-linux*)
- COREFILE=trad-core.o
+ m68*-*-linux-gnu*)
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/m68klinux.h")
;;
m68*-motorola-sysv*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER, "hosts/delta68.h")
;;
m68*-sony-*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/news.h")
;;
m68*-*-netbsd* | m68*-*-openbsd*)
- COREFILE=netbsd-core.o
+ COREFILE=netbsd-core.lo
;;
m68*-apple-aux*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/m68kaux.h")
;;
m88*-*-sysv4*) ;;
- m88*-motorola-sysv*) COREFILE=ptrace-core.o ;;
+ m88*-motorola-sysv*) COREFILE=ptrace-core.lo ;;
m88*-*-mach3*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/m88kmach3.h")
;;
ns32k-pc532-mach)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/pc532mach.h")
;;
ns32k-*-netbsd* | ns32k-*-openbsd*)
- COREFILE=netbsd-core.o
- ;;
- rs6000-*-lynx*) COREFILE=lynx-core.o ;;
- rs6000-*-aix4*) COREFILE=rs6000-core.o ;;
- rs6000-*-*) COREFILE=rs6000-core.o ;;
- powerpc-*-*bsd*) COREFILE=netbsd-core.o ;;
- powerpc-*-aix4*) COREFILE=rs6000-core.o ;;
- powerpc-*-aix*) COREFILE=rs6000-core.o ;;
+ COREFILE=netbsd-core.lo
+ ;;
+ rs6000-*-lynx*) COREFILE=lynx-core.lo ;;
+ rs6000-*-aix4*) COREFILE=rs6000-core.lo ;;
+ rs6000-*-*) COREFILE=rs6000-core.lo ;;
+ powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;;
+ powerpc-*-aix4*) COREFILE=rs6000-core.lo ;;
+ powerpc-*-aix*) COREFILE=rs6000-core.lo ;;
powerpc-*-beos*) ;;
+ powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;;
sparc-*-netbsd* | sparc-*-openbsd*)
- COREFILE=netbsd-core.o
+ COREFILE=netbsd-core.lo
;;
tahoe-*-*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/tahoe.h")
;;
vax-*-ultrix2*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
;;
vax-*-ultrix*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
;;
vax-*-*)
- COREFILE=trad-core.o
+ COREFILE=trad-core.lo
AC_DEFINE(TRAD_HEADER,"hosts/vaxbsd.h")
;;
esac
case "$COREFILE" in
- aix386-core.o) COREFLAG=-DAIX386_CORE ;;
- hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
- hpux-core.o) COREFLAG=-DHPUX_CORE ;;
- irix-core.o) COREFLAG=-DIRIX_CORE ;;
- lynx-core.o) COREFLAG=-DLYNX_CORE ;;
- osf-core.o) COREFLAG=-DOSF_CORE ;;
- ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
- rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
- trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
+ aix386-core.lo) COREFLAG=-DAIX386_CORE ;;
+ hppabsd-core.lo) COREFLAG=-DHPPABSD_CORE ;;
+ hpux-core.lo) COREFLAG=-DHPUX_CORE ;;
+ irix-core.lo) COREFLAG=-DIRIX_CORE ;;
+ lynx-core.lo) COREFLAG=-DLYNX_CORE ;;
+ netbsd-core.lo) COREFLAG=-DNETBSD_CORE ;;
+ osf-core.lo) COREFLAG=-DOSF_CORE ;;
+ ptrace-core.lo) COREFLAG=-DPTRACE_CORE ;;
+ rs6000-core.lo) COREFLAG="$COREFLAG -DAIX_CORE" ;;
+ trad-core.lo) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
esac
# The ELF code uses the native <sys/procfs.h> to handle core files.
@@ -400,6 +362,7 @@ for i in $selvecs ; do
done
selvecs="$f"
+
# uniq the architectures in all the configured targets.
f=""
for i in $selarchs ; do
@@ -413,135 +376,144 @@ selarchs="$f"
# Target backend .o files.
tb=
-elf="elf.o elflink.o"
+elf="elf.lo elflink.lo dwarf2.lo"
for vec in $selvecs
do
case "$vec" in
# This list is alphabetized to make it easy to compare
# with the two vector lists in targets.c.
- a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
- a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o" ;;
- armcoff_little_vec) tb="$tb coff-arm.o cofflink.o " ;;
- armcoff_big_vec) tb="$tb coff-arm.o cofflink.o " ;;
- armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
- armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
- armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
- armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
- aout0_big_vec) tb="$tb aout0.o aout32.o" ;;
- aout_arm_big_vec) tb="$tb aout-arm.o aout32.o" ;;
- aout_arm_little_vec) tb="$tb aout-arm.o aout32.o" ;;
- aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o" ;;
- aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o" ;;
- apollocoff_vec) tb="$tb coff-apollo.o" ;;
- b_out_vec_big_host) tb="$tb bout.o aout32.o" ;;
- b_out_vec_little_host) tb="$tb bout.o aout32.o" ;;
- bfd_elf64_alpha_vec) tb="$tb elf64-alpha.o elf64.o $elf"
+ a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;;
+ a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
+ armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
+ armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
+ armpe_little_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
+ armpe_big_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
+ armpei_little_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
+ armpei_big_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
+ aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
+ aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
+ aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
+ aout_mips_big_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
+ aout_mips_little_vec) tb="$tb mipsbsd.lo aout32.lo" ;;
+ apollocoff_vec) tb="$tb coff-apollo.lo" ;;
+ b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;;
+ b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;;
+ bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"
target64=true ;;
- bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
- bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
- bfd_elf64_bigmips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
+ bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
+ bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
target64=true ;;
- bfd_elf32_d10v_vec) tb="$tb elf32-d10v.o elf32.o $elf" ;;
- bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
- bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
- bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
- bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
- bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
- bfd_elf64_littlemips_vec) tb="$tb elf64-mips.o elf64.o elf32-mips.o elf32.o $elf ecofflink.o"
+ bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
+ bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
+ bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
+ bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
target64=true ;;
- bfd_elf32_m32r_vec) tb="$tb elf32-m32r.o elf32.o $elf" ;;
- bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
- bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
- bfd_elf32_mn10200_vec) tb="$tb elf-m10200.o elf32.o $elf" ;;
- bfd_elf32_mn10300_vec) tb="$tb elf-m10300.o elf32.o $elf" ;;
- bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
- bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
- bfd_elf32_sh_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
- bfd_elf32_shl_vec) tb="$tb elf32-sh.o elf32.o $elf coff-sh.o" ;;
- bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
- bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
+ bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
+ bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
+ bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
+ bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
+ bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
+ bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
+ bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
+ bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
+ bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
+ bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
+ bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
+ bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
target64=true ;;
- bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
+ bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
target64=true ;;
- bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
+ bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"
target64=true ;;
- cisco_core_vec) tb="$tb cisco-core.o" ;;
- demo_64_vec) tb="$tb demo64.o aout64.o"
+ cisco_core_vec) tb="$tb cisco-core.lo" ;;
+ demo_64_vec) tb="$tb demo64.lo aout64.lo"
target64=true ;;
- ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
- ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
- ecoff_biglittle_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
- ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
+ ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ ecoff_little_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ ecoff_biglittle_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
+ ecoffalpha_little_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"
target64=true ;;
- evax_alpha_vec) tb="$tb evax-alpha.o evax-emh.o evax-egsd.o evax-etir.o evax-misc.o"
+ go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
+ go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
+ evax_alpha_vec) tb="$tb evax-alpha.lo evax-emh.lo evax-egsd.lo evax-etir.lo evax-misc.lo"
target64=true ;;
- h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
- h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
- host_aout_vec) tb="$tb host-aout.o aout32.o" ;;
- hp300bsd_vec) tb="$tb hp300bsd.o aout32.o" ;;
- hp300hpux_vec) tb="$tb hp300hpux.o aout32.o" ;;
- i386aout_vec) tb="$tb i386aout.o aout32.o" ;;
- i386bsd_vec) tb="$tb i386bsd.o aout32.o" ;;
- i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
- i386dynix_vec) tb="$tb i386dynix.o aout32.o" ;;
- i386freebsd_vec) tb="$tb i386freebsd.o aout32.o" ;;
- i386msdos_vec) tb="$tb i386msdos.o" ;;
- i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
- i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
- i386linux_vec) tb="$tb i386linux.o aout32.o" ;;
- i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o" ;;
- i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o" ;;
- i386mach3_vec) tb="$tb i386mach3.o aout32.o" ;;
- i386netbsd_vec) tb="$tb i386netbsd.o aout32.o" ;;
- i386os9k_vec) tb="$tb i386os9k.o aout32.o" ;;
- i860coff_vec) tb="$tb coff-i860.o cofflink.o" ;;
- icoff_big_vec) tb="$tb coff-i960.o cofflink.o" ;;
- icoff_little_vec) tb="$tb coff-i960.o cofflink.o" ;;
- ieee_vec) tb="$tb ieee.o" ;;
- m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
- m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
- m68klinux_vec) tb="$tb m68klinux.o aout32.o" ;;
- m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o" ;;
- m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o" ;;
- m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o" ;;
- m68k4knetbsd_vec) tb="$tb m68k4knetbsd.o aout32.o" ;;
- m68kaux_coff_vec) tb="$tb coff-aux.o coff-m68k.o cofflink.o" ;;
- m68ksysvcoff_vec) tb="$tb coff-svm68k.o cofflink.o" ;;
- m88kbcs_vec) tb="$tb coff-m88k.o" ;;
- newsos3_vec) tb="$tb newsos3.o aout32.o" ;;
- nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
- nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
- nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
+ h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
+ h8500coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;;
+ host_aout_vec) tb="$tb host-aout.lo aout32.lo" ;;
+ hp300bsd_vec) tb="$tb hp300bsd.lo aout32.lo" ;;
+ hp300hpux_vec) tb="$tb hp300hpux.lo aout32.lo" ;;
+ i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;;
+ i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;;
+ i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;;
+ i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
+ i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
+ i386msdos_vec) tb="$tb i386msdos.lo" ;;
+ i386pe_vec) tb="$tb pe-i386.lo cofflink.lo " ;;
+ i386pei_vec) tb="$tb pei-i386.lo cofflink.lo" ;;
+ i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
+ i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
+ i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
+ i386mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;;
+ i386netbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;;
+ i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;;
+ i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;;
+ icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
+ icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;;
+ ieee_vec) tb="$tb ieee.lo" ;;
+ m68kcoff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;;
+ m68kcoffun_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;;
+ m68klinux_vec) tb="$tb m68klinux.lo aout32.lo" ;;
+ m68klynx_aout_vec) tb="$tb m68klynx.lo lynx-core.lo aout32.lo" ;;
+ m68klynx_coff_vec) tb="$tb cf-m68klynx.lo coff-m68k.lo cofflink.lo lynx-core.lo" ;;
+ m68knetbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;;
+ m68k4knetbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;;
+ m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
+ m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
+ m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
+ newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
+ nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
+ nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
+ nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
target64=true ;;
- riscix_vec) tb="$tb aout32.o riscix.o" ;;
- nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
- pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o" ;;
- pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o" ;;
- pmac_xcoff_vec) tb="$tb coff-pmac.o xcofflink.o" ;;
- rs6000coff_vec) tb="$tb coff-rs6000.o xcofflink.o" ;;
- bfd_powerpc_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
- bfd_powerpcle_pe_vec) tb="$tb pe-ppc.o cofflink.o" ;;
- bfd_powerpc_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
- bfd_powerpcle_pei_vec) tb="$tb pei-ppc.o cofflink.o" ;;
- ppcboot_vec) tb="$tb ppcboot.o" ;;
- shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
- shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
- som_vec) tb="$tb som.o" ;;
- sparcle_aout_vec) tb="$tb aout-sparcle.o aout32.o" ;;
- sparclinux_vec) tb="$tb sparclinux.o aout32.o stab-syms.o" ;;
- sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o" ;;
- sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o" ;;
- sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o" ;;
- sparccoff_vec) tb="$tb coff-sparc.o" ;;
- srec_vec) tb="$tb srec.o" ;;
- sunos_big_vec) tb="$tb sunos.o aout32.o" ;;
- symbolsrec_vec) tb="$tb srec.o" ;;
- tekhex_vec) tb="$tb tekhex.o" ;;
- we32kcoff_vec) tb="$tb coff-we32k.o" ;;
- z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
- w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
- versados_vec) tb="$tb versados.o" ;;
+ riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
+ nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;;
+ pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;;
+ pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
+ pmac_xcoff_vec) tb="$tb coff-pmac.lo xcofflink.lo" ;;
+ rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
+ bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
+ bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
+ bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
+ bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
+ ppcboot_vec) tb="$tb ppcboot.lo" ;;
+ shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ som_vec) tb="$tb som.lo" ;;
+ sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
+ sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
+ sparclynx_aout_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;;
+ sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;;
+ sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;;
+ sparccoff_vec) tb="$tb coff-sparc.lo" ;;
+ srec_vec) tb="$tb srec.lo" ;;
+ sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;;
+ symbolsrec_vec) tb="$tb srec.lo" ;;
+ tekhex_vec) tb="$tb tekhex.lo" ;;
+ tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
+ tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
+ we32kcoff_vec) tb="$tb coff-we32k.lo" ;;
+ z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo" ;;
+ w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
+ versados_vec) tb="$tb versados.lo" ;;
"") ;;
*) AC_MSG_ERROR(*** unknown target vector $vec) ;;
@@ -551,7 +523,7 @@ done
# Target architecture .o files.
# A couple of CPUs use shorter file names to avoid problems on DOS
# filesystems.
-ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`
+ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/`
# Weed out duplicate .o files.
f=""
@@ -627,5 +599,4 @@ case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
esac
rm -f doc/config.status
-AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h,
-[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
+AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h)
diff --git a/contrib/binutils/bfd/cpu-arc.c b/contrib/binutils/bfd/cpu-arc.c
new file mode 100644
index 0000000..bce59d4
--- /dev/null
+++ b/contrib/binutils/bfd/cpu-arc.c
@@ -0,0 +1,70 @@
+/* BFD support for the ARC processor
+ Copyright 1994, 1995, 1997 Free Software Foundation, Inc.
+ Contributed by Doug Evans (dje@cygnus.com).
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+#define ARC(mach, print_name, default_p, next) \
+{ \
+ 32, /* 32 bits in a word */ \
+ 32, /* 32 bits in an address */ \
+ 8, /* 8 bits in a byte */ \
+ bfd_arch_arc, \
+ mach, \
+ "arc", \
+ print_name, \
+ 4, /* section alignment power */ \
+ default_p, \
+ bfd_default_compatible, \
+ bfd_default_scan, \
+ next, \
+ }
+
+#if 0 /* ??? Not currently needed, but keep in for future reference. */
+static const bfd_arch_info_type arch_info_struct[] =
+{
+ ARC (bfd_mach_arc_foo, "arc-foo", false, &arch_info_struct[1]),
+ ARC (bfd_mach_arc_bar, "arc-bar", false, 0),
+};
+#endif
+
+const bfd_arch_info_type bfd_arc_arch =
+ ARC (bfd_mach_arc_base, "arc-base", true, 0 /*&arch_info_struct[0]*/);
+
+/* Utility routines. */
+
+/* Given cpu type NAME, return its bfd_mach_arc_xxx value.
+ Returns -1 if not found. */
+
+int
+arc_get_mach (name)
+ char *name;
+{
+ const bfd_arch_info_type *p;
+
+ for (p = &bfd_arc_arch; p != NULL; p = p->next)
+ {
+ /* +4: skip over "arc-" */
+ if (strcmp (name, p->printable_name + 4) == 0)
+ return p->mach;
+ }
+ return -1;
+}
diff --git a/contrib/binutils/bfd/cpu-sh.c b/contrib/binutils/bfd/cpu-sh.c
index 7f6dd68..9f7ef20 100644
--- a/contrib/binutils/bfd/cpu-sh.c
+++ b/contrib/binutils/bfd/cpu-sh.c
@@ -23,15 +23,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
-int bfd_default_scan_num_mach();
-
static boolean
scan_mach (info, string)
const struct bfd_arch_info *info;
const char *string;
{
- if (strcmp(string,"sh") == 0) return true;
- if (strcmp(string,"SH") == 0) return true;
+ if (strcasecmp (info->printable_name, string) == 0)
+ return true;
return false;
}
@@ -51,18 +49,69 @@ compatible (a,b)
}
#endif
+#define SH_NEXT &arch_info_struct[0]
+#define SH3_NEXT &arch_info_struct[1]
+#define SH3E_NEXT &arch_info_struct[2]
+#define SH4_NEXT NULL
+
+static const bfd_arch_info_type arch_info_struct[] =
+{
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_sh,
+ bfd_mach_sh3,
+ "sh", /* arch_name */
+ "sh3", /* printable name */
+ 1,
+ false, /* not the default */
+ bfd_default_compatible,
+ scan_mach,
+ SH3_NEXT
+ },
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_sh,
+ bfd_mach_sh3e,
+ "sh", /* arch_name */
+ "sh3e", /* printable name */
+ 1,
+ false, /* not the default */
+ bfd_default_compatible,
+ scan_mach,
+ SH3E_NEXT
+ },
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_sh,
+ bfd_mach_sh4,
+ "sh", /* arch_name */
+ "sh4", /* printable name */
+ 1,
+ false, /* not the default */
+ bfd_default_compatible,
+ scan_mach,
+ SH4_NEXT
+ },
+};
+
const bfd_arch_info_type bfd_sh_arch =
{
32, /* 32 bits in a word */
32, /* 32 bits in an address */
8, /* 8 bits in a byte */
bfd_arch_sh,
- 0, /* only 1 machine */
+ bfd_mach_sh,
"sh", /* arch_name */
"sh", /* printable name */
1,
true, /* the default machine */
bfd_default_compatible,
scan_mach,
- 0,
+ SH_NEXT
};
diff --git a/contrib/binutils/bfd/cpu-tic30.c b/contrib/binutils/bfd/cpu-tic30.c
new file mode 100644
index 0000000..dd723f7
--- /dev/null
+++ b/contrib/binutils/bfd/cpu-tic30.c
@@ -0,0 +1,39 @@
+/* BFD support for the Texas Instruments TMS320C30 architecture.
+ Copyright 1998 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type bfd_tic30_arch =
+{
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_tic30,
+ 0, /* only 1 machine */
+ "tic30",
+ "tms320c30",
+ 2,
+ true, /* the one and only */
+ bfd_default_compatible,
+ bfd_default_scan,
+ 0,
+};
diff --git a/contrib/binutils/bfd/cpu-v850.c b/contrib/binutils/bfd/cpu-v850.c
new file mode 100644
index 0000000..df97bc9
--- /dev/null
+++ b/contrib/binutils/bfd/cpu-v850.c
@@ -0,0 +1,94 @@
+/* BFD support for the NEC V850 processor
+ Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+#include <ctype.h>
+
+static boolean
+scan (info, string)
+ const struct bfd_arch_info * info;
+ const char * string;
+{
+ const char *ptr_src;
+ const char *ptr_tst;
+ unsigned long number;
+ enum bfd_architecture arch;
+
+ /* First test for an exact match */
+ if (strcasecmp (string, info->printable_name) == 0)
+ return true;
+
+ /* See how much of the supplied string matches with the
+ architecture, eg the string m68k:68020 would match the m68k entry
+ up to the :, then we get left with the machine number */
+
+ for (ptr_src = string, ptr_tst = info->arch_name;
+ *ptr_src && *ptr_tst;
+ ptr_src++, ptr_tst++)
+ {
+ if (*ptr_src != *ptr_tst) break;
+ }
+
+ /* Chewed up as much of the architecture as will match, skip any
+ colons */
+ if (*ptr_src == ':')
+ ptr_src++;
+
+ if (*ptr_src == 0)
+ {
+ /* nothing more, then only keep this one if it is the default
+ machine for this architecture */
+ return info->the_default;
+ }
+
+ number = 0;
+ while (isdigit ((unsigned char) *ptr_src))
+ {
+ number = number * 10 + * ptr_src - '0';
+ ptr_src++;
+ }
+
+ switch (number)
+ {
+
+ default:
+ return false;
+ }
+
+ if (arch != info->arch)
+ return false;
+
+ if (number != info->mach)
+ return false;
+
+ return true;
+}
+
+#define N(number, print, default, next) \
+{ 32, 32, 8, bfd_arch_v850, number, "v850", print, 2, default, \
+ bfd_default_compatible, scan, next }
+
+#define NEXT NULL
+
+
+const bfd_arch_info_type bfd_v850_arch =
+ N (bfd_mach_v850, "v850", true, NEXT);
diff --git a/contrib/binutils/bfd/dep-in.sed b/contrib/binutils/bfd/dep-in.sed
index 5a48285..444dde0 100644
--- a/contrib/binutils/bfd/dep-in.sed
+++ b/contrib/binutils/bfd/dep-in.sed
@@ -3,6 +3,7 @@
s/\\\n */ /g
t loop
+s!\.o:!.lo:!
s! @BFD_H@!!g
s!@INCDIR@!$(INCDIR)!g
s!@SRCDIR@/!!g
diff --git a/contrib/binutils/bfd/doc/ChangeLog b/contrib/binutils/bfd/doc/ChangeLog
index 7e46efc..871299c 100644
--- a/contrib/binutils/bfd/doc/ChangeLog
+++ b/contrib/binutils/bfd/doc/ChangeLog
@@ -1,3 +1,78 @@
+Mon Apr 6 14:06:55 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (STAGESTUFF): Remove variable.
+ (CLEANFILES): Don't remove $(STAGESTUFF).
+ (DISTCLEANFILES, MAINTAINERCLEANFILES): New variables.
+ * Makefile.in: Rebuild.
+
+Fri Mar 27 16:25:25 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * chew.c (skip_white_and_starts): Remove unused declaration.
+ (skip_white_and_stars): Add casts to avoid warnings.
+ (skip_trailing_newlines, paramstuff, courierize): Likewise.
+ (bulletize, do_fancy_stuff, iscommand): Likewise.
+ (kill_bogus_lines, nextword, main): Likewise.
+ (manglecomments): Comment out.
+ (outputdots, kill_bogus_lines): Remove unused local variables.
+ (perform, compile): Likewise.
+ (courierize): Fully parenthesize expression.
+ (copy_past_newline): Declare return value.
+ (print): Change printf format string.
+ (main): Call usage for an unrecognized option.
+
+Fri Feb 13 14:37:14 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Define.
+ * Makefile.in: Rebuild.
+
+Mon Jan 26 15:38:36 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * doc.str (bodytext): Don't output @* at the end.
+ * chew.c (kill_bogus_lines): Make sure that a period at the
+ beginning is recognized.
+ (indent): Don't put indentation at the end.
+ (copy_past_newline): Expand tabs.
+ * Makefile.am (s-reloc, s-syms): Depend on doc.str.
+ * Makefile.in: Rebuild.
+
+Wed Oct 1 14:41:28 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (libbfd.h): Don't use cpu-h8300.c, cpu-i960.c, or
+ elfcode.h as input files; they don't contribute anything.
+ * Makefile.in: Rebuild.
+
+Fri Aug 15 04:55:15 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.am (libbfd.h, libcoff.h): Invoke $(MKDOC) as ./$(MKDOC).
+ * Makefile.in: Rebuild.
+
+Fri Aug 1 12:59:58 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (CC_FOR_BUILD): Don't set explicitly.
+ * Makefile.in: Rebuild.
+
+Thu Jul 31 20:00:12 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: New file, based on old Makefile.in.
+ * Makefile.in: Now built with automake.
+
+Tue Jul 22 14:44:00 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * Makefile.in: Change stamp-* files to s-* files. Use bfdt.texi
+ rather than bfd.texi.
+ (DOCFILES): Change bfd.texi to bfdt.texi.
+ * bfd.texinfo: Include bfdt.texi, not bfd.texi.
+
+Mon Jun 16 15:33:15 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (CC, CFLAGS): Substitute from configure script.
+ From Jeff Makey <jeff@cts.com>.
+
+Tue Apr 15 12:37:41 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (install-info): Use mkinstalldirs to build
+ $(infodir).
+
Tue Apr 8 12:49:46 1997 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (install-info): Permit info files to be in srcdir.
diff --git a/contrib/binutils/bfd/doc/Makefile.am b/contrib/binutils/bfd/doc/Makefile.am
new file mode 100644
index 0000000..7588273
--- /dev/null
+++ b/contrib/binutils/bfd/doc/Makefile.am
@@ -0,0 +1,248 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus
+
+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
+
+PROTOS = archive.p archures.p bfd.p \
+ core.p format.p \
+ libbfd.p opncls.p reloc.p \
+ section.p syms.p targets.p \
+ format.p core.p init.p
+
+IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip coffcode.ip
+
+# SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction
+# between VPATH and suffix rules. If you use GNU Make, perhaps other Makes,
+# you don't need these three:
+SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \
+ $(srcdir)/../archures.c $(srcdir)/../bfd.c \
+ $(srcdir)/../cache.c $(srcdir)/../coffcode.h \
+ $(srcdir)/../corefile.c $(srcdir)/../elf.c \
+ $(srcdir)/../elfcode.h $(srcdir)/../format.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
+
+SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
+ $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \
+ $(srcdir)/../format.c $(srcdir)/../libbfd.c \
+ $(srcdir)/../opncls.c $(srcdir)/../reloc.c \
+ $(srcdir)/../section.c $(srcdir)/../syms.c \
+ $(srcdir)/../targets.c $(srcdir)/../init.c
+
+SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \
+ $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \
+ $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \
+ $(srcdir)/../init.c
+
+TEXIDIR = $(srcdir)/../../texinfo/fsf
+
+info_TEXINFOS = bfd.texinfo
+
+MKDOC = chew$(EXEEXT_FOR_BUILD)
+
+$(MKDOC): chew.o
+ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
+
+chew.o: chew.c
+ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
+
+protos: libbfd.h libcoff.h bfd.h
+
+bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
+
+# We can't replace these rules with an implicit rule, because
+# makes without VPATH support couldn't find the .h files in `..'.
+
+# We use s-XXX targets so that we can distribute the info files,
+# and permit people to rebuild them, without requiring the makeinfo
+# program. If somebody tries to rebuild info, but none of the .texi
+# files have changed, then this Makefile will build chew, and will
+# build all of the stamp files, but will not actually have to rebuild
+# bfd.info.
+
+s-aoutx: $(MKDOC) $(srcdir)/../aoutx.h $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp
+ $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi
+ touch s-aoutx
+aoutx.texi: s-aoutx
+
+s-archive: $(MKDOC) $(srcdir)/../archive.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp
+ $(srcdir)/../../move-if-change archive.tmp archive.texi
+ touch s-archive
+archive.texi: s-archive
+
+s-archures: $(MKDOC) $(srcdir)/../archures.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
+ $(srcdir)/../../move-if-change archures.tmp archures.texi
+ touch s-archures
+archures.texi: s-archures
+
+# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
+# bfd.texinfo on an 8.3 filesystem.
+s-bfd: $(MKDOC) $(srcdir)/../bfd.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
+ $(srcdir)/../../move-if-change bfd.tmp bfdt.texi
+ touch s-bfd
+bfdt.texi: s-bfd
+
+s-cache: $(MKDOC) $(srcdir)/../cache.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
+ $(srcdir)/../../move-if-change cache.tmp cache.texi
+ touch s-cache
+cache.texi: s-cache
+
+s-coffcode: $(MKDOC) $(srcdir)/../coffcode.h $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp
+ $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi
+ touch s-coffcode
+coffcode.texi: s-coffcode
+
+s-core: $(MKDOC) $(srcdir)/../corefile.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp
+ $(srcdir)/../../move-if-change core.tmp core.texi
+ touch s-core
+core.texi: s-core
+
+s-elf: $(MKDOC) $(srcdir)/../elf.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp
+ $(srcdir)/../../move-if-change elf.tmp elf.texi
+ touch s-elf
+elf.texi: s-elf
+
+s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp
+ $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi
+ touch s-elfcode
+elfcode.texi: s-elfcode
+
+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
+ touch s-format
+format.texi: s-format
+
+s-libbfd: $(MKDOC) $(srcdir)/../libbfd.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
+ $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi
+ touch s-libbfd
+libbfd.texi: s-libbfd
+
+s-opncls: $(MKDOC) $(srcdir)/../opncls.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp
+ $(srcdir)/../../move-if-change opncls.tmp opncls.texi
+ touch s-opncls
+opncls.texi: s-opncls
+
+s-reloc: $(MKDOC) $(srcdir)/../reloc.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp
+ $(srcdir)/../../move-if-change reloc.tmp reloc.texi
+ touch s-reloc
+reloc.texi: s-reloc
+
+s-section: $(MKDOC) $(srcdir)/../section.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp
+ $(srcdir)/../../move-if-change section.tmp section.texi
+ touch s-section
+section.texi: s-section
+
+s-syms: $(MKDOC) $(srcdir)/../syms.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp
+ $(srcdir)/../../move-if-change syms.tmp syms.texi
+ touch s-syms
+syms.texi: s-syms
+
+s-targets: $(MKDOC) $(srcdir)/../targets.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp
+ $(srcdir)/../../move-if-change targets.tmp targets.texi
+ touch s-targets
+targets.texi: s-targets
+
+s-init: $(MKDOC) $(srcdir)/../init.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp
+ $(srcdir)/../../move-if-change init.tmp init.texi
+ touch s-init
+init.texi: s-init
+
+s-hash: $(MKDOC) $(srcdir)/../hash.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp
+ $(srcdir)/../../move-if-change hash.tmp hash.texi
+ touch s-hash
+hash.texi: s-hash
+
+s-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp
+ $(srcdir)/../../move-if-change linker.tmp linker.texi
+ touch s-linker
+linker.texi: s-linker
+
+libbfd.h: $(srcdir)/../libbfd-in.h \
+ $(srcdir)/../init.c \
+ $(srcdir)/../libbfd.c \
+ $(srcdir)/../cache.c \
+ $(srcdir)/../reloc.c \
+ $(srcdir)/../archures.c \
+ $(srcdir)/proto.str \
+ $(MKDOC)
+ cat $(srcdir)/../libbfd-in.h >libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../init.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../libbfd.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cache.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../reloc.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../archures.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elf.c >>libbfd.h
+
+libcoff.h: $(srcdir)/../libcoff-in.h \
+ $(srcdir)/../coffcode.h \
+ $(srcdir)/proto.str \
+ $(MKDOC)
+ cat $(srcdir)/../libcoff-in.h >libcoff.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../coffcode.h >>libcoff.h
+
+bfd.h: $(srcdir)/../bfd-in.h \
+ $(srcdir)/../init.c \
+ $(srcdir)/../opncls.c \
+ $(srcdir)/../libbfd.c \
+ $(srcdir)/../section.c \
+ $(srcdir)/../archures.c \
+ $(srcdir)/../reloc.c \
+ $(srcdir)/../syms.c \
+ $(srcdir)/../bfd.c \
+ $(srcdir)/../archive.c \
+ $(srcdir)/../corefile.c \
+ $(srcdir)/../targets.c \
+ $(srcdir)/../format.c \
+ $(srcdir)/proto.str \
+ $(MKDOC)
+ cat $(srcdir)/../bfd-in.h >bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../init.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../opncls.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../libbfd.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../section.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archures.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../reloc.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../syms.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../bfd.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archive.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../corefile.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../targets.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../format.c >>bfd.h
+ echo "#ifdef __cplusplus" >>bfd.h
+ echo "}" >>bfd.h
+ echo "#endif" >>bfd.h
+ echo "#endif" >>bfd.h
+
+MOSTLYCLEANFILES = $(MKDOC) *.o
+
+CLEANFILES = s-* *.p *.ip
+
+DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
+
+MAINTAINERCLEANFILES = $(DOCFILES)
diff --git a/contrib/binutils/bfd/doc/Makefile.in b/contrib/binutils/bfd/doc/Makefile.in
index b7ecd8e..cc1a092 100644
--- a/contrib/binutils/bfd/doc/Makefile.in
+++ b/contrib/binutils/bfd/doc/Makefile.in
@@ -1,66 +1,98 @@
-#
-# Makefile
-# Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
+# Makefile.in generated automatically by automake 1.2e from Makefile.am
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
+
# 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. */
-#
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-VPATH = @srcdir@
-srcdir = @srcdir@
-prefix = @prefix@
+SHELL = @SHELL@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
datadir = @datadir@
-mandir = @mandir@
-man1dir = $(mandir)/man1
-man2dir = $(mandir)/man2
-man3dir = $(mandir)/man3
-man4dir = $(mandir)/man4
-man5dir = $(mandir)/man5
-man6dir = $(mandir)/man6
-man7dir = $(mandir)/man7
-man8dir = $(mandir)/man8
-man9dir = $(mandir)/man9
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
infodir = @infodir@
+mandir = @mandir@
includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
-MKDOC=./chew
-SHELL = /bin/sh
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-CFLAGS = -g
-
-CC_FOR_BUILD = $(CC)
-
-#### Host, target, and site specific Makefile fragments come in here.
-###
-
-.c.o:
- $(CC) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $<
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AR = @AR@
+BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@
+BFD_HOST_64_BIT = @BFD_HOST_64_BIT@
+BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@
+BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@
+CC = @CC@
+CC_FOR_BUILD = @CC_FOR_BUILD@
+COREFILE = @COREFILE@
+COREFLAG = @COREFLAG@
+EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+HDEFINES = @HDEFINES@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+TDEFINES = @TDEFINES@
+VERSION = @VERSION@
+all_backends = @all_backends@
+bfd_backends = @bfd_backends@
+bfd_machines = @bfd_machines@
+tdefaults = @tdefaults@
+wordsize = @wordsize@
+
+AUTOMAKE_OPTIONS = cygnus
DOCFILES = aoutx.texi archive.texi archures.texi \
- bfd.texi cache.texi coffcode.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
@@ -98,27 +130,213 @@ SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \
$(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \
$(srcdir)/../init.c
-STAGESTUFF = $(DOCFILES) *.info*
-
TEXIDIR = $(srcdir)/../../texinfo/fsf
-all install:
+info_TEXINFOS = bfd.texinfo
+
+MKDOC = chew$(EXEEXT_FOR_BUILD)
+
+MOSTLYCLEANFILES = $(MKDOC) *.o
-info: bfd.info
+CLEANFILES = s-* *.p *.ip
-dvi: bfd.dvi
+DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
-install-info: info
- if [ -r bfd.info ]; then \
- dir=.; \
- else \
- dir=$(srcdir); \
- fi; \
- for i in `cd $$dir; echo *.info*`; do \
- $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i; \
+MAINTAINERCLEANFILES = $(DOCFILES)
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
+TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
+INFO_DEPS = bfd.info
+DVIS = bfd.dvi
+TEXINFOS = bfd.texinfo
+DIST_COMMON = ChangeLog Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP = --best
+default: all
+
+.SUFFIXES:
+.SUFFIXES: .dvi .info .ps .texi .texinfo
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+bfd.info: bfd.texinfo
+bfd.dvi: bfd.texinfo
+
+
+DVIPS = dvips
+
+.texi.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texi.dvi:
+ TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.texi:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo.dvi:
+ TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+.dvi.ps:
+ $(DVIPS) $< -o $@
+
+install-info-am: $(INFO_DEPS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(infodir)
+ @for file in $(INFO_DEPS); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+ if test -f $$d/$$ifile; then \
+ echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
+ $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+ else : ; fi; \
+ done; \
+ done
+ @$(POST_INSTALL)
+ @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ for file in $(INFO_DEPS); do \
+ echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
+ install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+ done; \
+ else : ; fi
+
+uninstall-info:
+ $(PRE_UNINSTALL)
+ @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ ii=yes; \
+ else ii=; fi; \
+ for file in $(INFO_DEPS); do \
+ test -z "$ii" \
+ || install-info --info-dir=$(infodir) --remove $$file; \
done
+ $(NORMAL_UNINSTALL)
+ for file in $(INFO_DEPS); do \
+ (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+ done
+
+dist-info: $(INFO_DEPS)
+ for base in $(INFO_DEPS); do \
+ if test -f $$base; then d=.; else d=$(srcdir); fi; \
+ for file in `cd $$d && eval echo $$base*`; do \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done; \
+ done
+
+mostlyclean-aminfo:
+ -rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+ bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+ bfd.op bfd.tr bfd.cv bfd.cn
+
+clean-aminfo:
+
+distclean-aminfo:
+
+maintainer-clean-aminfo:
+ for i in $(INFO_DEPS); do \
+ rm -f $$i; \
+ if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
+ rm -f $$i-[0-9]*; \
+ fi; \
+ done
+clean-info: mostlyclean-aminfo
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = doc
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done
+ $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
+info: $(INFO_DEPS)
+dvi: $(DVIS)
+check:
+ $(MAKE)
+installcheck:
+install-info: install-info-am
+install-exec:
+ @$(NORMAL_INSTALL)
+
+install-data:
+ @$(NORMAL_INSTALL)
+
+install: install-exec install-data all
+ @:
+
+uninstall:
+
+all: Makefile
+
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs:
+
+
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean: mostlyclean-aminfo mostlyclean-generic
+
+clean: clean-aminfo clean-generic mostlyclean
+
+distclean: distclean-aminfo distclean-generic clean
+ -rm -f config.status
+ -rm -f libtool
+
+maintainer-clean: maintainer-clean-aminfo maintainer-clean-generic \
+ distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
+distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
+dvi installcheck install-info install-exec install-data install \
+uninstall all installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
-docs: $(MKDOC) protos bfd.info bfd.dvi bfd.ps
$(MKDOC): chew.o
$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
@@ -128,159 +346,156 @@ chew.o: chew.c
protos: libbfd.h libcoff.h bfd.h
+bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
# We can't replace these rules with an implicit rule, because
# makes without VPATH support couldn't find the .h files in `..'.
-# We use stamp-XXX targets so that we can distribute the info files,
+# We use s-XXX targets so that we can distribute the info files,
# and permit people to rebuild them, without requiring the makeinfo
# program. If somebody tries to rebuild info, but none of the .texi
# files have changed, then this Makefile will build chew, and will
# build all of the stamp files, but will not actually have to rebuild
# bfd.info.
-stamp-aoutx: $(MKDOC) $(srcdir)/../aoutx.h $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp
+s-aoutx: $(MKDOC) $(srcdir)/../aoutx.h $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../aoutx.h >aoutx.tmp
$(srcdir)/../../move-if-change aoutx.tmp aoutx.texi
- touch stamp-aoutx
-aoutx.texi: stamp-aoutx
+ touch s-aoutx
+aoutx.texi: s-aoutx
-stamp-archive: $(MKDOC) $(srcdir)/../archive.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp
+s-archive: $(MKDOC) $(srcdir)/../archive.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../archive.c >archive.tmp
$(srcdir)/../../move-if-change archive.tmp archive.texi
- touch stamp-archive
-archive.texi: stamp-archive
+ touch s-archive
+archive.texi: s-archive
-stamp-archures: $(MKDOC) $(srcdir)/../archures.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
+s-archures: $(MKDOC) $(srcdir)/../archures.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
$(srcdir)/../../move-if-change archures.tmp archures.texi
- touch stamp-archures
-archures.texi: stamp-archures
-
-stamp-bfd: $(MKDOC) $(srcdir)/../bfd.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
- $(srcdir)/../../move-if-change bfd.tmp bfd.texi
- touch stamp-bfd
-bfd.texi: stamp-bfd
-
-stamp-cache: $(MKDOC) $(srcdir)/../cache.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
+ touch s-archures
+archures.texi: s-archures
+
+# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
+# bfd.texinfo on an 8.3 filesystem.
+s-bfd: $(MKDOC) $(srcdir)/../bfd.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
+ $(srcdir)/../../move-if-change bfd.tmp bfdt.texi
+ touch s-bfd
+bfdt.texi: s-bfd
+
+s-cache: $(MKDOC) $(srcdir)/../cache.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
$(srcdir)/../../move-if-change cache.tmp cache.texi
- touch stamp-cache
-cache.texi: stamp-cache
+ touch s-cache
+cache.texi: s-cache
-stamp-coffcode: $(MKDOC) $(srcdir)/../coffcode.h $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp
+s-coffcode: $(MKDOC) $(srcdir)/../coffcode.h $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../coffcode.h >coffcode.tmp
$(srcdir)/../../move-if-change coffcode.tmp coffcode.texi
- touch stamp-coffcode
-coffcode.texi: stamp-coffcode
+ touch s-coffcode
+coffcode.texi: s-coffcode
-stamp-core: $(MKDOC) $(srcdir)/../corefile.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp
+s-core: $(MKDOC) $(srcdir)/../corefile.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../corefile.c >core.tmp
$(srcdir)/../../move-if-change core.tmp core.texi
- touch stamp-core
-core.texi: stamp-core
+ touch s-core
+core.texi: s-core
-stamp-elf: $(MKDOC) $(srcdir)/../elf.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp
+s-elf: $(MKDOC) $(srcdir)/../elf.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elf.c >elf.tmp
$(srcdir)/../../move-if-change elf.tmp elf.texi
- touch stamp-elf
-elf.texi: stamp-elf
+ touch s-elf
+elf.texi: s-elf
-stamp-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp
+s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../elfcode.h >elfcode.tmp
$(srcdir)/../../move-if-change elfcode.tmp elfcode.texi
- touch stamp-elfcode
-elfcode.texi: stamp-elfcode
+ touch s-elfcode
+elfcode.texi: s-elfcode
-stamp-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
+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
- touch stamp-format
-format.texi: stamp-format
+ touch s-format
+format.texi: s-format
-stamp-libbfd: $(MKDOC) $(srcdir)/../libbfd.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
+s-libbfd: $(MKDOC) $(srcdir)/../libbfd.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
$(srcdir)/../../move-if-change libbfd.tmp libbfd.texi
- touch stamp-libbfd
-libbfd.texi: stamp-libbfd
+ touch s-libbfd
+libbfd.texi: s-libbfd
-stamp-opncls: $(MKDOC) $(srcdir)/../opncls.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp
+s-opncls: $(MKDOC) $(srcdir)/../opncls.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp
$(srcdir)/../../move-if-change opncls.tmp opncls.texi
- touch stamp-opncls
-opncls.texi: stamp-opncls
+ touch s-opncls
+opncls.texi: s-opncls
-stamp-reloc: $(MKDOC) $(srcdir)/../reloc.c
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp
+s-reloc: $(MKDOC) $(srcdir)/../reloc.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../reloc.c >reloc.tmp
$(srcdir)/../../move-if-change reloc.tmp reloc.texi
- touch stamp-reloc
-reloc.texi: stamp-reloc
+ touch s-reloc
+reloc.texi: s-reloc
-stamp-section: $(MKDOC) $(srcdir)/../section.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp
+s-section: $(MKDOC) $(srcdir)/../section.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../section.c >section.tmp
$(srcdir)/../../move-if-change section.tmp section.texi
- touch stamp-section
-section.texi: stamp-section
+ touch s-section
+section.texi: s-section
-stamp-syms: $(MKDOC) $(srcdir)/../syms.c
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp
+s-syms: $(MKDOC) $(srcdir)/../syms.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../syms.c >syms.tmp
$(srcdir)/../../move-if-change syms.tmp syms.texi
- touch stamp-syms
-syms.texi: stamp-syms
+ touch s-syms
+syms.texi: s-syms
-stamp-targets: $(MKDOC) $(srcdir)/../targets.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp
+s-targets: $(MKDOC) $(srcdir)/../targets.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../targets.c >targets.tmp
$(srcdir)/../../move-if-change targets.tmp targets.texi
- touch stamp-targets
-targets.texi: stamp-targets
+ touch s-targets
+targets.texi: s-targets
-stamp-init: $(MKDOC) $(srcdir)/../init.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp
+s-init: $(MKDOC) $(srcdir)/../init.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../init.c >init.tmp
$(srcdir)/../../move-if-change init.tmp init.texi
- touch stamp-init
-init.texi: stamp-init
+ touch s-init
+init.texi: s-init
-stamp-hash: $(MKDOC) $(srcdir)/../hash.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp
+s-hash: $(MKDOC) $(srcdir)/../hash.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../hash.c >hash.tmp
$(srcdir)/../../move-if-change hash.tmp hash.texi
- touch stamp-hash
-hash.texi: stamp-hash
+ touch s-hash
+hash.texi: s-hash
-stamp-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str
- $(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp
+s-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str
+ ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../linker.c >linker.tmp
$(srcdir)/../../move-if-change linker.tmp linker.texi
- touch stamp-linker
-linker.texi: stamp-linker
+ touch s-linker
+linker.texi: s-linker
libbfd.h: $(srcdir)/../libbfd-in.h \
$(srcdir)/../init.c \
$(srcdir)/../libbfd.c \
$(srcdir)/../cache.c \
$(srcdir)/../reloc.c \
- $(srcdir)/../cpu-h8300.c \
- $(srcdir)/../cpu-i960.c \
$(srcdir)/../archures.c \
- $(srcdir)/../elfcode.h \
$(srcdir)/proto.str \
$(MKDOC)
cat $(srcdir)/../libbfd-in.h >libbfd.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../init.c >>libbfd.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../libbfd.c >>libbfd.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cache.c >>libbfd.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../reloc.c >>libbfd.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cpu-h8300.c >>libbfd.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cpu-i960.c >>libbfd.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../archures.c >>libbfd.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elf.c >>libbfd.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elfcode.h >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../init.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../libbfd.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../cache.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../reloc.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../archures.c >>libbfd.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../elf.c >>libbfd.h
libcoff.h: $(srcdir)/../libcoff-in.h \
$(srcdir)/../coffcode.h \
$(srcdir)/proto.str \
$(MKDOC)
cat $(srcdir)/../libcoff-in.h >libcoff.h
- $(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../coffcode.h >>libcoff.h
+ ./$(MKDOC) -i -f $(srcdir)/proto.str < $(srcdir)/../coffcode.h >>libcoff.h
bfd.h: $(srcdir)/../bfd-in.h \
$(srcdir)/../init.c \
@@ -298,84 +513,23 @@ bfd.h: $(srcdir)/../bfd-in.h \
$(srcdir)/proto.str \
$(MKDOC)
cat $(srcdir)/../bfd-in.h >bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../init.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../opncls.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../libbfd.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../section.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archures.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../reloc.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../syms.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../bfd.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archive.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../corefile.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../targets.c >>bfd.h
- $(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../format.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../init.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../opncls.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../libbfd.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../section.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archures.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../reloc.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../syms.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../bfd.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../archive.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../corefile.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../targets.c >>bfd.h
+ ./$(MKDOC) -f $(srcdir)/proto.str<$(srcdir)/../format.c >>bfd.h
echo "#ifdef __cplusplus" >>bfd.h
echo "}" >>bfd.h
echo "#endif" >>bfd.h
echo "#endif" >>bfd.h
-
-clean-info: clean
-
-mostlyclean:
- rm -rf *.log *.ps *~* *.dvi *# $(MKDOC) *.o
-
-clean: mostlyclean
- rm -rf $(STAGESTUFF) stamp-*
- rm -f *.p *.ip bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
-
-distclean: mostlyclean
- rm -f *.p *.ip bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log
- rm -f stamp-*
- rm -f Makefile config.status
-
-maintainer-clean realclean: clean
- rm -f Makefile config.status
-
-bfd.info: $(DOCFILES) bfdsumm.texi bfd.texinfo
- $(MAKEINFO) -I$(srcdir) -o bfd.info $(srcdir)/bfd.texinfo
-
-bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
- $(TEXI2DVI) $(srcdir)/bfd.texinfo
-
-bfd.ps: bfd.dvi
- dvips bfd -o
-
-quickdoc: $(DOCFILES) bfdsumm.texi bfd.texinfo
- TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex bfd.texinfo
-
-stage1: force
- - mkdir stage1
- - mv -f $(STAGESTUFF) stage1
-
-stage2: force
- - mkdir stage2
- - mv -f $(STAGESTUFF) stage2
-
-stage3: force
- - mkdir stage3
- - mv -f $(STAGESTUFF) stage3
-
-against=stage2
-
-comparison: force
- for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i || exit 1 ; done
-
-de-stage1: force
- - (cd stage1 ; mv -f $(STAGESTUFF) ..)
- - rmdir stage1
-
-de-stage2: force
- - (cd stage2 ; mv -f $(STAGESTUFF) ..)
- - rmdir stage2
-
-de-stage3: force
- - (cd stage3 ; mv -f $(STAGESTUFF) ..)
- - rmdir stage3
-
-force:
-
-Makefile: $(srcdir)/Makefile.in
- cd .. && CONFIG_FILES=doc/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/binutils/bfd/doc/aoutx.texi b/contrib/binutils/bfd/doc/aoutx.texi
index a35fe9b..d97e96a 100644
--- a/contrib/binutils/bfd/doc/aoutx.texi
+++ b/contrib/binutils/bfd/doc/aoutx.texi
@@ -1,6 +1,6 @@
@section a.out backends
-@*
+
@strong{Description}@*
BFD supports a number of different flavours of a.out format,
though the major differences are only the sizes of the
@@ -29,33 +29,33 @@ As an example, this is what goes on to make the back end for a
sun4, from @file{aout32.c}:
@example
- #define ARCH_SIZE 32
- #include "aoutx.h"
+ #define ARCH_SIZE 32
+ #include "aoutx.h"
@end example
Which exports names:
@example
- ...
- aout_32_canonicalize_reloc
- aout_32_find_nearest_line
- aout_32_get_lineno
- aout_32_get_reloc_upper_bound
- ...
+ ...
+ aout_32_canonicalize_reloc
+ aout_32_find_nearest_line
+ aout_32_get_lineno
+ aout_32_get_reloc_upper_bound
+ ...
@end example
from @file{sunos.c}:
@example
- #define TARGET_NAME "a.out-sunos-big"
- #define VECNAME sunos_big_vec
- #include "aoutf1.h"
+ #define TARGET_NAME "a.out-sunos-big"
+ #define VECNAME sunos_big_vec
+ #include "aoutf1.h"
@end example
requires all the names from @file{aout32.c}, and produces the jump vector
@example
- sunos_big_vec
+ sunos_big_vec
@end example
The file @file{host-aout.c} is a special case. It is for a large set
@@ -86,18 +86,18 @@ ordinary a.out files on your host. To configure a new machine
to use @file{host-aout.c}, specify:
@example
- TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
- TDEPFILES= host-aout.o trad-core.o
+ TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
+ TDEPFILES= host-aout.o trad-core.o
@end example
in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in}
to use the
@file{@var{XXX}.mt} file (by setting "@code{bfd_target=XXX}") when your
configuration is selected.
-@*
+
@subsection Relocations
-@*
+
@strong{Description}@*
The file @file{aoutx.h} provides for both the @emph{standard}
and @emph{extended} forms of a.out relocation records.
@@ -106,15 +106,15 @@ The standard records contain only an
address, a symbol index, and a type field. The extended records
(used on 29ks and sparcs) also have a full integer for an
addend.
-@*
+
@subsection Internal entry points
-@*
+
@strong{Description}@*
@file{aoutx.h} exports several routines for accessing the
contents of an a.out file, which are gathered and exported in
turn by various format specific files (eg sunos.c).
-@*
+
@findex aout_@var{size}_swap_exec_header_in
@subsubsection @code{aout_@var{size}_swap_exec_header_in}
@strong{Synopsis}
@@ -128,7 +128,7 @@ void aout_@var{size}_swap_exec_header_in,
Swap the information in an executable header @var{raw_bytes} taken
from a raw byte stream memory image into the internal exec header
structure @var{execp}.
-@*
+
@findex aout_@var{size}_swap_exec_header_out
@subsubsection @code{aout_@var{size}_swap_exec_header_out}
@strong{Synopsis}
@@ -141,7 +141,7 @@ void aout_@var{size}_swap_exec_header_out
@strong{Description}@*
Swap the information in an internal exec header structure
@var{execp} into the buffer @var{raw_bytes} ready for writing to disk.
-@*
+
@findex aout_@var{size}_some_aout_object_p
@subsubsection @code{aout_@var{size}_some_aout_object_p}
@strong{Synopsis}
@@ -156,7 +156,7 @@ checking is an a.out file. Do some more checking, and set up
for access if it really is. Call back to the calling
environment's "finish up" function just before returning, to
handle any last-minute setup.
-@*
+
@findex aout_@var{size}_mkobject
@subsubsection @code{aout_@var{size}_mkobject}
@strong{Synopsis}
@@ -165,7 +165,7 @@ boolean aout_@var{size}_mkobject, (bfd *abfd);
@end example
@strong{Description}@*
Initialize BFD @var{abfd} for use with a.out files.
-@*
+
@findex aout_@var{size}_machine_type
@subsubsection @code{aout_@var{size}_machine_type}
@strong{Synopsis}
@@ -173,7 +173,7 @@ Initialize BFD @var{abfd} for use with a.out files.
enum machine_type aout_@var{size}_machine_type
(enum bfd_architecture arch,
unsigned long machine));
- @end example
+@end example
@strong{Description}@*
Keep track of machine architecture and machine type for
a.out's. Return the @code{machine_type} for a particular
@@ -182,7 +182,7 @@ and machine can't be represented in a.out format.
If the architecture is understood, machine type 0 (default)
is always understood.
-@*
+
@findex aout_@var{size}_set_arch_mach
@subsubsection @code{aout_@var{size}_set_arch_mach}
@strong{Synopsis}
@@ -191,12 +191,12 @@ boolean aout_@var{size}_set_arch_mach,
(bfd *,
enum bfd_architecture arch,
unsigned long machine));
- @end example
+@end example
@strong{Description}@*
Set the architecture and the machine of the BFD @var{abfd} to the
values @var{arch} and @var{machine}. Verify that @var{abfd}'s format
can support the architecture required.
-@*
+
@findex aout_@var{size}_new_section_hook
@subsubsection @code{aout_@var{size}_new_section_hook}
@strong{Synopsis}
@@ -204,8 +204,8 @@ can support the architecture required.
boolean aout_@var{size}_new_section_hook,
(bfd *abfd,
asection *newsect));
- @end example
+@end example
@strong{Description}@*
Called by the BFD in response to a @code{bfd_make_section}
request.
-@*
+
diff --git a/contrib/binutils/bfd/doc/archive.texi b/contrib/binutils/bfd/doc/archive.texi
index f8d6b89..7e91a16 100644
--- a/contrib/binutils/bfd/doc/archive.texi
+++ b/contrib/binutils/bfd/doc/archive.texi
@@ -1,6 +1,6 @@
@section Archives
-@*
+
@strong{Description}@*
An archive (or library) is just another BFD. It has a symbol
table, although there's not much a user program will do with it.
@@ -49,7 +49,7 @@ spaces and such in filenames anyway, so this shouldn't be much
of a restriction.
Archives are supported in BFD in @code{archive.c}.
-@*
+
@findex bfd_get_next_mapent
@subsubsection @code{bfd_get_next_mapent}
@strong{Synopsis}
@@ -68,7 +68,7 @@ got the last one.
A @code{carsym} is a canonical archive symbol. The only
user-visible element is its name, a null-terminated string.
-@*
+
@findex bfd_set_archive_head
@subsubsection @code{bfd_set_archive_head}
@strong{Synopsis}
@@ -78,7 +78,7 @@ boolean bfd_set_archive_head(bfd *output, bfd *new_head);
@strong{Description}@*
Set the head of the chain of
BFDs contained in the archive @var{output} to @var{new_head}.
-@*
+
@findex bfd_openr_next_archived_file
@subsubsection @code{bfd_openr_next_archived_file}
@strong{Synopsis}
@@ -92,4 +92,4 @@ Subsequent calls should pass
the archive and the previous return value to return a created
BFD to the next contained element. NULL is returned when there
are no more.
-@*
+
diff --git a/contrib/binutils/bfd/doc/archures.texi b/contrib/binutils/bfd/doc/archures.texi
index 2dcc074..c555ea7 100644
--- a/contrib/binutils/bfd/doc/archures.texi
+++ b/contrib/binutils/bfd/doc/archures.texi
@@ -19,11 +19,11 @@ insert as many items into the list of architectures as it wants to;
generally this would be one for each machine and one for the
default case (an item with a machine field of 0).
-BFD's idea of an architecture is implemented in @file{archures.c}.
-@*
+BFD's idea of an architecture is implemented in @file{archures.c}.
+
@subsection bfd_architecture
-@*
+
@strong{Description}@*
This enum gives the object file's CPU architecture, in a
global sense---i.e., what processor family does it belong to?
@@ -38,6 +38,13 @@ enum bfd_architecture
bfd_arch_unknown, /* File arch not known */
bfd_arch_obscure, /* Arch known, not one of these */
bfd_arch_m68k, /* Motorola 68xxx */
+#define bfd_mach_m68000 1
+#define bfd_mach_m68008 2
+#define bfd_mach_m68010 3
+#define bfd_mach_m68020 4
+#define bfd_mach_m68030 5
+#define bfd_mach_m68040 6
+#define bfd_mach_m68060 7
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
@@ -54,23 +61,37 @@ enum bfd_architecture
#define bfd_mach_i960_mc 4
#define bfd_mach_i960_xa 5
#define bfd_mach_i960_ca 6
-#define bfd_mach_i960_jx 7
+#define bfd_mach_i960_jx 7
#define bfd_mach_i960_hx 8
bfd_arch_a29k, /* AMD 29000 */
bfd_arch_sparc, /* SPARC */
-#define bfd_mach_sparc 1
+#define bfd_mach_sparc 1
/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
-#define bfd_mach_sparc_sparclet 2
-#define bfd_mach_sparc_sparclite 3
-#define bfd_mach_sparc_v8plus 4
-#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */
-#define bfd_mach_sparc_v9 6
-#define bfd_mach_sparc_v9a 7 /* with ultrasparc add'ns */
+#define bfd_mach_sparc_sparclet 2
+#define bfd_mach_sparc_sparclite 3
+#define bfd_mach_sparc_v8plus 4
+#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */
+#define bfd_mach_sparc_v9 6
+#define bfd_mach_sparc_v9a 7 /* with ultrasparc add'ns */
/* Nonzero if MACH has the v9 instruction set. */
#define bfd_mach_sparc_v9_p(mach) \
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
bfd_arch_mips, /* MIPS Rxxxx */
+#define bfd_mach_mips3000 3000
+#define bfd_mach_mips3900 3900
+#define bfd_mach_mips4000 4000
+#define bfd_mach_mips4010 4010
+#define bfd_mach_mips4100 4100
+#define bfd_mach_mips4300 4300
+#define bfd_mach_mips4400 4400
+#define bfd_mach_mips4600 4600
+#define bfd_mach_mips4650 4650
+#define bfd_mach_mips5000 5000
+#define bfd_mach_mips6000 6000
+#define bfd_mach_mips8000 8000
+#define bfd_mach_mips10000 10000
+#define bfd_mach_mips16 16
bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_i386 0
#define bfd_mach_i386_i8086 1
@@ -91,24 +112,40 @@ enum bfd_architecture
bfd_arch_hppa, /* HP PA RISC */
bfd_arch_d10v, /* Mitsubishi D10V */
bfd_arch_z8k, /* Zilog Z8000 */
-#define bfd_mach_z8001 1
-#define bfd_mach_z8002 2
+#define bfd_mach_z8001 1
+#define bfd_mach_z8002 2
bfd_arch_h8500, /* Hitachi H8/500 */
bfd_arch_sh, /* Hitachi SH */
+#define bfd_mach_sh 0
+#define bfd_mach_sh3 0x30
+#define bfd_mach_sh3e 0x3e
+#define bfd_mach_sh4 0x40
bfd_arch_alpha, /* Dec Alpha */
bfd_arch_arm, /* Advanced Risc Machines ARM */
+#define bfd_mach_arm_2 1
+#define bfd_mach_arm_2a 2
+#define bfd_mach_arm_3 3
+#define bfd_mach_arm_3M 4
+#define bfd_mach_arm_4 5
+#define bfd_mach_arm_4T 6
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
+ bfd_arch_tic30, /* Texas Instruments TMS320C30 */
+ bfd_arch_v850, /* NEC V850 */
+#define bfd_mach_v850 0
+ bfd_arch_arc, /* Argonaut RISC Core */
+#define bfd_mach_arc_base 0
bfd_arch_m32r, /* Mitsubishi M32R/D */
+#define bfd_mach_m32r 0 /* backwards compatibility */
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
bfd_arch_last
@};
@end example
-@*
+
@subsection bfd_arch_info
-@*
+
@strong{Description}@*
This structure contains information on architectures for use
within BFD.
@@ -125,17 +162,17 @@ typedef struct bfd_arch_info
const char *printable_name;
unsigned int section_align_power;
/* true if this is the default machine for the architecture */
- boolean the_default;
+ boolean the_default;
const struct bfd_arch_info * (*compatible)
- PARAMS ((const struct bfd_arch_info *a,
- const struct bfd_arch_info *b));
+ PARAMS ((const struct bfd_arch_info *a,
+ const struct bfd_arch_info *b));
boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
const struct bfd_arch_info *next;
@} bfd_arch_info_type;
@end example
-@*
+
@findex bfd_printable_name
@subsubsection @code{bfd_printable_name}
@strong{Synopsis}
@@ -145,7 +182,7 @@ const char *bfd_printable_name(bfd *abfd);
@strong{Description}@*
Return a printable string representing the architecture and machine
from the pointer to the architecture info structure.
-@*
+
@findex bfd_scan_arch
@subsubsection @code{bfd_scan_arch}
@strong{Synopsis}
@@ -156,7 +193,17 @@ const bfd_arch_info_type *bfd_scan_arch(const char *string);
Figure out if BFD supports any cpu which could be described with
the name @var{string}. Return a pointer to an @code{arch_info}
structure if a machine is found, otherwise NULL.
-@*
+
+@findex bfd_arch_list
+@subsubsection @code{bfd_arch_list}
+@strong{Synopsis}
+@example
+const char **bfd_arch_list(void);
+@end example
+@strong{Description}@*
+Return a freshly malloced NULL-terminated vector of the names
+of all the valid BFD architectures. Do not modify the names.
+
@findex bfd_arch_get_compatible
@subsubsection @code{bfd_arch_get_compatible}
@strong{Synopsis}
@@ -171,7 +218,7 @@ architectures and machine types are compatible. Calculates
the lowest common denominator between the two architectures
and machine types implied by the BFDs and returns a pointer to
an @code{arch_info} structure describing the compatible machine.
-@*
+
@findex bfd_default_arch_struct
@subsubsection @code{bfd_default_arch_struct}
@strong{Description}@*
@@ -183,7 +230,7 @@ architecture of the file.
@example
extern const bfd_arch_info_type bfd_default_arch_struct;
@end example
-@*
+
@findex bfd_set_arch_info
@subsubsection @code{bfd_set_arch_info}
@strong{Synopsis}
@@ -192,7 +239,7 @@ void bfd_set_arch_info(bfd *abfd, const bfd_arch_info_type *arg);
@end example
@strong{Description}@*
Set the architecture info of @var{abfd} to @var{arg}.
-@*
+
@findex bfd_default_set_arch_mach
@subsubsection @code{bfd_default_set_arch_mach}
@strong{Synopsis}
@@ -206,7 +253,7 @@ Set the architecture and machine type in BFD @var{abfd}
to @var{arch} and @var{mach}. Find the correct
pointer to a structure and insert it into the @code{arch_info}
pointer.
-@*
+
@findex bfd_get_arch
@subsubsection @code{bfd_get_arch}
@strong{Synopsis}
@@ -216,7 +263,7 @@ enum bfd_architecture bfd_get_arch(bfd *abfd);
@strong{Description}@*
Return the enumerated type which describes the BFD @var{abfd}'s
architecture.
-@*
+
@findex bfd_get_mach
@subsubsection @code{bfd_get_mach}
@strong{Synopsis}
@@ -226,7 +273,7 @@ unsigned long bfd_get_mach(bfd *abfd);
@strong{Description}@*
Return the long type which describes the BFD @var{abfd}'s
machine.
-@*
+
@findex bfd_arch_bits_per_byte
@subsubsection @code{bfd_arch_bits_per_byte}
@strong{Synopsis}
@@ -236,7 +283,7 @@ unsigned int bfd_arch_bits_per_byte(bfd *abfd);
@strong{Description}@*
Return the number of bits in one of the BFD @var{abfd}'s
architecture's bytes.
-@*
+
@findex bfd_arch_bits_per_address
@subsubsection @code{bfd_arch_bits_per_address}
@strong{Synopsis}
@@ -246,7 +293,7 @@ unsigned int bfd_arch_bits_per_address(bfd *abfd);
@strong{Description}@*
Return the number of bits in one of the BFD @var{abfd}'s
architecture's addresses.
-@*
+
@findex bfd_default_compatible
@subsubsection @code{bfd_default_compatible}
@strong{Synopsis}
@@ -257,7 +304,7 @@ const bfd_arch_info_type *bfd_default_compatible
@end example
@strong{Description}@*
The default function for testing for compatibility.
-@*
+
@findex bfd_default_scan
@subsubsection @code{bfd_default_scan}
@strong{Synopsis}
@@ -267,7 +314,7 @@ boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string);
@strong{Description}@*
The default function for working out whether this is an
architecture hit and a machine hit.
-@*
+
@findex bfd_get_arch_info
@subsubsection @code{bfd_get_arch_info}
@strong{Synopsis}
@@ -276,7 +323,7 @@ const bfd_arch_info_type * bfd_get_arch_info(bfd *abfd);
@end example
@strong{Description}@*
Return the architecture info struct in @var{abfd}.
-@*
+
@findex bfd_lookup_arch
@subsubsection @code{bfd_lookup_arch}
@strong{Synopsis}
@@ -291,7 +338,7 @@ Look for the architecure info structure which matches the
arguments @var{arch} and @var{machine}. A machine of 0 matches the
machine/architecture structure which marks itself as the
default.
-@*
+
@findex bfd_printable_arch_mach
@subsubsection @code{bfd_printable_arch_mach}
@strong{Synopsis}
@@ -304,4 +351,4 @@ Return a printable string representing the architecture and
machine type.
This routine is depreciated.
-@*
+
diff --git a/contrib/binutils/bfd/doc/bfd.texinfo b/contrib/binutils/bfd/doc/bfd.texinfo
index af7bc10..dc0f96c 100644
--- a/contrib/binutils/bfd/doc/bfd.texinfo
+++ b/contrib/binutils/bfd/doc/bfd.texinfo
@@ -1,6 +1,6 @@
\input texinfo.tex
@setfilename bfd.info
-@c $Id: bfd.texinfo,v 1.28 1995/11/10 20:04:12 victoria Exp $
+@c $Id: bfd.texinfo,v 1.29 1997/07/22 18:47:29 ian Exp $
@tex
% NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE
\global\long\def\example{%
@@ -67,7 +67,7 @@ into another language, under the above conditions for modified versions.
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.28 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.29 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Support\par
\hfill sac\@cygnus.com\par
@@ -213,7 +213,7 @@ IEEE-695.
@node BFD front end, BFD back ends, Overview, Top
@chapter BFD front end
-@include bfd.texi
+@include bfdt.texi
@menu
* Memory Usage::
diff --git a/contrib/binutils/bfd/doc/bfdt.texi b/contrib/binutils/bfd/doc/bfdt.texi
new file mode 100644
index 0000000..6013d6a
--- /dev/null
+++ b/contrib/binutils/bfd/doc/bfdt.texi
@@ -0,0 +1,597 @@
+@section @code{typedef bfd}
+A BFD has type @code{bfd}; objects of this type are the
+cornerstone of any application using BFD. Using BFD
+consists of making references though the BFD and to data in the BFD.
+
+Here is the structure that defines the type @code{bfd}. It
+contains the major data about the file and pointers
+to the rest of the data.
+
+
+@example
+
+struct _bfd
+@{
+ /* The filename the application opened the BFD with. */
+ CONST char *filename;
+
+ /* A pointer to the target jump table. */
+ const struct bfd_target *xvec;
+
+ /* To avoid dragging too many header files into every file that
+ includes `@code{bfd.h}', IOSTREAM has been declared as a "char
+ *", and MTIME as a "long". Their correct types, to which they
+ are cast when used, are "FILE *" and "time_t". The iostream
+ is the result of an fopen on the filename. However, if the
+ BFD_IN_MEMORY flag is set, then iostream is actually a pointer
+ to a bfd_in_memory struct. */
+ PTR iostream;
+
+ /* Is the file descriptor being cached? That is, can it be closed as
+ needed, and re-opened when accessed later? */
+
+ boolean cacheable;
+
+ /* Marks whether there was a default target specified when the
+ BFD was opened. This is used to select which matching algorithm
+ to use to choose the back end. */
+
+ boolean target_defaulted;
+
+ /* The caching routines use these to maintain a
+ least-recently-used list of BFDs */
+
+ struct _bfd *lru_prev, *lru_next;
+
+ /* When a file is closed by the caching routines, BFD retains
+ state information on the file here: */
+
+ file_ptr where;
+
+ /* and here: (``once'' means at least once) */
+
+ boolean opened_once;
+
+ /* Set if we have a locally maintained mtime value, rather than
+ getting it from the file each time: */
+
+ boolean mtime_set;
+
+ /* File modified time, if mtime_set is true: */
+
+ long mtime;
+
+ /* Reserved for an unimplemented file locking extension.*/
+
+ int ifd;
+
+ /* The format which belongs to the BFD. (object, core, etc.) */
+
+ bfd_format format;
+
+ /* The direction the BFD was opened with*/
+
+ enum bfd_direction @{no_direction = 0,
+ read_direction = 1,
+ write_direction = 2,
+ both_direction = 3@} direction;
+
+ /* Format_specific flags*/
+
+ flagword flags;
+
+ /* Currently my_archive is tested before adding origin to
+ anything. I believe that this can become always an add of
+ origin, with origin set to 0 for non archive files. */
+
+ file_ptr origin;
+
+ /* Remember when output has begun, to stop strange things
+ from happening. */
+ boolean output_has_begun;
+
+ /* Pointer to linked list of sections*/
+ struct sec *sections;
+
+ /* The number of sections */
+ unsigned int section_count;
+
+ /* Stuff only useful for object files:
+ The start address. */
+ bfd_vma start_address;
+
+ /* Used for input and output*/
+ unsigned int symcount;
+
+ /* Symbol table for output BFD (with symcount entries) */
+ struct symbol_cache_entry **outsymbols;
+
+ /* Pointer to structure which contains architecture information*/
+ const struct bfd_arch_info *arch_info;
+
+ /* Stuff only useful for archives:*/
+ PTR arelt_data;
+ struct _bfd *my_archive; /* The containing archive BFD. */
+ struct _bfd *next; /* The next BFD in the archive. */
+ struct _bfd *archive_head; /* The first BFD in the archive. */
+ boolean has_armap;
+
+ /* A chain of BFD structures involved in a link. */
+ struct _bfd *link_next;
+
+ /* A field used by _bfd_generic_link_add_archive_symbols. This will
+ be used only for archive elements. */
+ int archive_pass;
+
+ /* Used by the back end to hold private data. */
+
+ union
+ @{
+ struct aout_data_struct *aout_data;
+ struct artdata *aout_ar_data;
+ struct _oasys_data *oasys_obj_data;
+ struct _oasys_ar_data *oasys_ar_data;
+ struct coff_tdata *coff_obj_data;
+ struct pe_tdata *pe_obj_data;
+ struct xcoff_tdata *xcoff_obj_data;
+ struct ecoff_tdata *ecoff_obj_data;
+ struct ieee_data_struct *ieee_data;
+ struct ieee_ar_data_struct *ieee_ar_data;
+ struct srec_data_struct *srec_data;
+ struct ihex_data_struct *ihex_data;
+ struct tekhex_data_struct *tekhex_data;
+ struct elf_obj_tdata *elf_obj_data;
+ struct nlm_obj_tdata *nlm_obj_data;
+ struct bout_data_struct *bout_data;
+ struct sun_core_struct *sun_core_data;
+ struct trad_core_struct *trad_core_data;
+ struct som_data_struct *som_data;
+ struct hpux_core_struct *hpux_core_data;
+ struct hppabsd_core_struct *hppabsd_core_data;
+ struct sgi_core_struct *sgi_core_data;
+ struct lynx_core_struct *lynx_core_data;
+ struct osf_core_struct *osf_core_data;
+ struct cisco_core_struct *cisco_core_data;
+ struct versados_data_struct *versados_data;
+ struct netbsd_core_struct *netbsd_core_data;
+ PTR any;
+ @} tdata;
+
+ /* Used by the application to hold private data*/
+ PTR usrdata;
+
+ /* Where all the allocated stuff under this BFD goes. This is a
+ struct objalloc *, but we use PTR to avoid requiring the inclusion of
+ objalloc.h. */
+ PTR memory;
+@};
+
+@end example
+@section Error reporting
+Most BFD functions return nonzero on success (check their
+individual documentation for precise semantics). On an error,
+they call @code{bfd_set_error} to set an error condition that callers
+can check by calling @code{bfd_get_error}.
+If that returns @code{bfd_error_system_call}, then check
+@code{errno}.
+
+The easiest way to report a BFD error to the user is to
+use @code{bfd_perror}.
+
+@subsection Type @code{bfd_error_type}
+The values returned by @code{bfd_get_error} are defined by the
+enumerated type @code{bfd_error_type}.
+
+
+@example
+
+typedef enum bfd_error
+@{
+ bfd_error_no_error = 0,
+ bfd_error_system_call,
+ bfd_error_invalid_target,
+ bfd_error_wrong_format,
+ bfd_error_invalid_operation,
+ bfd_error_no_memory,
+ bfd_error_no_symbols,
+ bfd_error_no_armap,
+ bfd_error_no_more_archived_files,
+ bfd_error_malformed_archive,
+ bfd_error_file_not_recognized,
+ bfd_error_file_ambiguously_recognized,
+ bfd_error_no_contents,
+ bfd_error_nonrepresentable_section,
+ bfd_error_no_debug_section,
+ bfd_error_bad_value,
+ bfd_error_file_truncated,
+ bfd_error_file_too_big,
+ bfd_error_invalid_error_code
+@} bfd_error_type;
+
+@end example
+@findex bfd_get_error
+@subsubsection @code{bfd_get_error}
+@strong{Synopsis}
+@example
+bfd_error_type bfd_get_error (void);
+@end example
+@strong{Description}@*
+Return the current BFD error condition.
+
+@findex bfd_set_error
+@subsubsection @code{bfd_set_error}
+@strong{Synopsis}
+@example
+void bfd_set_error (bfd_error_type error_tag);
+@end example
+@strong{Description}@*
+Set the BFD error condition to be @var{error_tag}.
+
+@findex bfd_errmsg
+@subsubsection @code{bfd_errmsg}
+@strong{Synopsis}
+@example
+CONST char *bfd_errmsg (bfd_error_type error_tag);
+@end example
+@strong{Description}@*
+Return a string describing the error @var{error_tag}, or
+the system error if @var{error_tag} is @code{bfd_error_system_call}.
+
+@findex bfd_perror
+@subsubsection @code{bfd_perror}
+@strong{Synopsis}
+@example
+void bfd_perror (CONST char *message);
+@end example
+@strong{Description}@*
+Print to the standard error stream a string describing the
+last BFD error that occurred, or the last system error if
+the last BFD error was a system call failure. If @var{message}
+is non-NULL and non-empty, the error string printed is preceded
+by @var{message}, a colon, and a space. It is followed by a newline.
+
+@subsection BFD error handler
+Some BFD functions want to print messages describing the
+problem. They call a BFD error handler function. This
+function may be overriden by the program.
+
+The BFD error handler acts like printf.
+
+
+@example
+
+typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...));
+
+@end example
+@findex bfd_set_error_handler
+@subsubsection @code{bfd_set_error_handler}
+@strong{Synopsis}
+@example
+bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
+@end example
+@strong{Description}@*
+Set the BFD error handler function. Returns the previous
+function.
+
+@findex bfd_set_error_program_name
+@subsubsection @code{bfd_set_error_program_name}
+@strong{Synopsis}
+@example
+void bfd_set_error_program_name (const char *);
+@end example
+@strong{Description}@*
+Set the program name to use when printing a BFD error. This
+is printed before the error message followed by a colon and
+space. The string must not be changed after it is passed to
+this function.
+
+@findex bfd_get_error_handler
+@subsubsection @code{bfd_get_error_handler}
+@strong{Synopsis}
+@example
+bfd_error_handler_type bfd_get_error_handler (void);
+@end example
+@strong{Description}@*
+Return the BFD error handler function.
+
+@section Symbols
+
+
+@findex bfd_get_reloc_upper_bound
+@subsubsection @code{bfd_get_reloc_upper_bound}
+@strong{Synopsis}
+@example
+long bfd_get_reloc_upper_bound(bfd *abfd, asection *sect);
+@end example
+@strong{Description}@*
+Return the number of bytes required to store the
+relocation information associated with section @var{sect}
+attached to bfd @var{abfd}. If an error occurs, return -1.
+
+@findex bfd_canonicalize_reloc
+@subsubsection @code{bfd_canonicalize_reloc}
+@strong{Synopsis}
+@example
+long bfd_canonicalize_reloc
+ (bfd *abfd,
+ asection *sec,
+ arelent **loc,
+ asymbol **syms);
+@end example
+@strong{Description}@*
+Call the back end associated with the open BFD
+@var{abfd} and translate the external form of the relocation
+information attached to @var{sec} into the internal canonical
+form. Place the table into memory at @var{loc}, which has
+been preallocated, usually by a call to
+@code{bfd_get_reloc_upper_bound}. Returns the number of relocs, or
+-1 on error.
+
+The @var{syms} table is also needed for horrible internal magic
+reasons.
+
+@findex bfd_set_reloc
+@subsubsection @code{bfd_set_reloc}
+@strong{Synopsis}
+@example
+void bfd_set_reloc
+ (bfd *abfd, asection *sec, arelent **rel, unsigned int count)
+@end example
+@strong{Description}@*
+Set the relocation pointer and count within
+section @var{sec} to the values @var{rel} and @var{count}.
+The argument @var{abfd} is ignored.
+
+@findex bfd_set_file_flags
+@subsubsection @code{bfd_set_file_flags}
+@strong{Synopsis}
+@example
+boolean bfd_set_file_flags(bfd *abfd, flagword flags);
+@end example
+@strong{Description}@*
+Set the flag word in the BFD @var{abfd} to the value @var{flags}.
+
+Possible errors are:
+@itemize @bullet
+
+@item
+@code{bfd_error_wrong_format} - The target bfd was not of object format.
+@item
+@code{bfd_error_invalid_operation} - The target bfd was open for reading.
+@item
+@code{bfd_error_invalid_operation} -
+The flag word contained a bit which was not applicable to the
+type of file. E.g., an attempt was made to set the @code{D_PAGED} bit
+on a BFD format which does not support demand paging.
+@end itemize
+
+@findex bfd_set_start_address
+@subsubsection @code{bfd_set_start_address}
+@strong{Synopsis}
+@example
+boolean bfd_set_start_address(bfd *abfd, bfd_vma vma);
+@end example
+@strong{Description}@*
+Make @var{vma} the entry point of output BFD @var{abfd}.
+
+@strong{Returns}@*
+Returns @code{true} on success, @code{false} otherwise.
+
+@findex bfd_get_mtime
+@subsubsection @code{bfd_get_mtime}
+@strong{Synopsis}
+@example
+long bfd_get_mtime(bfd *abfd);
+@end example
+@strong{Description}@*
+Return the file modification time (as read from the file system, or
+from the archive header for archive members).
+
+@findex bfd_get_size
+@subsubsection @code{bfd_get_size}
+@strong{Synopsis}
+@example
+long bfd_get_size(bfd *abfd);
+@end example
+@strong{Description}@*
+Return the file size (as read from file system) for the file
+associated with BFD @var{abfd}.
+
+The initial motivation for, and use of, this routine is not
+so we can get the exact size of the object the BFD applies to, since
+that might not be generally possible (archive members for example).
+It would be ideal if someone could eventually modify
+it so that such results were guaranteed.
+
+Instead, we want to ask questions like "is this NNN byte sized
+object I'm about to try read from file offset YYY reasonable?"
+As as example of where we might do this, some object formats
+use string tables for which the first @code{sizeof(long)} bytes of the
+table contain the size of the table itself, including the size bytes.
+If an application tries to read what it thinks is one of these
+string tables, without some way to validate the size, and for
+some reason the size is wrong (byte swapping error, wrong location
+for the string table, etc.), the only clue is likely to be a read
+error when it tries to read the table, or a "virtual memory
+exhausted" error when it tries to allocate 15 bazillon bytes
+of space for the 15 bazillon byte table it is about to read.
+This function at least allows us to answer the quesion, "is the
+size reasonable?".
+
+@findex bfd_get_gp_size
+@subsubsection @code{bfd_get_gp_size}
+@strong{Synopsis}
+@example
+int bfd_get_gp_size(bfd *abfd);
+@end example
+@strong{Description}@*
+Return the maximum size of objects to be optimized using the GP
+register under MIPS ECOFF. This is typically set by the @code{-G}
+argument to the compiler, assembler or linker.
+
+@findex bfd_set_gp_size
+@subsubsection @code{bfd_set_gp_size}
+@strong{Synopsis}
+@example
+void bfd_set_gp_size(bfd *abfd, int i);
+@end example
+@strong{Description}@*
+Set the maximum size of objects to be optimized using the GP
+register under ECOFF or MIPS ELF. This is typically set by
+the @code{-G} argument to the compiler, assembler or linker.
+
+@findex bfd_scan_vma
+@subsubsection @code{bfd_scan_vma}
+@strong{Synopsis}
+@example
+bfd_vma bfd_scan_vma(CONST char *string, CONST char **end, int base);
+@end example
+@strong{Description}@*
+Convert, like @code{strtoul}, a numerical expression
+@var{string} into a @code{bfd_vma} integer, and return that integer.
+(Though without as many bells and whistles as @code{strtoul}.)
+The expression is assumed to be unsigned (i.e., positive).
+If given a @var{base}, it is used as the base for conversion.
+A base of 0 causes the function to interpret the string
+in hex if a leading "0x" or "0X" is found, otherwise
+in octal if a leading zero is found, otherwise in decimal.
+
+Overflow is not detected.
+
+@findex bfd_copy_private_bfd_data
+@subsubsection @code{bfd_copy_private_bfd_data}
+@strong{Synopsis}
+@example
+boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd);
+@end example
+@strong{Description}@*
+Copy private BFD information from the BFD @var{ibfd} to the
+the BFD @var{obfd}. Return @code{true} on success, @code{false} on error.
+Possible error returns are:
+
+@itemize @bullet
+
+@item
+@code{bfd_error_no_memory} -
+Not enough memory exists to create private data for @var{obfd}.
+@end itemize
+@example
+#define bfd_copy_private_bfd_data(ibfd, obfd) \
+ BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
+ (ibfd, obfd))
+@end example
+
+@findex bfd_merge_private_bfd_data
+@subsubsection @code{bfd_merge_private_bfd_data}
+@strong{Synopsis}
+@example
+boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd);
+@end example
+@strong{Description}@*
+Merge private BFD information from the BFD @var{ibfd} to the
+the output file BFD @var{obfd} when linking. Return @code{true}
+on success, @code{false} on error. Possible error returns are:
+
+@itemize @bullet
+
+@item
+@code{bfd_error_no_memory} -
+Not enough memory exists to create private data for @var{obfd}.
+@end itemize
+@example
+#define bfd_merge_private_bfd_data(ibfd, obfd) \
+ BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
+ (ibfd, obfd))
+@end example
+
+@findex bfd_set_private_flags
+@subsubsection @code{bfd_set_private_flags}
+@strong{Synopsis}
+@example
+boolean bfd_set_private_flags(bfd *abfd, flagword flags);
+@end example
+@strong{Description}@*
+Set private BFD flag information in the BFD @var{abfd}.
+Return @code{true} on success, @code{false} on error. Possible error
+returns are:
+
+@itemize @bullet
+
+@item
+@code{bfd_error_no_memory} -
+Not enough memory exists to create private data for @var{obfd}.
+@end itemize
+@example
+#define bfd_set_private_flags(abfd, flags) \
+ BFD_SEND (abfd, _bfd_set_private_flags, \
+ (abfd, flags))
+@end example
+
+@findex stuff
+@subsubsection @code{stuff}
+@strong{Description}@*
+Stuff which should be documented:
+@example
+#define bfd_sizeof_headers(abfd, reloc) \
+ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
+
+#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
+ BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
+
+ /* Do these three do anything useful at all, for any back end? */
+#define bfd_debug_info_start(abfd) \
+ BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
+
+#define bfd_debug_info_end(abfd) \
+ BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
+
+#define bfd_debug_info_accumulate(abfd, section) \
+ BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
+
+
+#define bfd_stat_arch_elt(abfd, stat) \
+ BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
+
+#define bfd_update_armap_timestamp(abfd) \
+ BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
+
+#define bfd_set_arch_mach(abfd, arch, mach)\
+ BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
+
+#define bfd_relax_section(abfd, section, link_info, again) \
+ BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
+
+#define bfd_link_hash_table_create(abfd) \
+ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
+
+#define bfd_link_add_symbols(abfd, info) \
+ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
+
+#define bfd_final_link(abfd, info) \
+ BFD_SEND (abfd, _bfd_final_link, (abfd, info))
+
+#define bfd_free_cached_info(abfd) \
+ BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
+
+#define bfd_get_dynamic_symtab_upper_bound(abfd) \
+ BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
+
+#define bfd_print_private_bfd_data(abfd, file)\
+ BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
+
+#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
+ BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
+
+#define bfd_get_dynamic_reloc_upper_bound(abfd) \
+ BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
+
+#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
+ BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
+
+extern bfd_byte *bfd_get_relocated_section_contents
+ PARAMS ((bfd *, struct bfd_link_info *,
+ struct bfd_link_order *, bfd_byte *,
+ boolean, asymbol **));
+
+@end example
+
diff --git a/contrib/binutils/bfd/doc/cache.texi b/contrib/binutils/bfd/doc/cache.texi
index badda34..4aafb69 100644
--- a/contrib/binutils/bfd/doc/cache.texi
+++ b/contrib/binutils/bfd/doc/cache.texi
@@ -9,7 +9,7 @@ limit (often as low as 20 open files). The module in
the required BFD is open. If not, then it chooses a file to
close, closes it and opens the one wanted, returning its file
handle.
-@*
+
@findex BFD_CACHE_MAX_OPEN macro
@subsubsection @code{BFD_CACHE_MAX_OPEN macro}
@strong{Description}@*
@@ -18,7 +18,7 @@ one time.
@example
#define BFD_CACHE_MAX_OPEN 10
@end example
-@*
+
@findex bfd_last_cache
@subsubsection @code{bfd_last_cache}
@strong{Synopsis}
@@ -29,7 +29,7 @@ extern bfd *bfd_last_cache;
Zero, or a pointer to the topmost BFD on the chain. This is
used by the @code{bfd_cache_lookup} macro in @file{libbfd.h} to
determine when it can avoid a function call.
-@*
+
@findex bfd_cache_lookup
@subsubsection @code{bfd_cache_lookup}
@strong{Description}@*
@@ -43,7 +43,7 @@ otherwise, it has to perform the complicated lookup function.
(FILE*)(bfd_last_cache->iostream): \
bfd_cache_lookup_worker(x))
@end example
-@*
+
@findex bfd_cache_init
@subsubsection @code{bfd_cache_init}
@strong{Synopsis}
@@ -52,7 +52,7 @@ boolean bfd_cache_init (bfd *abfd);
@end example
@strong{Description}@*
Add a newly opened BFD to the cache.
-@*
+
@findex bfd_cache_close
@subsubsection @code{bfd_cache_close}
@strong{Synopsis}
@@ -62,11 +62,11 @@ boolean bfd_cache_close (bfd *abfd);
@strong{Description}@*
Remove the BFD @var{abfd} from the cache. If the attached file is open,
then close it too.
-@*
+
@strong{Returns}@*
@code{false} is returned if closing the file fails, @code{true} is
returned if all is well.
-@*
+
@findex bfd_open_file
@subsubsection @code{bfd_open_file}
@strong{Synopsis}
@@ -79,7 +79,7 @@ Call the OS to open a file for @var{abfd}. Return the @code{FILE *}
BFD so that future accesses know the file is open. If the @code{FILE *}
returned is @code{NULL}, then it won't have been put in the
cache, so it won't have to be removed from it.
-@*
+
@findex bfd_cache_lookup_worker
@subsubsection @code{bfd_cache_lookup_worker}
@strong{Synopsis}
@@ -92,4 +92,4 @@ quick answer. Find a file descriptor for @var{abfd}. If
necessary, it open it. If there are already more than
@code{BFD_CACHE_MAX_OPEN} files open, it tries to close one first, to
avoid running out of file descriptors.
-@*
+
diff --git a/contrib/binutils/bfd/doc/chew.c b/contrib/binutils/bfd/doc/chew.c
index 3958f30..eba69c2 100644
--- a/contrib/binutils/bfd/doc/chew.c
+++ b/contrib/binutils/bfd/doc/chew.c
@@ -1,5 +1,6 @@
/* chew
- Copyright (C) 1990-1991 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1998
+ Free Software Foundation, Inc.
Contributed by steve chamberlain @cygnus
This file is part of BFD, the Binary File Descriptor library.
@@ -118,7 +119,6 @@ static void overwrite_string (string_type *, string_type *);
static void catbuf (string_type *, char *, unsigned int);
static void cattext (string_type *, char *);
static void catstr (string_type *, string_type *);
-static unsigned int skip_white_and_starts (string_type *, unsigned int);
#endif
@@ -248,7 +248,7 @@ DEFUN(skip_white_and_stars,(src, idx),
{
char c;
while ((c = at(src,idx)),
- isspace (c)
+ isspace ((unsigned char) c)
|| (c == '*'
/* Don't skip past end-of-comment or star as first
character on its line. */
@@ -323,7 +323,7 @@ static void remchar (void), strip_trailing_newlines (void), push_number (void);
static void push_text (void);
static void remove_noncomments (string_type *, string_type *);
static void print_stack_level (void);
-static void paramstuff (void), translatecomments (void), manglecomments (void);
+static void paramstuff (void), translatecomments (void);
static void outputdots (void), courierize (void), bulletize (void);
static void do_fancy_stuff (void);
static int iscommand (string_type *, unsigned int);
@@ -379,7 +379,7 @@ WORD(remchar)
static void
strip_trailing_newlines ()
{
- while ((isspace (at (tos, tos->write_idx - 1))
+ while ((isspace ((unsigned char) at (tos, tos->write_idx - 1))
|| at (tos, tos->write_idx - 1) == '\n')
&& tos->write_idx > 0)
tos->write_idx--;
@@ -503,9 +503,11 @@ DEFUN_VOID(paramstuff)
fname = openp;
/* Step back to the fname */
fname--;
- while (fname && isspace(at(tos, fname)))
+ while (fname && isspace((unsigned char) at(tos, fname)))
fname --;
- while (fname && !isspace(at(tos,fname)) && at(tos,fname) != '*')
+ while (fname
+ && !isspace((unsigned char) at(tos,fname))
+ && at(tos,fname) != '*')
fname--;
fname++;
@@ -573,6 +575,10 @@ WORD(translatecomments)
}
+#if 0
+
+/* This is not currently used. */
+
/* turn everything not starting with a . into a comment */
WORD(manglecomments)
@@ -607,6 +613,8 @@ WORD(manglecomments)
}
+#endif
+
/* Mod tos so that only lines with leading dots remain */
static void
DEFUN_VOID(outputdots)
@@ -619,7 +627,7 @@ DEFUN_VOID(outputdots)
{
if (at(tos, idx) == '\n' && at(tos, idx+1) == '.')
{
- char c, c2;
+ char c;
idx += 2;
while ((c = at(tos, idx)) && c != '\n')
@@ -699,7 +707,8 @@ WORD(courierize)
{
if (at(tos,idx) == '@')
command = 1;
- else if (isspace(at(tos,idx)) || at(tos,idx) == '}')
+ else if (isspace((unsigned char) at(tos,idx))
+ || at(tos,idx) == '}')
command = 0;
catchar(&out, at(tos, idx));
idx++;
@@ -709,8 +718,9 @@ WORD(courierize)
catchar(&out,'\n');
}
while (at(tos, idx) == '\n'
- && (at(tos, idx+1) == '.')
- || (at(tos,idx+1) == '|'));
+ && ((at(tos, idx+1) == '.')
+ || (at(tos,idx+1) == '|')))
+ ;
cattext(&out,"@end example");
}
else
@@ -746,10 +756,10 @@ WORD(bulletize)
idx+=2;
}
-else
+ else
if (at(tos, idx) == '\n' &&
at(tos, idx+1) == 'o' &&
- isspace(at(tos, idx +2)))
+ isspace((unsigned char) at(tos, idx +2)))
{
if (!on)
{
@@ -797,7 +807,7 @@ WORD(do_fancy_stuff)
{
if (at(tos, idx) == '<'
&& at(tos, idx+1) == '<'
- && !isspace(at(tos,idx + 2)))
+ && !isspace((unsigned char) at(tos,idx + 2)))
{
/* This qualifies as a << startup */
idx +=2;
@@ -831,7 +841,7 @@ DEFUN( iscommand,(ptr, idx),
{
unsigned int len = 0;
while (at(ptr,idx)) {
- if (isupper(at(ptr,idx)) || at(ptr,idx) == ' ' ||
+ if (isupper((unsigned char) at(ptr,idx)) || at(ptr,idx) == ' ' ||
at(ptr,idx) == '_')
{
len++;
@@ -849,14 +859,29 @@ DEFUN( iscommand,(ptr, idx),
}
+static int
DEFUN(copy_past_newline,(ptr, idx, dst),
string_type *ptr AND
unsigned int idx AND
string_type *dst)
{
+ int column = 0;
+
while (at(ptr, idx) && at(ptr, idx) != '\n')
{
- catchar(dst, at(ptr, idx));
+ if (at (ptr, idx) == '\t')
+ {
+ /* Expand tabs. Neither makeinfo nor TeX can cope well with
+ them. */
+ do
+ catchar (dst, ' ');
+ while (++column & 7);
+ }
+ else
+ {
+ catchar(dst, at(ptr, idx));
+ column++;
+ }
idx++;
}
@@ -883,7 +908,6 @@ WORD(kill_bogus_lines)
{
int sl ;
- int nl = 0;
int idx = 0;
int c;
int dot = 0 ;
@@ -897,6 +921,11 @@ WORD(kill_bogus_lines)
}
c = idx;
+ /* If the first char is a '.' prepend a newline so that it is
+ recognized properly later. */
+ if (at (tos, idx) == '.')
+ catchar (&out, '\n');
+
/* Find the last char */
while (at(tos,idx))
{
@@ -906,7 +935,7 @@ WORD(kill_bogus_lines)
/* find the last non white before the nl */
idx--;
- while (idx && isspace(at(tos,idx)))
+ while (idx && isspace((unsigned char) at(tos,idx)))
idx--;
idx++;
@@ -972,7 +1001,7 @@ WORD(indent)
case '\n':
cattext(&out,"\n");
idx++;
- if (tab)
+ if (tab && at(tos,idx))
{
cattext(&out," ");
}
@@ -1107,7 +1136,7 @@ DEFUN(nextword,(string, word),
int length = 0;
- while (isspace(*string) || *string == '-') {
+ while (isspace((unsigned char) *string) || *string == '-') {
if (*string == '-')
{
while (*string && *string != '\n')
@@ -1137,7 +1166,7 @@ DEFUN(nextword,(string, word),
}
else
{
- while (!isspace(*string))
+ while (!isspace((unsigned char) *string))
{
string++;
length++;
@@ -1210,9 +1239,6 @@ static void DEFUN_VOID(perform)
/* It's worth looking through the command list */
if (iscommand(ptr, idx))
{
- unsigned int i;
- int found = 0;
-
char *next;
dict_type *word ;
@@ -1305,8 +1331,6 @@ void
DEFUN(compile, (string),
char *string)
{
- int jstack[STACK];
- int *jptr = jstack;
/* add words to the dictionary */
char *word;
string = nextword(string, &word);
@@ -1416,7 +1440,7 @@ WORD(print)
else if (*isp == 2)
write_buffer (tos, stderr);
else
- fprintf (stderr, "print: illegal print destination `%d'\n", *isp);
+ fprintf (stderr, "print: illegal print destination `%ld'\n", *isp);
isp--;
tos--;
icheck_range ();
@@ -1512,7 +1536,7 @@ char *av[])
read_in(&buffer, stdin);
remove_noncomments(&buffer, ptr);
- for (i= 1; i < ac; i++)
+ for (i= 1; i < (unsigned int) ac; i++)
{
if (av[i][0] == '-')
{
@@ -1541,6 +1565,8 @@ char *av[])
{
warning = 1;
}
+ else
+ usage ();
}
}
write_buffer(stack+0, stdout);
diff --git a/contrib/binutils/bfd/doc/coffcode.texi b/contrib/binutils/bfd/doc/coffcode.texi
index 5c3d546..d3bcfa0 100644
--- a/contrib/binutils/bfd/doc/coffcode.texi
+++ b/contrib/binutils/bfd/doc/coffcode.texi
@@ -18,7 +18,7 @@ The Intel i960 processor version of coff is implemented in
@file{coff-i960.c}. This file has the same structure as
@file{coff-m88k.c}, except that it includes @file{coff/i960.h}
rather than @file{coff-m88k.h}.
-@*
+
@subsection Porting to a new version of coff
The recommended method is to select from the existing
implementations the version of coff which is most like the one
@@ -41,10 +41,10 @@ dump utility, usually called @code{att-dump} or just
@code{dump}) are the same. Then clean up your code, and send
what you've done to Cygnus. Then your stuff will be in the
next release, and you won't have to keep integrating it.
-@*
+
@subsection How the coff backend works
-@*
+
@subsubsection File layout
The Coff backend is split into generic routines that are
applicable to any Coff target and routines that are specific
@@ -75,7 +75,7 @@ types, @file{coff-i960.c} also includes some code to
manipulate the i960 relocs. This code is not in
@file{coffcode.h} because it would not be used by any other
target.
-@*
+
@subsubsection Bit twiddling
Each flavour of coff supported in BFD has its own header file
describing the external layout of the structures. There is also
@@ -108,7 +108,7 @@ saving the internal BFD overhead, but uses BFD to swap things
on the way out, making cross ports much safer. Doing so also
allows BFD (and thus the linker) to use the same header files
as @code{gas}, which makes one avenue to disaster disappear.
-@*
+
@subsubsection Symbol reading
The simple canonical form for symbols used by BFD is not rich
enough to keep all the information available in a coff symbol
@@ -135,7 +135,7 @@ rather than the normal text associated with the symbol
At this time the symbol names are moved around. Coff stores
all symbols less than nine characters long physically
within the symbol table; longer strings are kept at the end of
-the file in the string table. This pass moves all strings
+the file in the string table. This pass moves all strings
into memory and replaces them with pointers to the strings.
The symbol table is massaged once again, this time to create
@@ -147,7 +147,7 @@ shares strings with the hidden internal symbol table.
Any linenumbers are read from the coff file too, and attached
to the symbols which own the functions the linenumbers belong to.
-@*
+
@subsubsection Symbol writing
Writing a symbol to a coff file which didn't come from a coff
file will lose any debugging information. The @code{asymbol}
@@ -199,15 +199,16 @@ to a symbol into the index into the symbol table of the asymbol.
This routine runs through the symbol table and patches up the
symbols from their internal form into the coff way, calls the
bit twiddlers, and writes out the table to the file.
-@*
+
@findex coff_symbol_type
@subsubsection @code{coff_symbol_type}
@strong{Description}@*
The hidden information for an @code{asymbol} is described in a
@code{combined_entry_type}:
-@*
-.
+
+
@example
+
typedef struct coff_ptr_struct
@{
@@ -292,43 +293,43 @@ typedef struct
Special entry points for gas to swap out coff parts:
@example
unsigned int (*_bfd_coff_swap_aux_out) PARAMS ((
- bfd *abfd,
- PTR in,
- int type,
- int class,
+ bfd *abfd,
+ PTR in,
+ int type,
+ int class,
int indaux,
int numaux,
- PTR ext));
+ PTR ext));
unsigned int (*_bfd_coff_swap_sym_out) PARAMS ((
bfd *abfd,
- PTR in,
- PTR ext));
+ PTR in,
+ PTR ext));
unsigned int (*_bfd_coff_swap_lineno_out) PARAMS ((
- bfd *abfd,
- PTR in,
- PTR ext));
+ bfd *abfd,
+ PTR in,
+ PTR ext));
unsigned int (*_bfd_coff_swap_reloc_out) PARAMS ((
- bfd *abfd,
- PTR src,
- PTR dst));
+ bfd *abfd,
+ PTR src,
+ PTR dst));
unsigned int (*_bfd_coff_swap_filehdr_out) PARAMS ((
- bfd *abfd,
- PTR in,
- PTR out));
+ bfd *abfd,
+ PTR in,
+ PTR out));
unsigned int (*_bfd_coff_swap_aouthdr_out) PARAMS ((
- bfd *abfd,
- PTR in,
- PTR out));
+ bfd *abfd,
+ PTR in,
+ PTR out));
unsigned int (*_bfd_coff_swap_scnhdr_out) PARAMS ((
- bfd *abfd,
- PTR in,
- PTR out));
+ bfd *abfd,
+ PTR in,
+ PTR out));
@end example
Special entry points for generic COFF routines to call target
@@ -453,6 +454,12 @@ dependent COFF routines:
boolean collect,
struct bfd_link_hash_entry **hashp));
+ boolean (*_bfd_coff_link_output_has_begun) PARAMS ((
+ bfd * abfd ));
+ boolean (*_bfd_coff_final_link_postscript) PARAMS ((
+ bfd * abfd,
+ struct coff_final_link_info * pfinfo));
+
@} bfd_coff_backend_data;
#define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
@@ -498,7 +505,7 @@ dependent COFF routines:
#define bfd_coff_long_section_names(abfd) \
(coff_backend_info (abfd)->_bfd_coff_long_section_names)
#define bfd_coff_default_section_alignment_power(abfd) \
- (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
+ (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
#define bfd_coff_swap_filehdr_in(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
@@ -567,6 +574,11 @@ dependent COFF routines:
((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
(info, abfd, name, flags, section, value, string, cp, coll, hashp))
+#define bfd_coff_link_output_has_begun(a) \
+ ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a))
+#define bfd_coff_final_link_postscript(a,p) \
+ ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p))
+
@end example
@subsubsection Writing relocations
To write relocations, the back end steps though the
@@ -578,7 +590,7 @@ address and the relocation offset; the type is dug directly
from the howto field. Then the @code{internal_reloc} is
swapped into the shape of an @code{external_reloc} and written
out to disk.
-@*
+
@subsubsection Reading linenumbers
Creating the linenumber table is done by reading in the entire
coff linenumber table, and creating another table for internal use.
@@ -594,7 +606,7 @@ table, and each symbol which marks a function is marked by
pointing its...
How does this work ?
-@*
+
@subsubsection Reading relocations
Coff relocations are easily transformed into the internal BFD form
(@code{arelent}).
@@ -624,4 +636,4 @@ and 960 use the @code{r_type} to directly produce an index
into a howto table vector; the 88k subtracts a number from the
@code{r_type} field and creates an addend field.
@end itemize
-@*
+
diff --git a/contrib/binutils/bfd/doc/core.texi b/contrib/binutils/bfd/doc/core.texi
index 841daa9..55e369a 100644
--- a/contrib/binutils/bfd/doc/core.texi
+++ b/contrib/binutils/bfd/doc/core.texi
@@ -1,9 +1,9 @@
@section Core files
-@*
+
@strong{Description}@*
These are functions pertaining to core files.
-@*
+
@findex bfd_core_file_failing_command
@subsubsection @code{bfd_core_file_failing_command}
@strong{Synopsis}
@@ -13,7 +13,7 @@ CONST char *bfd_core_file_failing_command(bfd *abfd);
@strong{Description}@*
Return a read-only string explaining which program was running
when it failed and produced the core file @var{abfd}.
-@*
+
@findex bfd_core_file_failing_signal
@subsubsection @code{bfd_core_file_failing_signal}
@strong{Synopsis}
@@ -23,7 +23,7 @@ int bfd_core_file_failing_signal(bfd *abfd);
@strong{Description}@*
Returns the signal number which caused the core dump which
generated the file the BFD @var{abfd} is attached to.
-@*
+
@findex core_file_matches_executable_p
@subsubsection @code{core_file_matches_executable_p}
@strong{Synopsis}
@@ -35,4 +35,4 @@ boolean core_file_matches_executable_p
Return @code{true} if the core file attached to @var{core_bfd}
was generated by a run of the executable file attached to
@var{exec_bfd}, @code{false} otherwise.
-@*
+
diff --git a/contrib/binutils/bfd/doc/doc.str b/contrib/binutils/bfd/doc/doc.str
index 9368599..7a276fe 100644
--- a/contrib/binutils/bfd/doc/doc.str
+++ b/contrib/binutils/bfd/doc/doc.str
@@ -71,7 +71,7 @@
do_fancy_stuff
courierize
catstr
- "@*\n" catstr
+ "\n" catstr
;
: asection
diff --git a/contrib/binutils/bfd/doc/elf.texi b/contrib/binutils/bfd/doc/elf.texi
index 673654c..4f9434c 100644
--- a/contrib/binutils/bfd/doc/elf.texi
+++ b/contrib/binutils/bfd/doc/elf.texi
@@ -6,7 +6,7 @@ Currently, the best supported back ends are for sparc and i386
Documentation of the internals of the support code still needs
to be written. The code is changing quickly enough that we
haven't bothered yet.
-@*
+
@findex bfd_elf_find_section
@subsubsection @code{bfd_elf_find_section}
@strong{Synopsis}
@@ -19,4 +19,4 @@ Since BFD hides string tables from callers, GDB needs to use an
internal hook to find them. Sun's .stabstr, in particular,
isn't even pointed to by the .stab section, so ordinary
mechanisms wouldn't work to find it, even if we had some.
-@*
+
diff --git a/contrib/binutils/bfd/doc/format.texi b/contrib/binutils/bfd/doc/format.texi
index d30a41b..3281c36 100644
--- a/contrib/binutils/bfd/doc/format.texi
+++ b/contrib/binutils/bfd/doc/format.texi
@@ -22,7 +22,7 @@ The BFD contains other BFDs and an optional index.
@code{bfd_core}
@end itemize
The BFD contains the result of an executable core dump.
-@*
+
@findex bfd_check_format
@subsubsection @code{bfd_check_format}
@strong{Synopsis}
@@ -65,7 +65,7 @@ none of the backends recognised the file format.
@code{bfd_error_file_ambiguously_recognized} -
more than one backend recognised the file format.
@end itemize
-@*
+
@findex bfd_check_format_matches
@subsubsection @code{bfd_check_format_matches}
@strong{Synopsis}
@@ -82,7 +82,7 @@ Then the user may choose a format and try again.
When done with the list that @var{matching} points to, the caller
should free it.
-@*
+
@findex bfd_set_format
@subsubsection @code{bfd_set_format}
@strong{Synopsis}
@@ -94,7 +94,7 @@ This function sets the file format of the BFD @var{abfd} to the
format @var{format}. If the target set in the BFD does not
support the format requested, the format is invalid, or the BFD
is not open for writing, then an error occurs.
-@*
+
@findex bfd_format_string
@subsubsection @code{bfd_format_string}
@strong{Synopsis}
@@ -105,4 +105,4 @@ CONST char *bfd_format_string(bfd_format format);
Return a pointer to a const string
@code{invalid}, @code{object}, @code{archive}, @code{core}, or @code{unknown},
depending upon the value of @var{format}.
-@*
+
diff --git a/contrib/binutils/bfd/doc/hash.texi b/contrib/binutils/bfd/doc/hash.texi
index 4147ce4..45d63e0 100644
--- a/contrib/binutils/bfd/doc/hash.texi
+++ b/contrib/binutils/bfd/doc/hash.texi
@@ -25,7 +25,7 @@ The basic hash table code is in @code{hash.c}.
* Traversing a Hash Table::
* Deriving a New Hash Table Type::
@end menu
-@*
+
@node Creating and Freeing a Hash Table, Looking Up or Entering a String, Hash Tables, Hash Tables
@subsection Creating and freeing a hash table
@findex bfd_hash_table_init
@@ -54,7 +54,7 @@ objalloc using @code{bfd_hash_allocate}.
Use @code{bfd_hash_table_free} to free up all the memory that has
been allocated for a hash table. This will not free up the
@code{struct bfd_hash_table} itself, which you must provide.
-@*
+
@node Looking Up or Entering a String, Traversing a Hash Table, Creating and Freeing a Hash Table, Hash Tables
@subsection Looking up or entering a string
@findex bfd_hash_lookup
@@ -81,7 +81,7 @@ copy the string onto the hash table objalloc or not. If
@var{copy} is passed as @code{false}, you must be careful not to
deallocate or modify the string as long as the hash table
exists.
-@*
+
@node Traversing a Hash Table, Deriving a New Hash Table Type, Looking Up or Entering a String, Hash Tables
@subsection Traversing a hash table
@findex bfd_hash_traverse
@@ -97,7 +97,7 @@ must return a @code{boolean} value, which indicates whether to
continue traversing the hash table. If the function returns
@code{false}, @code{bfd_hash_traverse} will stop the traversal and
return immediately.
-@*
+
@node Deriving a New Hash Table Type, , Traversing a Hash Table, Hash Tables
@subsection Deriving a new hash table type
Many uses of hash tables want to store additional information
@@ -123,7 +123,7 @@ table derived from the linker hash table.
* Write the Derived Creation Routine::
* Write Other Derived Routines::
@end menu
-@*
+
@node Define the Derived Structures, Write the Derived Creation Routine, Deriving a New Hash Table Type, Deriving a New Hash Table Type
@subsubsection Define the derived structures
You must define a structure for an entry in the hash table,
@@ -143,7 +143,7 @@ bfd_link_hash_entry} (in @code{bfdlink.h}). The first field,
@code{root}, is of type @code{struct bfd_hash_entry}. Similarly,
the first field in @code{struct bfd_link_hash_table}, @code{table},
is of type @code{struct bfd_hash_table}.
-@*
+
@node Write the Derived Creation Routine, Write Other Derived Routines, Define the Derived Structures, Deriving a New Hash Table Type
@subsubsection Write the derived creation routine
You must write a routine which will create and initialize an
@@ -174,9 +174,10 @@ Here is a boilerplate example of a creation routine.
are creating. @var{base_newfunc} is the name of the creation
routine of the hash table type your hash table is derived
from.
-@*
-.struct bfd_hash_entry *
+
+
@example
+struct bfd_hash_entry *
@var{function_name} (entry, table, string)
struct bfd_hash_entry *entry;
struct bfd_hash_table *table;
@@ -189,14 +190,14 @@ from.
if (ret == (@var{entry_type} *) NULL)
@{
ret = ((@var{entry_type} *)
- bfd_hash_allocate (table, sizeof (@var{entry_type})));
+ bfd_hash_allocate (table, sizeof (@var{entry_type})));
if (ret == (@var{entry_type} *) NULL)
return NULL;
@}
/* Call the allocation method of the base class. */
ret = ((@var{entry_type} *)
- @var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string));
+ @var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string));
/* Initialize the local fields here. */
@@ -214,7 +215,7 @@ routine for a basic hash table.
@code{_bfd_link_hash_newfunc} also initializes the local fields
in a linker hash table entry: @code{type}, @code{written} and
@code{next}.
-@*
+
@node Write Other Derived Routines, , Write the Derived Creation Routine, Deriving a New Hash Table Type
@subsubsection Write other derived routines
You will want to write other routines for your new hash table,
@@ -241,4 +242,4 @@ the a.out backend linker hash table, which is derived from the
linker hash table, uses macros for the lookup and traversal
routines. These are @code{aout_link_hash_lookup} and
@code{aout_link_hash_traverse} in aoutx.h.
-@*
+
diff --git a/contrib/binutils/bfd/doc/init.texi b/contrib/binutils/bfd/doc/init.texi
index 2902eac..e561a77 100644
--- a/contrib/binutils/bfd/doc/init.texi
+++ b/contrib/binutils/bfd/doc/init.texi
@@ -1,6 +1,6 @@
@section Initialization
These are the functions that handle initializing a BFD.
-@*
+
@findex bfd_init
@subsubsection @code{bfd_init}
@strong{Synopsis}
@@ -10,4 +10,4 @@ void bfd_init(void);
@strong{Description}@*
This routine must be called before any other BFD function to
initialize magical internal data structures.
-@*
+
diff --git a/contrib/binutils/bfd/doc/libbfd.texi b/contrib/binutils/bfd/doc/libbfd.texi
index 002e2f4..6bee5b5 100644
--- a/contrib/binutils/bfd/doc/libbfd.texi
+++ b/contrib/binutils/bfd/doc/libbfd.texi
@@ -1,11 +1,11 @@
@section Internal functions
-@*
+
@strong{Description}@*
These routines are used within BFD.
They are not intended for export, but are documented here for
completeness.
-@*
+
@findex bfd_write_bigendian_4byte_int
@subsubsection @code{bfd_write_bigendian_4byte_int}
@strong{Synopsis}
@@ -16,7 +16,7 @@ void bfd_write_bigendian_4byte_int(bfd *abfd, int i);
Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big
endian order regardless of what else is going on. This is useful in
archives.
-@*
+
@findex bfd_put_size
@subsubsection @code{bfd_put_size}
@findex bfd_get_size
@@ -45,41 +45,41 @@ To detect calling these with less than a @code{bfd_vma}, use
#define bfd_put_8(abfd, val, ptr) \
(*((unsigned char *)(ptr)) = (unsigned char)(val))
#define bfd_put_signed_8 \
- bfd_put_8
+ bfd_put_8
#define bfd_get_8(abfd, ptr) \
(*(unsigned char *)(ptr))
#define bfd_get_signed_8(abfd, ptr) \
- ((*(unsigned char *)(ptr) ^ 0x80) - 0x80)
+ ((*(unsigned char *)(ptr) ^ 0x80) - 0x80)
#define bfd_put_16(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
#define bfd_put_signed_16 \
- bfd_put_16
+ bfd_put_16
#define bfd_get_16(abfd, ptr) \
BFD_SEND(abfd, bfd_getx16, (ptr))
#define bfd_get_signed_16(abfd, ptr) \
- BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
+ BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
#define bfd_put_32(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
#define bfd_put_signed_32 \
- bfd_put_32
+ bfd_put_32
#define bfd_get_32(abfd, ptr) \
BFD_SEND(abfd, bfd_getx32, (ptr))
#define bfd_get_signed_32(abfd, ptr) \
- BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
+ BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
#define bfd_put_64(abfd, val, ptr) \
BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
#define bfd_put_signed_64 \
- bfd_put_64
+ bfd_put_64
#define bfd_get_64(abfd, ptr) \
BFD_SEND(abfd, bfd_getx64, (ptr))
#define bfd_get_signed_64(abfd, ptr) \
- BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
+ BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
@end example
-@*
+
@findex bfd_h_put_size
@subsubsection @code{bfd_h_put_size}
@strong{Description}@*
@@ -93,43 +93,43 @@ order and their data in little endian order.
/* Byte swapping macros for file header data. */
#define bfd_h_put_8(abfd, val, ptr) \
- bfd_put_8 (abfd, val, ptr)
+ bfd_put_8 (abfd, val, ptr)
#define bfd_h_put_signed_8(abfd, val, ptr) \
- bfd_put_8 (abfd, val, ptr)
+ bfd_put_8 (abfd, val, ptr)
#define bfd_h_get_8(abfd, ptr) \
- bfd_get_8 (abfd, ptr)
+ bfd_get_8 (abfd, ptr)
#define bfd_h_get_signed_8(abfd, ptr) \
- bfd_get_signed_8 (abfd, ptr)
+ bfd_get_signed_8 (abfd, ptr)
#define bfd_h_put_16(abfd, val, ptr) \
BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
#define bfd_h_put_signed_16 \
- bfd_h_put_16
+ bfd_h_put_16
#define bfd_h_get_16(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx16,(ptr))
#define bfd_h_get_signed_16(abfd, ptr) \
- BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
+ BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
#define bfd_h_put_32(abfd, val, ptr) \
BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
#define bfd_h_put_signed_32 \
- bfd_h_put_32
+ bfd_h_put_32
#define bfd_h_get_32(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx32,(ptr))
#define bfd_h_get_signed_32(abfd, ptr) \
- BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
+ BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
#define bfd_h_put_64(abfd, val, ptr) \
BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
#define bfd_h_put_signed_64 \
- bfd_h_put_64
+ bfd_h_put_64
#define bfd_h_get_64(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx64,(ptr))
#define bfd_h_get_signed_64(abfd, ptr) \
- BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
+ BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
@end example
-@*
+
@findex bfd_log2
@subsubsection @code{bfd_log2}
@strong{Synopsis}
@@ -139,4 +139,4 @@ unsigned int bfd_log2(bfd_vma x);
@strong{Description}@*
Return the log base 2 of the value supplied, rounded up. E.g., an
@var{x} of 1025 returns 11.
-@*
+
diff --git a/contrib/binutils/bfd/doc/linker.texi b/contrib/binutils/bfd/doc/linker.texi
index 5cd6268..0de907d 100644
--- a/contrib/binutils/bfd/doc/linker.texi
+++ b/contrib/binutils/bfd/doc/linker.texi
@@ -30,12 +30,12 @@ ends which have implemented versions of these routines are
a.out (in @code{aoutx.h}) and ECOFF (in @code{ecoff.c}). The a.out
routines are used as examples throughout this section.
-@menu
+@menu
* Creating a Linker Hash Table::
* Adding Symbols to the Hash Table::
* Performing the Final Link::
@end menu
-@*
+
@node Creating a Linker Hash Table, Adding Symbols to the Hash Table, Linker Functions, Linker Functions
@subsection Creating a linker hash table
@cindex _bfd_link_hash_table_create in target vector
@@ -70,7 +70,7 @@ generally not know exactly which fields will be required until
you have finished. You should simply create a new hash table
which defines no additional fields, and then simply add fields
as they become necessary.
-@*
+
@node Adding Symbols to the Hash Table, Performing the Final Link, Creating a Linker Hash Table, Linker Functions
@subsection Adding symbols to the hash table
@cindex _bfd_link_add_symbols in target vector
@@ -93,7 +93,7 @@ The a.out version of this entry point is
* Adding symbols from an object file::
* Adding symbols from an archive::
@end menu
-@*
+
@node Differing file formats, Adding symbols from an object file, Adding Symbols to the Hash Table, Adding Symbols to the Hash Table
@subsubsection Differing file formats
Normally all the files involved in a link will be of the same
@@ -127,7 +127,7 @@ See @code{ecoff_link_add_externals} for an example of how to
check the @code{creator} field before saving information (in this
case, the ECOFF external symbol debugging information) in a
hash table entry.
-@*
+
@node Adding symbols from an object file, Adding symbols from an archive, Differing file formats, Adding Symbols to the Hash Table
@subsubsection Adding symbols from an object file
When the @code{_bfd_link_add_symbols} routine is passed an object
@@ -168,7 +168,7 @@ pointers to the hash tables entries created by
@code{_bfd_generic_link_add_one_symbol} indexed by symbol number,
so that the @code{_bfd_final_link} routine does not have to call
the hash table lookup routine to locate the entry.
-@*
+
@node Adding symbols from an archive, , Adding symbols from an object file, Adding Symbols to the Hash Table
@subsubsection Adding symbols from an archive
When the @code{_bfd_link_add_symbols} routine is passed an
@@ -217,7 +217,7 @@ call @code{_bfd_generic_link_add_archive_symbols}, because ECOFF
archives already contain a hash table of symbols. The ECOFF
back end searches the archive itself to avoid the overhead of
creating a new hash table.
-@*
+
@node Performing the Final Link, , Adding Symbols to the Hash Table, Linker Functions
@subsection Performing the final link
@cindex _bfd_link_final_link in target vector
@@ -246,7 +246,7 @@ the specific object file format. The a.out
* Relocating the section contents::
* Writing the symbol table::
@end menu
-@*
+
@node Information provided by the linker, Relocating the section contents, Performing the Final Link, Performing the Final Link
@subsubsection Information provided by the linker
Before the linker calls the @code{_bfd_final_link} entry point,
@@ -267,7 +267,7 @@ types of information. They also describe relocs that must be
created by the BFD backend, but do not correspond to any input
file; this is used to support -Ur, which builds constructors
while generating a relocateable object file.
-@*
+
@node Relocating the section contents, Writing the symbol table, Information provided by the linker, Performing the Final Link
@subsubsection Relocating the section contents
The @code{_bfd_final_link} function should look through the
@@ -302,7 +302,7 @@ The a.out function which handles reading, relocating, and
writing section contents is @code{aout_link_input_section}. The
actual relocation is done in @code{aout_link_input_section_std}
and @code{aout_link_input_section_ext}.
-@*
+
@node Writing the symbol table, , Relocating the section contents, Performing the Final Link
@subsubsection Writing the symbol table
The @code{_bfd_final_link} function must gather all the symbols
@@ -347,7 +347,7 @@ traversing the global hash table with the function
@code{aout_link_write_other_symbol}. It builds a string table
while writing out the symbols, which is written to the output
file at the end of @code{NAME(aout,final_link)}.
-@*
+
@findex bfd_link_split_section
@subsubsection @code{bfd_link_split_section}
@strong{Synopsis}
@@ -362,4 +362,4 @@ reloceatable or final link.
BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
@end example
-@*
+
diff --git a/contrib/binutils/bfd/doc/opncls.texi b/contrib/binutils/bfd/doc/opncls.texi
index 07456d8..4fbb0a7 100644
--- a/contrib/binutils/bfd/doc/opncls.texi
+++ b/contrib/binutils/bfd/doc/opncls.texi
@@ -1,6 +1,6 @@
@section Opening and closing BFDs
-@*
+
@findex bfd_openr
@subsubsection @code{bfd_openr}
@strong{Synopsis}
@@ -16,7 +16,7 @@ that function.
If @code{NULL} is returned then an error has occured. Possible errors
are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or @code{system_call} error.
-@*
+
@findex bfd_fdopenr
@subsubsection @code{bfd_fdopenr}
@strong{Synopsis}
@@ -40,7 +40,7 @@ assume no cacheing; the file descriptor will remain open until
files.
Possible errors are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} and @code{bfd_error_system_call}.
-@*
+
@findex bfd_openstreamr
@subsubsection @code{bfd_openstreamr}
@strong{Synopsis}
@@ -50,7 +50,7 @@ bfd *bfd_openstreamr(const char *, const char *, PTR);
@strong{Description}@*
Open a BFD for read access on an existing stdio stream. When
the BFD is passed to @code{bfd_close}, the stream will be closed.
-@*
+
@findex bfd_openw
@subsubsection @code{bfd_openw}
@strong{Synopsis}
@@ -63,7 +63,7 @@ file format @var{target}, and return a pointer to it.
Possible errors are @code{bfd_error_system_call}, @code{bfd_error_no_memory},
@code{bfd_error_invalid_target}.
-@*
+
@findex bfd_close
@subsubsection @code{bfd_close}
@strong{Synopsis}
@@ -80,10 +80,10 @@ All memory attached to the BFD is released.
The file descriptor associated with the BFD is closed (even
if it was passed in to BFD by @code{bfd_fdopenr}).
-@*
+
@strong{Returns}@*
@code{true} is returned if all is ok, otherwise @code{false}.
-@*
+
@findex bfd_close_all_done
@subsubsection @code{bfd_close_all_done}
@strong{Synopsis}
@@ -100,10 +100,10 @@ If the created file is executable, then @code{chmod} is called
to mark it as such.
All memory attached to the BFD is released.
-@*
+
@strong{Returns}@*
@code{true} is returned if all is ok, otherwise @code{false}.
-@*
+
@findex bfd_create
@subsubsection @code{bfd_create}
@strong{Synopsis}
@@ -115,7 +115,7 @@ Create a new BFD in the manner of
@code{bfd_openw}, but without opening a file. The new BFD
takes the target from the target used by @var{template}. The
format is always set to @code{bfd_object}.
-@*
+
@findex bfd_alloc
@subsubsection @code{bfd_alloc}
@strong{Synopsis}
@@ -125,4 +125,4 @@ PTR bfd_alloc (bfd *abfd, size_t wanted);
@strong{Description}@*
Allocate a block of @var{wanted} bytes of memory attached to
@code{abfd} and return a pointer to it.
-@*
+
diff --git a/contrib/binutils/bfd/doc/reloc.texi b/contrib/binutils/bfd/doc/reloc.texi
index 63c079e..fc4970d 100644
--- a/contrib/binutils/bfd/doc/reloc.texi
+++ b/contrib/binutils/bfd/doc/reloc.texi
@@ -16,14 +16,15 @@ in a particular section, and fill in the right bits of the structures.
* typedef arelent::
* howto manager::
@end menu
-@*
+
@node typedef arelent, howto manager, Relocations, Relocations
@subsection typedef arelent
This is the structure of a relocation entry:
-@*
-.
+
+
@example
+
typedef enum bfd_reloc_status
@{
/* No errors detected */
@@ -219,37 +220,39 @@ information in the reloc record and data section. A back end
would normally have a relocation instruction set and turn
relocations into pointers to the correct structure on input -
but it would be possible to create each howto field on demand.
-@*
+
@subsubsection @code{enum complain_overflow}
Indicates what sort of overflow checking should be done when
performing a relocation.
-@*
-.
+
+
@example
+
enum complain_overflow
@{
- /* Do not complain on overflow. */
+ /* Do not complain on overflow. */
complain_overflow_dont,
- /* Complain if the bitfield overflows, whether it is considered
- as signed or unsigned. */
+ /* Complain if the bitfield overflows, whether it is considered
+ as signed or unsigned. */
complain_overflow_bitfield,
- /* Complain if the value overflows when considered as signed
- number. */
+ /* Complain if the value overflows when considered as signed
+ number. */
complain_overflow_signed,
- /* Complain if the value overflows when considered as an
- unsigned number. */
+ /* Complain if the value overflows when considered as an
+ unsigned number. */
complain_overflow_unsigned
@};
@end example
@subsubsection @code{reloc_howto_type}
The @code{reloc_howto_type} is a structure which contains all the
information that libbfd needs to know to tie up a back end's data.
-@*
-.struct symbol_cache_entry; /* Forward declaration */
+
+
@example
+struct symbol_cache_entry; /* Forward declaration */
struct reloc_howto_struct
@{
@@ -265,13 +268,13 @@ struct reloc_howto_struct
unwanted data from the relocation. */
unsigned int rightshift;
- /* The size of the item to be relocated. This is *not* a
- power-of-two measure. To get the number of bytes operated
- on by a type of relocation, use bfd_get_reloc_size. */
+ /* The size of the item to be relocated. This is *not* a
+ power-of-two measure. To get the number of bytes operated
+ on by a type of relocation, use bfd_get_reloc_size. */
int size;
/* The number of bits in the item to be relocated. This is used
- when doing overflow checking. */
+ when doing overflow checking. */
unsigned int bitsize;
/* Notes that the relocation is relative to the location in the
@@ -280,12 +283,12 @@ struct reloc_howto_struct
being relocated. */
boolean pc_relative;
- /* The bit position of the reloc value in the destination.
- The relocated value is left shifted by this amount. */
+ /* The bit position of the reloc value in the destination.
+ The relocated value is left shifted by this amount. */
unsigned int bitpos;
- /* What type of overflow error should be checked for when
- relocating. */
+ /* What type of overflow error should be checked for when
+ relocating. */
enum complain_overflow complain_on_overflow;
/* If this field is non null, then the supplied function is
@@ -293,8 +296,8 @@ struct reloc_howto_struct
strange relocation methods to be accomodated (e.g., i960 callj
instructions). */
bfd_reloc_status_type (*special_function)
- PARAMS ((bfd *abfd,
- arelent *reloc_entry,
+ PARAMS ((bfd *abfd,
+ arelent *reloc_entry,
struct symbol_cache_entry *symbol,
PTR data,
asection *input_section,
@@ -341,7 +344,7 @@ The HOWTO define is horrible and will go away.
#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
@{(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC@}
@end example
-@*
+
@strong{Description}@*
And will be replaced with the totally magic way. But for the
moment, we are compatible, so do it this way.
@@ -349,7 +352,7 @@ moment, we are compatible, so do it this way.
#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
@end example
-@*
+
@strong{Description}@*
Helper routine to turn a symbol into a relocation value.
@example
@@ -365,17 +368,17 @@ Helper routine to turn a symbol into a relocation value.
@} \
@}
@end example
-@*
+
@findex bfd_get_reloc_size
@subsubsection @code{bfd_get_reloc_size}
@strong{Synopsis}
@example
-int bfd_get_reloc_size (reloc_howto_type *);
+unsigned int bfd_get_reloc_size (reloc_howto_type *);
@end example
@strong{Description}@*
For a reloc_howto_type that operates on a fixed number of bytes,
this returns the number of bytes operated on.
-@*
+
@findex arelent_chain
@subsubsection @code{arelent_chain}
@strong{Description}@*
@@ -386,7 +389,24 @@ typedef struct relent_chain @{
struct relent_chain *next;
@} arelent_chain;
@end example
-@*
+
+@findex bfd_check_overflow
+@subsubsection @code{bfd_check_overflow}
+@strong{Synopsis}
+@example
+bfd_reloc_status_type
+bfd_check_overflow
+ (enum complain_overflow how,
+ unsigned int bitsize,
+ unsigned int rightshift,
+ bfd_vma relocation);
+@end example
+@strong{Description}@*
+Perform overflow checking on @var{relocation} which has @var{bitsize}
+significant bits and will be shifted right by @var{rightshift} bits.
+The result is either of @code{bfd_reloc_ok} or
+@code{bfd_reloc_overflow}.
+
@findex bfd_perform_relocation
@subsubsection @code{bfd_perform_relocation}
@strong{Synopsis}
@@ -415,7 +435,7 @@ slot will always be big enough for the addend. Complex reloc
types with addends were invented to solve just this problem.
The @var{error_message} argument is set to an error message if
this return @code{bfd_reloc_dangerous}.
-@*
+
@findex bfd_install_relocation
@subsubsection @code{bfd_install_relocation}
@strong{Synopsis}
@@ -436,14 +456,14 @@ a relocation.
For now, this function should be considered reserved for the
assembler.
-@*
+
@node howto manager, , typedef arelent, Relocations
@section The howto manager
When an application wants to create a relocation, but doesn't
know what the target machine might call it, it can find out by
using this bit of code.
-@*
+
@findex bfd_reloc_code_type
@subsubsection @code{bfd_reloc_code_type}
@strong{Description}@*
@@ -455,7 +475,7 @@ return a howto pointer.
This does mean that the application must determine the correct
enumerator value; you can't get a howto pointer from a random set
of attributes.
-@*
+
Here are the possible values for @code{enum bfd_reloc_code_real}:
@deffn {} BFD_RELOC_64
@@ -576,11 +596,18 @@ I think these are specific to SPARC a.out (e.g., Sun 4).
@deffnx {} BFD_RELOC_SPARC_PC_LM22
@deffnx {} BFD_RELOC_SPARC_WDISP16
@deffnx {} BFD_RELOC_SPARC_WDISP19
-@deffnx {} BFD_RELOC_SPARC_GLOB_JMP
@deffnx {} BFD_RELOC_SPARC_7
@deffnx {} BFD_RELOC_SPARC_6
@deffnx {} BFD_RELOC_SPARC_5
-Some relocations we're using for SPARC V9 -- subject to change.
+@deffnx {} BFD_RELOC_SPARC_DISP64
+@deffnx {} BFD_RELOC_SPARC_PLT64
+@deffnx {} BFD_RELOC_SPARC_HIX22
+@deffnx {} BFD_RELOC_SPARC_LOX10
+@deffnx {} BFD_RELOC_SPARC_H44
+@deffnx {} BFD_RELOC_SPARC_M44
+@deffnx {} BFD_RELOC_SPARC_L44
+@deffnx {} BFD_RELOC_SPARC_REGISTER
+SPARC64 relocations
@end deffn
@deffn {} BFD_RELOC_ALPHA_GPDISP_HI16
Alpha ECOFF and ELF relocations. Some of these treat the symbol or
@@ -790,6 +817,23 @@ These relocs are only used within the ARM assembler. They are not
@deffnx {} BFD_RELOC_SH_LABEL
Hitachi SH relocs. Not all of these appear in object files.
@end deffn
+@deffn {} BFD_RELOC_THUMB_PCREL_BRANCH9
+@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH12
+@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH23
+Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
+be zero and is not stored in the instruction.
+@end deffn
+@deffn {} BFD_RELOC_ARC_B22_PCREL
+Argonaut RISC Core (ARC) relocs.
+ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
+not stored in the instruction. The high 20 bits are installed in bits 26
+through 7 of the instruction.
+@end deffn
+@deffn {} BFD_RELOC_ARC_B26
+ARC 26 bit absolute branch. The lowest two bits must be zero and are not
+stored in the instruction. The high 24 bits are installed in bits 23
+through 0.
+@end deffn
@deffn {} BFD_RELOC_D10V_10_PCREL_R
Mitsubishi D10V relocs.
This is a 10-bit reloc with the right 2 bits
@@ -838,6 +882,40 @@ This is a 16-bit reloc containing the lower 16 bits of an address.
This is a 16-bit reloc containing the small data area offset for use in
add3, load, and store instructions.
@end deffn
+@deffn {} BFD_RELOC_V850_9_PCREL
+This is a 9-bit reloc
+@end deffn
+@deffn {} BFD_RELOC_V850_22_PCREL
+This is a 22-bit reloc
+@end deffn
+@deffn {} BFD_RELOC_V850_SDA_16_16_OFFSET
+This is a 16 bit offset from the short data area pointer.
+@end deffn
+@deffn {} BFD_RELOC_V850_SDA_15_16_OFFSET
+This is a 16 bit offset (of which only 15 bits are used) from the
+short data area pointer.
+@end deffn
+@deffn {} BFD_RELOC_V850_ZDA_16_16_OFFSET
+This is a 16 bit offset from the zero data area pointer.
+@end deffn
+@deffn {} BFD_RELOC_V850_ZDA_15_16_OFFSET
+This is a 16 bit offset (of which only 15 bits are used) from the
+zero data area pointer.
+@end deffn
+@deffn {} BFD_RELOC_V850_TDA_6_8_OFFSET
+This is an 8 bit offset (of which only 6 bits are used) from the
+tiny data area pointer.
+@end deffn
+@deffn {} BFD_RELOC_V850_TDA_7_8_OFFSET
+This is an 8bit offset (of which only 7 bits are used) from the tiny
+data area pointer.
+@end deffn
+@deffn {} BFD_RELOC_V850_TDA_7_7_OFFSET
+This is a 7 bit offset from the tiny data area pointer.
+@end deffn
+@deffn {} BFD_RELOC_V850_TDA_16_16_OFFSET
+This is a 16 bit offset from the tiny data area pointer.
+@end deffn
@deffn {} BFD_RELOC_MN10300_32_PCREL
This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
instruction.
@@ -846,8 +924,14 @@ instruction.
This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
instruction.
@end deffn
-.
+@deffn {} BFD_RELOC_TIC30_LDP
+This is a 8bit DP reloc for the tms320c30, where the most
+significant 8 bits of a 24 bit word are placed into the least
+significant 8 bits of the opcode.
+@end deffn
+
@example
+
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
@end example
@findex bfd_reloc_type_lookup
@@ -861,7 +945,7 @@ bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code);
Return a pointer to a howto structure which, when
invoked, will perform the relocation @var{code} on data from the
architecture noted.
-@*
+
@findex bfd_default_reloc_type_lookup
@subsubsection @code{bfd_default_reloc_type_lookup}
@strong{Synopsis}
@@ -871,7 +955,7 @@ reloc_howto_type *bfd_default_reloc_type_lookup
@end example
@strong{Description}@*
Provides a default relocation lookup routine for any architecture.
-@*
+
@findex bfd_get_reloc_code_name
@subsubsection @code{bfd_get_reloc_code_name}
@strong{Synopsis}
@@ -881,7 +965,7 @@ const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
@strong{Description}@*
Provides a printable name for the supplied relocation code.
Useful mainly for printing error messages.
-@*
+
@findex bfd_generic_relax_section
@subsubsection @code{bfd_generic_relax_section}
@strong{Synopsis}
@@ -895,7 +979,7 @@ boolean bfd_generic_relax_section
@strong{Description}@*
Provides default handling for relaxing for back ends which
don't do relaxing -- i.e., does nothing.
-@*
+
@findex bfd_generic_get_relocated_section_contents
@subsubsection @code{bfd_generic_get_relocated_section_contents}
@strong{Synopsis}
@@ -911,4 +995,4 @@ bfd_generic_get_relocated_section_contents (bfd *abfd,
@strong{Description}@*
Provides default handling of relocation effort for back ends
which can't be bothered to do it efficiently.
-@*
+
diff --git a/contrib/binutils/bfd/doc/section.texi b/contrib/binutils/bfd/doc/section.texi
index d5ff109..24625c2 100644
--- a/contrib/binutils/bfd/doc/section.texi
+++ b/contrib/binutils/bfd/doc/section.texi
@@ -12,7 +12,7 @@ Sections are supported in BFD in @code{section.c}.
* typedef asection::
* section prototypes::
@end menu
-@*
+
@node Section Input, Section Output, Sections, Sections
@subsection Section input
When a BFD is opened for reading, the section structures are
@@ -42,7 +42,7 @@ size of the data. An IEEE-695 file doesn't contain raw data in
sections, but data and relocation expressions intermixed, so
the data area has to be parsed to get out the data and
relocations.
-@*
+
@node Section Output, typedef asection, Section Input, Sections
@subsection Section output
To write a new object style BFD, the various sections to be
@@ -81,7 +81,7 @@ structures would look like:
size 0x103 |
output_section --------|
@end example
-@*
+
@subsection Link orders
The data within a section is stored in a @dfn{link_order}.
These are much like the fixups in @code{gas}. The link_order
@@ -98,14 +98,15 @@ select whether to relax. Sometimes relaxing takes a lot of
time. The linker runs around the relocations to see if any
are attached to data which can be shrunk, if so it does it on
a link_order by link_order basis.
-@*
+
@node typedef asection, section prototypes, Section Output, Sections
@subsection typedef asection
Here is the section structure:
-@*
-.
+
+
@example
+
typedef struct sec
@{
/* The name of the section; the name isn't a copy, the pointer is
@@ -201,7 +202,7 @@ typedef struct sec
multiple times, the value of a symbol is the amount of
space it requires, and the largest symbol value is the one
used). Most targets have exactly one of these (which we
- translate to bfd_com_section_ptr), but ECOFF has two. */
+ translate to bfd_com_section_ptr), but ECOFF has two. */
#define SEC_IS_COMMON 0x8000
/* The section contains only debugging information. For
@@ -217,76 +218,76 @@ typedef struct sec
#define SEC_IN_MEMORY 0x20000
/* The contents of this section are to be excluded by the
- linker for executable and shared objects unless those
- objects are to be further relocated. */
+ linker for executable and shared objects unless those
+ objects are to be further relocated. */
#define SEC_EXCLUDE 0x40000
- /* The contents of this section are to be sorted by the
- based on the address specified in the associated symbol
- table. */
+ /* The contents of this section are to be sorted by the
+ based on the address specified in the associated symbol
+ table. */
#define SEC_SORT_ENTRIES 0x80000
- /* When linking, duplicate sections of the same name should be
- discarded, rather than being combined into a single section as
- is usually done. This is similar to how common symbols are
- handled. See SEC_LINK_DUPLICATES below. */
+ /* When linking, duplicate sections of the same name should be
+ discarded, rather than being combined into a single section as
+ is usually done. This is similar to how common symbols are
+ handled. See SEC_LINK_DUPLICATES below. */
#define SEC_LINK_ONCE 0x100000
- /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
- should handle duplicate sections. */
+ /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
+ should handle duplicate sections. */
#define SEC_LINK_DUPLICATES 0x600000
- /* This value for SEC_LINK_DUPLICATES means that duplicate
- sections with the same name should simply be discarded. */
+ /* This value for SEC_LINK_DUPLICATES means that duplicate
+ sections with the same name should simply be discarded. */
#define SEC_LINK_DUPLICATES_DISCARD 0x0
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if there are any duplicate sections, although
- it should still only link one copy. */
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if there are any duplicate sections, although
+ it should still only link one copy. */
#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if any duplicate sections are a different size. */
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if any duplicate sections are a different size. */
#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000
- /* This value for SEC_LINK_DUPLICATES means that the linker
- should warn if any duplicate sections contain different
- contents. */
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if any duplicate sections contain different
+ contents. */
#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
- /* This section was created by the linker as part of dynamic
- relocation or other arcane processing. It is skipped when
- going through the first-pass output, trusting that someone
- else up the line will take care of it later. */
+ /* This section was created by the linker as part of dynamic
+ relocation or other arcane processing. It is skipped when
+ going through the first-pass output, trusting that someone
+ else up the line will take care of it later. */
#define SEC_LINKER_CREATED 0x800000
- /* End of section flags. */
+ /* End of section flags. */
- /* Some internal packed boolean fields. */
+ /* Some internal packed boolean fields. */
- /* See the vma field. */
- unsigned int user_set_vma : 1;
+ /* See the vma field. */
+ unsigned int user_set_vma : 1;
- /* Whether relocations have been processed. */
- unsigned int reloc_done : 1;
+ /* Whether relocations have been processed. */
+ unsigned int reloc_done : 1;
- /* A mark flag used by some of the linker backends. */
- unsigned int linker_mark : 1;
+ /* A mark flag used by some of the linker backends. */
+ unsigned int linker_mark : 1;
- /* End of internal packed boolean fields. */
+ /* End of internal packed boolean fields. */
/* The virtual memory address of the section - where it will be
at run time. The symbols are relocated against this. The
- user_set_vma flag is maintained by bfd; if it's not set, the
- backend can assign addresses (for example, in @code{a.out}, where
- the default address for @code{.data} is dependent on the specific
- target and various flags). */
+ user_set_vma flag is maintained by bfd; if it's not set, the
+ backend can assign addresses (for example, in @code{a.out}, where
+ the default address for @code{.data} is dependent on the specific
+ target and various flags). */
bfd_vma vma;
/* The load address of the section - where it would be in a
rom image; really only used for writing section header
- information. */
+ information. */
bfd_vma lma;
@@ -297,8 +298,8 @@ typedef struct sec
bfd_size_type _cooked_size;
/* The original size on disk of the section, in bytes. Normally this
- value is the same as the size, but if some relaxing has
- been done, then this value will be bigger. */
+ value is the same as the size, but if some relaxing has
+ been done, then this value will be bigger. */
bfd_size_type _raw_size;
@@ -383,7 +384,7 @@ typedef struct sec
bfd *owner;
- /* A symbol which points at this section only */
+ /* A symbol which points at this section only */
struct symbol_cache_entry *symbol;
struct symbol_cache_entry **symbol_ptr_ptr;
@@ -393,7 +394,7 @@ typedef struct sec
/* These sections are global, and are managed by BFD. The application
and target back end are not permitted to change the values in
- these sections. New code should use the section_ptr macros rather
+ these sections. New code should use the section_ptr macros rather
than referring directly to the const sections. The const sections
may eventually vanish. */
#define BFD_ABS_SECTION_NAME "*ABS*"
@@ -430,7 +431,7 @@ extern const struct symbol_cache_entry * const bfd_ind_symbol;
@node section prototypes, , typedef asection, Sections
@subsection Section prototypes
These are the functions exported by the section handling part of BFD.
-@*
+
@findex bfd_get_section_by_name
@subsubsection @code{bfd_get_section_by_name}
@strong{Synopsis}
@@ -446,7 +447,7 @@ This should only be used in special cases; the normal way to process
all sections of a given name is to use @code{bfd_map_over_sections} and
@code{strcmp} on the name (or better yet, base it on the section flags
or something else) for each section.
-@*
+
@findex bfd_make_section_old_way
@subsubsection @code{bfd_make_section_old_way}
@strong{Synopsis}
@@ -473,7 +474,7 @@ If output has already started for this BFD.
@code{bfd_error_no_memory} -
If memory allocation fails.
@end itemize
-@*
+
@findex bfd_make_section_anyway
@subsubsection @code{bfd_make_section_anyway}
@strong{Synopsis}
@@ -493,7 +494,7 @@ Return @code{NULL} and set @code{bfd_error} on error; possible errors are:
@item
@code{bfd_error_no_memory} - If memory allocation fails.
@end itemize
-@*
+
@findex bfd_make_section
@subsubsection @code{bfd_make_section}
@strong{Synopsis}
@@ -505,7 +506,7 @@ Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling
bfd_set_error ()) without changing the section chain if there is already a
section named @var{name}. If there is an error, return @code{NULL} and set
@code{bfd_error}.
-@*
+
@findex bfd_set_section_flags
@subsubsection @code{bfd_set_section_flags}
@strong{Synopsis}
@@ -525,7 +526,7 @@ The section cannot have one or more of the attributes
requested. For example, a .bss section in @code{a.out} may not
have the @code{SEC_HAS_CONTENTS} field set.
@end itemize
-@*
+
@findex bfd_map_over_sections
@subsubsection @code{bfd_map_over_sections}
@strong{Synopsis}
@@ -542,18 +543,18 @@ attached to the BFD @var{abfd}, passing @var{obj} as an
argument. The function will be called as if by
@example
- func(abfd, the_section, obj);
+ func(abfd, the_section, obj);
@end example
This is the prefered method for iterating over sections; an
alternative would be to use a loop:
@example
- section *p;
- for (p = abfd->sections; p != NULL; p = p->next)
- func(abfd, p, ...)
+ section *p;
+ for (p = abfd->sections; p != NULL; p = p->next)
+ func(abfd, p, ...)
@end example
-@*
+
@findex bfd_set_section_size
@subsubsection @code{bfd_set_section_size}
@strong{Synopsis}
@@ -571,7 +572,7 @@ Possible error returns:
@code{bfd_error_invalid_operation} -
Writing has started to the BFD, so setting the size is invalid.
@end itemize
-@*
+
@findex bfd_set_section_contents
@subsubsection @code{bfd_set_section_contents}
@strong{Synopsis}
@@ -602,7 +603,7 @@ and some more too
@end itemize
This routine is front end to the back end function
@code{_bfd_set_section_contents}.
-@*
+
@findex bfd_get_section_contents
@subsubsection @code{bfd_get_section_contents}
@strong{Synopsis}
@@ -622,7 +623,7 @@ flag set are requested or if the section does not have the
@code{SEC_HAS_CONTENTS} flag set, then the @var{location} is filled
with zeroes. If no errors occur, @code{true} is returned, else
@code{false}.
-@*
+
@findex bfd_copy_private_section_data
@subsubsection @code{bfd_copy_private_section_data}
@strong{Synopsis}
@@ -644,6 +645,6 @@ Not enough memory exists to create private data for @var{osec}.
@example
#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
BFD_SEND (obfd, _bfd_copy_private_section_data, \
- (ibfd, isection, obfd, osection))
+ (ibfd, isection, obfd, osection))
@end example
-@*
+
diff --git a/contrib/binutils/bfd/doc/syms.texi b/contrib/binutils/bfd/doc/syms.texi
index 034f086..48593f4 100644
--- a/contrib/binutils/bfd/doc/syms.texi
+++ b/contrib/binutils/bfd/doc/syms.texi
@@ -29,7 +29,7 @@ the scenes'' information will be still available.
* typedef asymbol::
* symbol handling functions::
@end menu
-@*
+
@node Reading Symbols, Writing Symbols, Symbols, Symbols
@subsection Reading symbols
There are two stages to reading a symbol table from a BFD:
@@ -37,35 +37,35 @@ allocating storage, and the actual reading process. This is an
excerpt from an application which reads the symbol table:
@example
- long storage_needed;
- asymbol **symbol_table;
- long number_of_symbols;
- long i;
+ long storage_needed;
+ asymbol **symbol_table;
+ long number_of_symbols;
+ long i;
- storage_needed = bfd_get_symtab_upper_bound (abfd);
+ storage_needed = bfd_get_symtab_upper_bound (abfd);
if (storage_needed < 0)
FAIL
- if (storage_needed == 0) @{
- return ;
- @}
- symbol_table = (asymbol **) xmalloc (storage_needed);
- ...
- number_of_symbols =
- bfd_canonicalize_symtab (abfd, symbol_table);
+ if (storage_needed == 0) @{
+ return ;
+ @}
+ symbol_table = (asymbol **) xmalloc (storage_needed);
+ ...
+ number_of_symbols =
+ bfd_canonicalize_symtab (abfd, symbol_table);
if (number_of_symbols < 0)
FAIL
- for (i = 0; i < number_of_symbols; i++) @{
- process_symbol (symbol_table[i]);
- @}
+ for (i = 0; i < number_of_symbols; i++) @{
+ process_symbol (symbol_table[i]);
+ @}
@end example
All storage for the symbols themselves is in an objalloc
connected to the BFD; it is freed when the BFD is closed.
-@*
+
@node Writing Symbols, Mini Symbols, Reading Symbols, Symbols
@subsection Writing symbols
Writing of a symbol table is automatic when a BFD open for
@@ -79,31 +79,31 @@ which has been created using @code{bfd_make_empty_symbol}. Here is an
example showing the creation of a symbol table with only one element:
@example
- #include "bfd.h"
- main()
- @{
- bfd *abfd;
- asymbol *ptrs[2];
- asymbol *new;
-
- abfd = bfd_openw("foo","a.out-sunos-big");
- bfd_set_format(abfd, bfd_object);
- new = bfd_make_empty_symbol(abfd);
- new->name = "dummy_symbol";
- new->section = bfd_make_section_old_way(abfd, ".text");
- new->flags = BSF_GLOBAL;
- new->value = 0x12345;
-
- ptrs[0] = new;
- ptrs[1] = (asymbol *)0;
-
- bfd_set_symtab(abfd, ptrs, 1);
- bfd_close(abfd);
- @}
-
- ./makesym
- nm foo
- 00012345 A dummy_symbol
+ #include "bfd.h"
+ main()
+ @{
+ bfd *abfd;
+ asymbol *ptrs[2];
+ asymbol *new;
+
+ abfd = bfd_openw("foo","a.out-sunos-big");
+ bfd_set_format(abfd, bfd_object);
+ new = bfd_make_empty_symbol(abfd);
+ new->name = "dummy_symbol";
+ new->section = bfd_make_section_old_way(abfd, ".text");
+ new->flags = BSF_GLOBAL;
+ new->value = 0x12345;
+
+ ptrs[0] = new;
+ ptrs[1] = (asymbol *)0;
+
+ bfd_set_symtab(abfd, ptrs, 1);
+ bfd_close(abfd);
+ @}
+
+ ./makesym
+ nm foo
+ 00012345 A dummy_symbol
@end example
Many formats cannot represent arbitary symbol information; for
@@ -111,7 +111,7 @@ instance, the @code{a.out} object format does not allow an
arbitary number of sections. A symbol pointing to a section
which is not one of @code{.text}, @code{.data} or @code{.bss} cannot
be described.
-@*
+
@node Mini Symbols, typedef asymbol, Writing Symbols, Symbols
@subsection Mini Symbols
Mini symbols provide read-only access to the symbol table.
@@ -130,124 +130,125 @@ to a minisymbol, and a pointer to a structure returned by
@code{bfd_make_empty_symbol}, and return a @code{asymbol} structure.
The return value may or may not be the same as the value from
@code{bfd_make_empty_symbol} which was passed in.
-@*
+
@node typedef asymbol, symbol handling functions, Mini Symbols, Symbols
@subsection typedef asymbol
An @code{asymbol} has the form:
-@*
-.
+
+
@example
+
typedef struct symbol_cache_entry
@{
- /* A pointer to the BFD which owns the symbol. This information
- is necessary so that a back end can work out what additional
- information (invisible to the application writer) is carried
- with the symbol.
+ /* A pointer to the BFD which owns the symbol. This information
+ is necessary so that a back end can work out what additional
+ information (invisible to the application writer) is carried
+ with the symbol.
- This field is *almost* redundant, since you can use section->owner
- instead, except that some symbols point to the global sections
- bfd_@{abs,com,und@}_section. This could be fixed by making
- these globals be per-bfd (or per-target-flavor). FIXME. */
+ This field is *almost* redundant, since you can use section->owner
+ instead, except that some symbols point to the global sections
+ bfd_@{abs,com,und@}_section. This could be fixed by making
+ these globals be per-bfd (or per-target-flavor). FIXME. */
struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
- /* The text of the symbol. The name is left alone, and not copied; the
- application may not alter it. */
+ /* The text of the symbol. The name is left alone, and not copied; the
+ application may not alter it. */
CONST char *name;
- /* The value of the symbol. This really should be a union of a
+ /* The value of the symbol. This really should be a union of a
numeric value with a pointer, since some flags indicate that
a pointer to another symbol is stored here. */
symvalue value;
- /* Attributes of a symbol: */
+ /* Attributes of a symbol: */
#define BSF_NO_FLAGS 0x00
- /* The symbol has local scope; @code{static} in @code{C}. The value
- is the offset into the section of the data. */
-#define BSF_LOCAL 0x01
+ /* The symbol has local scope; @code{static} in @code{C}. The value
+ is the offset into the section of the data. */
+#define BSF_LOCAL 0x01
- /* The symbol has global scope; initialized data in @code{C}. The
- value is the offset into the section of the data. */
-#define BSF_GLOBAL 0x02
+ /* The symbol has global scope; initialized data in @code{C}. The
+ value is the offset into the section of the data. */
+#define BSF_GLOBAL 0x02
- /* The symbol has global scope and is exported. The value is
- the offset into the section of the data. */
-#define BSF_EXPORT BSF_GLOBAL /* no real difference */
+ /* The symbol has global scope and is exported. The value is
+ the offset into the section of the data. */
+#define BSF_EXPORT BSF_GLOBAL /* no real difference */
- /* A normal C symbol would be one of:
- @code{BSF_LOCAL}, @code{BSF_FORT_COMM}, @code{BSF_UNDEFINED} or
- @code{BSF_GLOBAL} */
+ /* A normal C symbol would be one of:
+ @code{BSF_LOCAL}, @code{BSF_FORT_COMM}, @code{BSF_UNDEFINED} or
+ @code{BSF_GLOBAL} */
- /* The symbol is a debugging record. The value has an arbitary
- meaning. */
-#define BSF_DEBUGGING 0x08
+ /* The symbol is a debugging record. The value has an arbitary
+ meaning. */
+#define BSF_DEBUGGING 0x08
- /* The symbol denotes a function entry point. Used in ELF,
- perhaps others someday. */
+ /* The symbol denotes a function entry point. Used in ELF,
+ perhaps others someday. */
#define BSF_FUNCTION 0x10
- /* Used by the linker. */
+ /* Used by the linker. */
#define BSF_KEEP 0x20
#define BSF_KEEP_G 0x40
- /* A weak global symbol, overridable without warnings by
- a regular global symbol of the same name. */
+ /* A weak global symbol, overridable without warnings by
+ a regular global symbol of the same name. */
#define BSF_WEAK 0x80
/* This symbol was created to point to a section, e.g. ELF's
- STT_SECTION symbols. */
+ STT_SECTION symbols. */
#define BSF_SECTION_SYM 0x100
- /* The symbol used to be a common symbol, but now it is
- allocated. */
+ /* The symbol used to be a common symbol, but now it is
+ allocated. */
#define BSF_OLD_COMMON 0x200
- /* The default value for common data. */
+ /* The default value for common data. */
#define BFD_FORT_COMM_DEFAULT_VALUE 0
- /* In some files the type of a symbol sometimes alters its
- location in an output file - ie in coff a @code{ISFCN} symbol
- which is also @code{C_EXT} symbol appears where it was
- declared and not at the end of a section. This bit is set
- by the target BFD part to convey this information. */
+ /* In some files the type of a symbol sometimes alters its
+ location in an output file - ie in coff a @code{ISFCN} symbol
+ which is also @code{C_EXT} symbol appears where it was
+ declared and not at the end of a section. This bit is set
+ by the target BFD part to convey this information. */
#define BSF_NOT_AT_END 0x400
- /* Signal that the symbol is the label of constructor section. */
+ /* Signal that the symbol is the label of constructor section. */
#define BSF_CONSTRUCTOR 0x800
- /* Signal that the symbol is a warning symbol. The name is a
- warning. The name of the next symbol is the one to warn about;
- if a reference is made to a symbol with the same name as the next
- symbol, a warning is issued by the linker. */
+ /* Signal that the symbol is a warning symbol. The name is a
+ warning. The name of the next symbol is the one to warn about;
+ if a reference is made to a symbol with the same name as the next
+ symbol, a warning is issued by the linker. */
#define BSF_WARNING 0x1000
- /* Signal that the symbol is indirect. This symbol is an indirect
- pointer to the symbol with the same name as the next symbol. */
+ /* Signal that the symbol is indirect. This symbol is an indirect
+ pointer to the symbol with the same name as the next symbol. */
#define BSF_INDIRECT 0x2000
- /* BSF_FILE marks symbols that contain a file name. This is used
- for ELF STT_FILE symbols. */
+ /* BSF_FILE marks symbols that contain a file name. This is used
+ for ELF STT_FILE symbols. */
#define BSF_FILE 0x4000
- /* Symbol is from dynamic linking information. */
-#define BSF_DYNAMIC 0x8000
+ /* Symbol is from dynamic linking information. */
+#define BSF_DYNAMIC 0x8000
/* The symbol denotes a data object. Used in ELF, and perhaps
others someday. */
-#define BSF_OBJECT 0x10000
+#define BSF_OBJECT 0x10000
flagword flags;
- /* A pointer to the section to which this symbol is
- relative. This will always be non NULL, there are special
+ /* A pointer to the section to which this symbol is
+ relative. This will always be non NULL, there are special
sections for undefined and absolute symbols. */
struct sec *section;
- /* Back end special data. */
+ /* Back end special data. */
union
@{
PTR p;
@@ -260,7 +261,7 @@ typedef struct symbol_cache_entry
@node symbol handling functions, , typedef asymbol, Symbols
@subsection Symbol handling functions
-@*
+
@findex bfd_get_symtab_upper_bound
@subsubsection @code{bfd_get_symtab_upper_bound}
@strong{Description}@*
@@ -272,7 +273,7 @@ the BFD, then return 0. If an error occurs, return -1.
#define bfd_get_symtab_upper_bound(abfd) \
BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
@end example
-@*
+
@findex bfd_is_local_label
@subsubsection @code{bfd_is_local_label}
@strong{Synopsis}
@@ -282,7 +283,7 @@ boolean bfd_is_local_label(bfd *abfd, asymbol *sym);
@strong{Description}@*
Return true if the given symbol @var{sym} in the BFD @var{abfd} is
a compiler generated local label, else return false.
-@*
+
@findex bfd_is_local_label_name
@subsubsection @code{bfd_is_local_label_name}
@strong{Synopsis}
@@ -298,7 +299,7 @@ local label.
#define bfd_is_local_label_name(abfd, name) \
BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
@end example
-@*
+
@findex bfd_canonicalize_symtab
@subsubsection @code{bfd_canonicalize_symtab}
@strong{Description}@*
@@ -312,7 +313,7 @@ including the NULL.
BFD_SEND (abfd, _bfd_canonicalize_symtab,\
(abfd, location))
@end example
-@*
+
@findex bfd_set_symtab
@subsubsection @code{bfd_set_symtab}
@strong{Synopsis}
@@ -323,7 +324,7 @@ boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count);
Arrange that when the output BFD @var{abfd} is closed,
the table @var{location} of @var{count} pointers to symbols
will be written.
-@*
+
@findex bfd_print_symbol_vandf
@subsubsection @code{bfd_print_symbol_vandf}
@strong{Synopsis}
@@ -333,7 +334,7 @@ void bfd_print_symbol_vandf(PTR file, asymbol *symbol);
@strong{Description}@*
Print the value and flags of the @var{symbol} supplied to the
stream @var{file}.
-@*
+
@findex bfd_make_empty_symbol
@subsubsection @code{bfd_make_empty_symbol}
@strong{Description}@*
@@ -348,7 +349,7 @@ information, and will cause problems later on.
#define bfd_make_empty_symbol(abfd) \
BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
@end example
-@*
+
@findex bfd_make_debug_symbol
@subsubsection @code{bfd_make_debug_symbol}
@strong{Description}@*
@@ -359,13 +360,13 @@ yet to be worked out.
#define bfd_make_debug_symbol(abfd,ptr,size) \
BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
@end example
-@*
+
@findex bfd_decode_symclass
@subsubsection @code{bfd_decode_symclass}
@strong{Description}@*
Return a character corresponding to the symbol
class of @var{symbol}, or '?' for an unknown class.
-@*
+
@strong{Synopsis}
@example
int bfd_decode_symclass(asymbol *symbol);
@@ -376,7 +377,7 @@ int bfd_decode_symclass(asymbol *symbol);
Fill in the basic info about symbol that nm needs.
Additional info may be added by the back-ends after
calling this function.
-@*
+
@strong{Synopsis}
@example
void bfd_symbol_info(asymbol *symbol, symbol_info *ret);
@@ -402,6 +403,6 @@ Not enough memory exists to create private data for @var{osec}.
@example
#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
- (ibfd, isymbol, obfd, osymbol))
+ (ibfd, isymbol, obfd, osymbol))
@end example
-@*
+
diff --git a/contrib/binutils/bfd/doc/targets.texi b/contrib/binutils/bfd/doc/targets.texi
index 05dce15..ccaaf40 100644
--- a/contrib/binutils/bfd/doc/targets.texi
+++ b/contrib/binutils/bfd/doc/targets.texi
@@ -1,6 +1,6 @@
@section Targets
-@*
+
@strong{Description}@*
Each port of BFD to a different machine requries the creation
of a target back end. All the back end provides to the root
@@ -54,12 +54,12 @@ type is tried to see if it recognizes the specified format.
@menu
* bfd_target::
@end menu
-@*
+
@node bfd_target, , Targets, Targets
@subsection bfd_target
-@*
+
@strong{Description}@*
This structure contains everything that BFD knows about a
target. It includes things like its byte order, name, and which
@@ -253,10 +253,10 @@ CAT(NAME,_bfd_set_private_flags),\
CAT(NAME,_bfd_print_private_bfd_data)\
/* Called to copy BFD general private data from one object file
to another. */
- boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
+ boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
/* Called to merge BFD general private data from one object file
to a common output file when linking. */
- boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
+ boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
/* Called to copy BFD private section data from one object file
to another. */
boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
@@ -264,9 +264,9 @@ CAT(NAME,_bfd_print_private_bfd_data)\
/* Called to copy BFD private symbol data from one symbol
to another. */
boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
- bfd *, asymbol *));
+ bfd *, asymbol *));
/* Called to set private backend flags */
- boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
+ boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
/* Called to print private BFD data */
boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
@@ -335,7 +335,7 @@ CAT(NAME,_minisymbol_to_symbol)
struct symbol_cache_entry *,
symbol_info *));
#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
- boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
+ boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
@@ -436,7 +436,7 @@ in this structure.
PTR backend_data;
@} bfd_target;
@end example
-@*
+
@findex bfd_set_default_target
@subsubsection @code{bfd_set_default_target}
@strong{Synopsis}
@@ -447,7 +447,7 @@ boolean bfd_set_default_target (const char *name);
Set the default target vector to use when recognizing a BFD.
This takes the name of the target, which may be a BFD target
name or a configuration triplet.
-@*
+
@findex bfd_find_target
@subsubsection @code{bfd_find_target}
@strong{Synopsis}
@@ -464,7 +464,7 @@ variable to "default" will cause the first entry in the target
list to be returned, and "target_defaulted" will be set in the
BFD. This causes @code{bfd_check_format} to loop over all the
targets to find the one that matches the file being read.
-@*
+
@findex bfd_target_list
@subsubsection @code{bfd_target_list}
@strong{Synopsis}
@@ -475,4 +475,4 @@ const char **bfd_target_list(void);
Return a freshly malloced NULL-terminated
vector of the names of all the valid BFD targets. Do not
modify the names.
-@*
+
diff --git a/contrib/binutils/bfd/dwarf2.c b/contrib/binutils/bfd/dwarf2.c
new file mode 100644
index 0000000..ed2ba13
--- /dev/null
+++ b/contrib/binutils/bfd/dwarf2.c
@@ -0,0 +1,1457 @@
+/* DWARF 2 support.
+ Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+
+ Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
+ (gavin@cygnus.com).
+
+ From the dwarf2read.c header:
+ Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology,
+ Inc. with support from Florida State University (under contract
+ with the Ada Joint Program Office), and Silicon Graphics, Inc.
+ Initial contribution by Brent Benson, Harris Computer Systems, Inc.,
+ based on Fred Fish's (Cygnus Support) implementation of DWARF 1
+ support in dwarfread.c
+
+This file is part of BFD.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libiberty.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/dwarf2.h"
+
+/* The data in the .debug_line statement prologue looks like this. */
+struct line_head
+ {
+ unsigned int total_length;
+ unsigned short version;
+ unsigned int prologue_length;
+ unsigned char minimum_instruction_length;
+ unsigned char default_is_stmt;
+ int line_base;
+ unsigned char line_range;
+ unsigned char opcode_base;
+ unsigned char *standard_opcode_lengths;
+ };
+
+/* Attributes have a name and a value */
+struct attribute
+ {
+ enum dwarf_attribute name;
+ enum dwarf_form form;
+ union
+ {
+ char *str;
+ struct dwarf_block *blk;
+ unsigned int unsnd;
+ int snd;
+ bfd_vma addr;
+ }
+ u;
+ };
+
+/* Get at parts of an attribute structure */
+
+#define DW_STRING(attr) ((attr)->u.str)
+#define DW_UNSND(attr) ((attr)->u.unsnd)
+#define DW_BLOCK(attr) ((attr)->u.blk)
+#define DW_SND(attr) ((attr)->u.snd)
+#define DW_ADDR(attr) ((attr)->u.addr)
+
+/* Blocks are a bunch of untyped bytes. */
+struct dwarf_block
+ {
+ unsigned int size;
+ char *data;
+ };
+
+
+struct dwarf2_debug {
+
+ /* A list of all previously read comp_units. */
+ struct comp_unit* all_comp_units;
+
+ /* The next unread compilation unit within the .debug_info section.
+ Zero indicates that the .debug_info section has not been loaded
+ into a buffer yet.*/
+ char* info_ptr;
+
+ /* Pointer to the end of the .debug_info section memory buffer. */
+ char* info_ptr_end;
+
+ /* Pointer to the .debug_abbrev section loaded into memory. */
+ char* dwarf_abbrev_buffer;
+
+ /* Length of the loaded .debug_abbrev section. */
+ unsigned long dwarf_abbrev_size;
+};
+
+
+/* VERBATUM
+ The following function up to the END VERBATUM mark are
+ copied directly from dwarf2read.c. */
+
+/* read dwarf information from a buffer */
+
+static unsigned int
+read_1_byte (abfd, buf)
+ bfd *abfd;
+ char *buf;
+{
+ return bfd_get_8 (abfd, (bfd_byte *) buf);
+}
+
+static int
+read_1_signed_byte (abfd, buf)
+ bfd *abfd;
+ char *buf;
+{
+ return bfd_get_signed_8 (abfd, (bfd_byte *) buf);
+}
+
+static unsigned int
+read_2_bytes (abfd, buf)
+ bfd *abfd;
+ char *buf;
+{
+ return bfd_get_16 (abfd, (bfd_byte *) buf);
+}
+
+#if 0
+
+/* This is not used. */
+
+static int
+read_2_signed_bytes (abfd, buf)
+ bfd *abfd;
+ char *buf;
+{
+ return bfd_get_signed_16 (abfd, (bfd_byte *) buf);
+}
+
+#endif
+
+static unsigned int
+read_4_bytes (abfd, buf)
+ bfd *abfd;
+ char *buf;
+{
+ return bfd_get_32 (abfd, (bfd_byte *) buf);
+}
+
+#if 0
+
+/* This is not used. */
+
+static int
+read_4_signed_bytes (abfd, buf)
+ bfd *abfd;
+ char *buf;
+{
+ return bfd_get_signed_32 (abfd, (bfd_byte *) buf);
+}
+
+#endif
+
+static unsigned int
+read_8_bytes (abfd, buf)
+ bfd *abfd;
+ char *buf;
+{
+ return bfd_get_64 (abfd, (bfd_byte *) buf);
+}
+
+static char *
+read_n_bytes (abfd, buf, size)
+ bfd * abfd;
+ char *buf;
+ unsigned int size;
+{
+ /* If the size of a host char is 8 bits, we can return a pointer
+ to the buffer, otherwise we have to copy the data to a buffer
+ allocated on the temporary obstack. */
+ return buf;
+}
+
+static char *
+read_string (abfd, buf, bytes_read_ptr)
+ bfd *abfd;
+ char *buf;
+ unsigned int *bytes_read_ptr;
+{
+ /* If the size of a host char is 8 bits, we can return a pointer
+ to the string, otherwise we have to copy the string to a buffer
+ allocated on the temporary obstack. */
+ if (*buf == '\0')
+ {
+ *bytes_read_ptr = 1;
+ return NULL;
+ }
+ *bytes_read_ptr = strlen (buf) + 1;
+ return buf;
+}
+
+static unsigned int
+read_unsigned_leb128 (abfd, buf, bytes_read_ptr)
+ bfd *abfd;
+ char *buf;
+ unsigned int *bytes_read_ptr;
+{
+ unsigned int result, num_read;
+ int i, shift;
+ unsigned char byte;
+
+ result = 0;
+ shift = 0;
+ num_read = 0;
+ i = 0;
+ while (1)
+ {
+ byte = bfd_get_8 (abfd, (bfd_byte *) buf);
+ buf++;
+ num_read++;
+ result |= ((byte & 127) << shift);
+ if ((byte & 128) == 0)
+ {
+ break;
+ }
+ shift += 7;
+ }
+ *bytes_read_ptr = num_read;
+ return result;
+}
+
+static int
+read_signed_leb128 (abfd, buf, bytes_read_ptr)
+ bfd *abfd;
+ char *buf;
+ unsigned int *bytes_read_ptr;
+{
+ int result;
+ int i, shift, size, num_read;
+ unsigned char byte;
+
+ result = 0;
+ shift = 0;
+ size = 32;
+ num_read = 0;
+ i = 0;
+ while (1)
+ {
+ byte = bfd_get_8 (abfd, (bfd_byte *) buf);
+ buf++;
+ num_read++;
+ result |= ((byte & 127) << shift);
+ shift += 7;
+ if ((byte & 128) == 0)
+ {
+ break;
+ }
+ }
+ if ((shift < size) && (byte & 0x40))
+ {
+ result |= -(1 << shift);
+ }
+ *bytes_read_ptr = num_read;
+ return result;
+}
+
+/* END VERBATUM */
+
+
+static bfd_vma
+read_address (abfd, buf)
+ bfd *abfd;
+ char *buf;
+{
+ bfd_vma retval = 0;
+
+ if (sizeof(retval) == 4)
+ {
+ retval = bfd_get_32 (abfd, (bfd_byte *) buf);
+ } else {
+ retval = bfd_get_64 (abfd, (bfd_byte *) buf);
+ }
+ return retval;
+}
+
+
+
+
+
+/* This data structure holds the information of an abbrev. */
+struct abbrev_info
+ {
+ unsigned int number; /* number identifying abbrev */
+ enum dwarf_tag tag; /* dwarf tag */
+ int has_children; /* boolean */
+ unsigned int num_attrs; /* number of attributes */
+ struct attr_abbrev *attrs; /* an array of attribute descriptions */
+ struct abbrev_info *next; /* next in chain */
+ };
+
+struct attr_abbrev
+ {
+ enum dwarf_attribute name;
+ enum dwarf_form form;
+ };
+
+#ifndef ABBREV_HASH_SIZE
+#define ABBREV_HASH_SIZE 121
+#endif
+#ifndef ATTR_ALLOC_CHUNK
+#define ATTR_ALLOC_CHUNK 4
+#endif
+
+/* Lookup an abbrev_info structure in the abbrev hash table. */
+
+static struct abbrev_info *
+lookup_abbrev (number,abbrevs)
+ unsigned int number;
+ struct abbrev_info **abbrevs;
+{
+ unsigned int hash_number;
+ struct abbrev_info *abbrev;
+
+ hash_number = number % ABBREV_HASH_SIZE;
+ abbrev = abbrevs[hash_number];
+
+ while (abbrev)
+ {
+ if (abbrev->number == number)
+ return abbrev;
+ else
+ abbrev = abbrev->next;
+ }
+ return NULL;
+}
+
+/* In DWARF version 2, the description of the debugging information is
+ stored in a separate .debug_abbrev section. Before we read any
+ dies from a section we read in all abbreviations and install them
+ in a hash table. */
+
+static struct abbrev_info**
+read_abbrevs (abfd, offset)
+ bfd * abfd;
+ unsigned int offset;
+{
+ struct abbrev_info **abbrevs;
+ char *abbrev_ptr;
+ struct abbrev_info *cur_abbrev;
+ unsigned int abbrev_number, bytes_read, abbrev_name;
+ unsigned int abbrev_form, hash_number;
+ struct dwarf2_debug *stash;
+
+ stash = elf_tdata(abfd)->dwarf2_find_line_info;
+
+ if (! stash->dwarf_abbrev_buffer)
+ {
+ asection *msec;
+
+ msec = bfd_get_section_by_name (abfd, ".debug_abbrev");
+ if (! msec)
+ {
+ (*_bfd_error_handler) ("Dwarf Error: Can't find .debug_abbrev section.");
+ bfd_set_error (bfd_error_bad_value);
+ return 0;
+ }
+
+ stash->dwarf_abbrev_size = bfd_get_section_size_before_reloc (msec);
+ stash->dwarf_abbrev_buffer = (unsigned char*) bfd_alloc (abfd, stash->dwarf_abbrev_size);
+ if (! stash->dwarf_abbrev_buffer)
+ return 0;
+
+ if (! bfd_get_section_contents (abfd, msec,
+ stash->dwarf_abbrev_buffer, 0,
+ stash->dwarf_abbrev_size))
+ return 0;
+ }
+
+ if (offset > stash->dwarf_abbrev_size)
+ {
+ (*_bfd_error_handler) ("Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u).",
+ offset, stash->dwarf_abbrev_size );
+ bfd_set_error (bfd_error_bad_value);
+ return 0;
+ }
+
+ abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, sizeof(struct abbrev_info*) * ABBREV_HASH_SIZE);
+
+ abbrev_ptr = stash->dwarf_abbrev_buffer + offset;
+ abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+ abbrev_ptr += bytes_read;
+
+ /* loop until we reach an abbrev number of 0 */
+ while (abbrev_number)
+ {
+ cur_abbrev = (struct abbrev_info*)bfd_zalloc (abfd, sizeof (struct abbrev_info));
+
+ /* read in abbrev header */
+ cur_abbrev->number = abbrev_number;
+ cur_abbrev->tag = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+ abbrev_ptr += bytes_read;
+ cur_abbrev->has_children = read_1_byte (abfd, abbrev_ptr);
+ abbrev_ptr += 1;
+
+ /* now read in declarations */
+ abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+ abbrev_ptr += bytes_read;
+ abbrev_form = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+ abbrev_ptr += bytes_read;
+ while (abbrev_name)
+ {
+ if ((cur_abbrev->num_attrs % ATTR_ALLOC_CHUNK) == 0)
+ {
+ cur_abbrev->attrs = (struct attr_abbrev *)
+ bfd_realloc (cur_abbrev->attrs,
+ (cur_abbrev->num_attrs + ATTR_ALLOC_CHUNK)
+ * sizeof (struct attr_abbrev));
+ if (! cur_abbrev->attrs)
+ return 0;
+ }
+ cur_abbrev->attrs[cur_abbrev->num_attrs].name = abbrev_name;
+ cur_abbrev->attrs[cur_abbrev->num_attrs++].form = abbrev_form;
+ abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+ abbrev_ptr += bytes_read;
+ abbrev_form = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+ abbrev_ptr += bytes_read;
+ }
+
+ hash_number = abbrev_number % ABBREV_HASH_SIZE;
+ cur_abbrev->next = abbrevs[hash_number];
+ abbrevs[hash_number] = cur_abbrev;
+
+ /* Get next abbreviation.
+ Under Irix6 the abbreviations for a compilation unit are not
+ always properly terminated with an abbrev number of 0.
+ Exit loop if we encounter an abbreviation which we have
+ already read (which means we are about to read the abbreviations
+ for the next compile unit) or if the end of the abbreviation
+ table is reached. */
+ if ((unsigned int) (abbrev_ptr - stash->dwarf_abbrev_buffer)
+ >= stash->dwarf_abbrev_size)
+ break;
+ abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+ abbrev_ptr += bytes_read;
+ if (lookup_abbrev (abbrev_number,abbrevs) != NULL)
+ break;
+ }
+
+ return abbrevs;
+}
+
+/* Read an attribute described by an abbreviated attribute. */
+
+static char *
+read_attribute (attr, abbrev, abfd, info_ptr)
+ struct attribute *attr;
+ struct attr_abbrev *abbrev;
+ bfd *abfd;
+ char *info_ptr;
+{
+ unsigned int bytes_read;
+ struct dwarf_block *blk;
+
+ attr->name = abbrev->name;
+ attr->form = abbrev->form;
+ switch (abbrev->form)
+ {
+ case DW_FORM_addr:
+ case DW_FORM_ref_addr:
+ DW_ADDR (attr) = read_address (abfd, info_ptr);
+ info_ptr += sizeof(bfd_vma);
+ break;
+ case DW_FORM_block2:
+ blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block));
+ blk->size = read_2_bytes (abfd, info_ptr);
+ info_ptr += 2;
+ blk->data = read_n_bytes (abfd, info_ptr, blk->size);
+ info_ptr += blk->size;
+ DW_BLOCK (attr) = blk;
+ break;
+ case DW_FORM_block4:
+ blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block));
+ blk->size = read_4_bytes (abfd, info_ptr);
+ info_ptr += 4;
+ blk->data = read_n_bytes (abfd, info_ptr, blk->size);
+ info_ptr += blk->size;
+ DW_BLOCK (attr) = blk;
+ break;
+ case DW_FORM_data2:
+ DW_UNSND (attr) = read_2_bytes (abfd, info_ptr);
+ info_ptr += 2;
+ break;
+ case DW_FORM_data4:
+ DW_UNSND (attr) = read_4_bytes (abfd, info_ptr);
+ info_ptr += 4;
+ break;
+ case DW_FORM_data8:
+ DW_UNSND (attr) = read_8_bytes (abfd, info_ptr);
+ info_ptr += 8;
+ break;
+ case DW_FORM_string:
+ DW_STRING (attr) = read_string (abfd, info_ptr, &bytes_read);
+ info_ptr += bytes_read;
+ break;
+ case DW_FORM_block:
+ blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block));
+ blk->size = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
+ info_ptr += bytes_read;
+ blk->data = read_n_bytes (abfd, info_ptr, blk->size);
+ info_ptr += blk->size;
+ DW_BLOCK (attr) = blk;
+ break;
+ case DW_FORM_block1:
+ blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block));
+ blk->size = read_1_byte (abfd, info_ptr);
+ info_ptr += 1;
+ blk->data = read_n_bytes (abfd, info_ptr, blk->size);
+ info_ptr += blk->size;
+ DW_BLOCK (attr) = blk;
+ break;
+ case DW_FORM_data1:
+ DW_UNSND (attr) = read_1_byte (abfd, info_ptr);
+ info_ptr += 1;
+ break;
+ case DW_FORM_flag:
+ DW_UNSND (attr) = read_1_byte (abfd, info_ptr);
+ info_ptr += 1;
+ break;
+ case DW_FORM_sdata:
+ DW_SND (attr) = read_signed_leb128 (abfd, info_ptr, &bytes_read);
+ info_ptr += bytes_read;
+ break;
+ case DW_FORM_udata:
+ DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
+ info_ptr += bytes_read;
+ break;
+ case DW_FORM_ref1:
+ DW_UNSND (attr) = read_1_byte (abfd, info_ptr);
+ info_ptr += 1;
+ break;
+ case DW_FORM_ref2:
+ DW_UNSND (attr) = read_2_bytes (abfd, info_ptr);
+ info_ptr += 2;
+ break;
+ case DW_FORM_ref4:
+ DW_UNSND (attr) = read_4_bytes (abfd, info_ptr);
+ info_ptr += 4;
+ break;
+ case DW_FORM_ref_udata:
+ DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
+ info_ptr += bytes_read;
+ break;
+ case DW_FORM_strp:
+ case DW_FORM_indirect:
+ default:
+ (*_bfd_error_handler) ("Dwarf Error: Invalid or unhandled FORM value: %d.",
+ abbrev->form);
+ bfd_set_error (bfd_error_bad_value);
+ }
+ return info_ptr;
+}
+
+
+/* Source line information table routines. */
+
+#define FILE_ALLOC_CHUNK 5
+#define DIR_ALLOC_CHUNK 5
+
+struct line_info {
+ struct line_info* prev_line;
+
+ bfd_vma address;
+ char* filename;
+ unsigned int line;
+ unsigned int column;
+};
+
+struct fileinfo {
+ char *name;
+ unsigned int dir;
+ unsigned int time;
+ unsigned int size;
+};
+
+struct line_info_table {
+ bfd* abfd;
+
+ unsigned int num_files;
+ unsigned int num_dirs;
+
+ char* comp_dir;
+ char** dirs;
+ struct fileinfo* files;
+ struct line_info* last_line;
+};
+
+static void
+add_line_info (table, address, filename, line, column)
+ struct line_info_table* table;
+ bfd_vma address;
+ char* filename;
+ unsigned int line;
+ unsigned int column;
+{
+ struct line_info* info = (struct line_info*)
+ bfd_alloc (table->abfd, sizeof (struct line_info));
+
+ info->prev_line = table->last_line;
+ table->last_line = info;
+
+ info->address = address;
+ info->filename = filename;
+ info->line = line;
+ info->column = column;
+}
+
+static char*
+concat_filename (table, file)
+ struct line_info_table* table;
+ unsigned int file;
+{
+ char* filename = table->files[file - 1].name;
+ if (*filename == '/')
+ return filename;
+
+ else
+ {
+ char* dirname = (table->files[file - 1].dir
+ ? table->dirs[table->files[file - 1].dir - 1]
+ : table->comp_dir);
+ return (char*) concat (dirname, "/", filename, NULL);
+ }
+}
+
+/* Decode the line number information for the compilation unit whose
+ line number info is at OFFSET in the .debug_line section.
+ The compilation directory of the file is passed in COMP_DIR. */
+
+static struct line_info_table*
+decode_line_info (abfd, offset, comp_dir)
+ bfd *abfd;
+ unsigned int offset;
+ char *comp_dir;
+{
+ static char* dwarf_line_buffer = 0;
+
+ struct line_info_table* table;
+
+ char *line_ptr;
+ char *line_end;
+ struct line_head lh;
+ unsigned int i, bytes_read;
+ char *cur_file, *cur_dir;
+ unsigned char op_code, extended_op, adj_opcode;
+
+ if (! dwarf_line_buffer)
+ {
+ asection *msec;
+ unsigned long size;
+
+ msec = bfd_get_section_by_name (abfd, ".debug_line");
+ if (! msec)
+ {
+ (*_bfd_error_handler) ("Dwarf Error: Can't find .debug_line section.");
+ bfd_set_error (bfd_error_bad_value);
+ return 0;
+ }
+
+ size = bfd_get_section_size_before_reloc (msec);
+ dwarf_line_buffer = (unsigned char*) bfd_alloc (abfd, size);
+ if (! dwarf_line_buffer)
+ return 0;
+
+ if (! bfd_get_section_contents (abfd, msec,
+ dwarf_line_buffer, 0,
+ size))
+ return 0;
+ }
+
+ table = (struct line_info_table*) bfd_alloc (abfd,
+ sizeof (struct line_info_table));
+ table->abfd = abfd;
+ table->comp_dir = comp_dir;
+
+ table->num_files = 0;
+ table->files = NULL;
+
+ table->num_dirs = 0;
+ table->dirs = NULL;
+
+ line_ptr = dwarf_line_buffer + offset;
+
+ /* read in the prologue */
+ lh.total_length = read_4_bytes (abfd, line_ptr);
+ line_ptr += 4;
+ line_end = line_ptr + lh.total_length;
+ lh.version = read_2_bytes (abfd, line_ptr);
+ line_ptr += 2;
+ lh.prologue_length = read_4_bytes (abfd, line_ptr);
+ line_ptr += 4;
+ lh.minimum_instruction_length = read_1_byte (abfd, line_ptr);
+ line_ptr += 1;
+ lh.default_is_stmt = read_1_byte (abfd, line_ptr);
+ line_ptr += 1;
+ lh.line_base = read_1_signed_byte (abfd, line_ptr);
+ line_ptr += 1;
+ lh.line_range = read_1_byte (abfd, line_ptr);
+ line_ptr += 1;
+ lh.opcode_base = read_1_byte (abfd, line_ptr);
+ line_ptr += 1;
+ lh.standard_opcode_lengths = (unsigned char *)
+ bfd_alloc (abfd, lh.opcode_base * sizeof (unsigned char));
+
+ lh.standard_opcode_lengths[0] = 1;
+ for (i = 1; i < lh.opcode_base; ++i)
+ {
+ lh.standard_opcode_lengths[i] = read_1_byte (abfd, line_ptr);
+ line_ptr += 1;
+ }
+
+ /* Read directory table */
+ while ((cur_dir = read_string (abfd, line_ptr, &bytes_read)) != NULL)
+ {
+ line_ptr += bytes_read;
+ if ((table->num_dirs % DIR_ALLOC_CHUNK) == 0)
+ {
+ table->dirs = (char **)
+ bfd_realloc (table->dirs,
+ (table->num_dirs + DIR_ALLOC_CHUNK) * sizeof (char *));
+ if (! table->dirs)
+ return 0;
+ }
+ table->dirs[table->num_dirs++] = cur_dir;
+ }
+ line_ptr += bytes_read;
+
+ /* Read file name table */
+ while ((cur_file = read_string (abfd, line_ptr, &bytes_read)) != NULL)
+ {
+ line_ptr += bytes_read;
+ if ((table->num_files % FILE_ALLOC_CHUNK) == 0)
+ {
+ table->files = (struct fileinfo *)
+ bfd_realloc (table->files,
+ (table->num_files + FILE_ALLOC_CHUNK)
+ * sizeof (struct fileinfo));
+ if (! table->files)
+ return 0;
+ }
+ table->files[table->num_files].name = cur_file;
+ table->files[table->num_files].dir =
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ table->files[table->num_files].time =
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ table->files[table->num_files].size =
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ table->num_files++;
+ }
+ line_ptr += bytes_read;
+
+ /* Read the statement sequences until there's nothing left. */
+ while (line_ptr < line_end)
+ {
+ /* state machine registers */
+ bfd_vma address = 0;
+ char* filename = concat_filename (table, 1);
+ unsigned int line = 1;
+ unsigned int column = 0;
+ int is_stmt = lh.default_is_stmt;
+ int basic_block = 0;
+ int end_sequence = 0;
+
+ /* Decode the table. */
+ while (! end_sequence)
+ {
+ op_code = read_1_byte (abfd, line_ptr);
+ line_ptr += 1;
+ switch (op_code)
+ {
+ case DW_LNS_extended_op:
+ line_ptr += 1; /* ignore length */
+ extended_op = read_1_byte (abfd, line_ptr);
+ line_ptr += 1;
+ switch (extended_op)
+ {
+ case DW_LNE_end_sequence:
+ end_sequence = 1;
+ add_line_info (table, address, filename, line, column);
+ break;
+ case DW_LNE_set_address:
+ address = read_address (abfd, line_ptr);
+ address &= 0xffffffff;
+ line_ptr += sizeof (bfd_vma);
+ break;
+ case DW_LNE_define_file:
+ cur_file = read_string (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ if ((table->num_files % FILE_ALLOC_CHUNK) == 0)
+ {
+ table->files = (struct fileinfo *)
+ bfd_realloc (table->files,
+ (table->num_files + FILE_ALLOC_CHUNK)
+ * sizeof (struct fileinfo));
+ if (! table->files)
+ return 0;
+ }
+ table->files[table->num_files].name = cur_file;
+ table->files[table->num_files].dir =
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ table->files[table->num_files].time =
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ table->files[table->num_files].size =
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ table->num_files++;
+ break;
+ default:
+ (*_bfd_error_handler) ("Dwarf Error: mangled line number section.");
+ bfd_set_error (bfd_error_bad_value);
+ return 0;
+ }
+ break;
+ case DW_LNS_copy:
+ add_line_info (table, address, filename, line, column);
+ basic_block = 0;
+ break;
+ case DW_LNS_advance_pc:
+ address += lh.minimum_instruction_length
+ * read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ break;
+ case DW_LNS_advance_line:
+ line += read_signed_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ break;
+ case DW_LNS_set_file:
+ {
+ unsigned int file;
+
+ /* The file and directory tables are 0 based, the references
+ are 1 based. */
+ file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ filename = concat_filename (table, file);
+ break;
+ }
+ case DW_LNS_set_column:
+ column = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ break;
+ case DW_LNS_negate_stmt:
+ is_stmt = (!is_stmt);
+ break;
+ case DW_LNS_set_basic_block:
+ basic_block = 1;
+ break;
+ case DW_LNS_const_add_pc:
+ address += (255 - lh.opcode_base) / lh.line_range;
+ break;
+ case DW_LNS_fixed_advance_pc:
+ address += read_2_bytes (abfd, line_ptr);
+ line_ptr += 2;
+ break;
+ default: /* special operand */
+ adj_opcode = op_code - lh.opcode_base;
+ address += (adj_opcode / lh.line_range)
+ * lh.minimum_instruction_length;
+ line += lh.line_base + (adj_opcode % lh.line_range);
+ /* append row to matrix using current values */
+ add_line_info (table, address, filename, line, column);
+ basic_block = 1;
+ }
+ }
+ }
+
+ return table;
+}
+
+
+/* If ADDR is within TABLE set the output parameters and return true,
+ otherwise return false. The output parameters, FILENAME_PTR and
+ LINENUMBER_PTR, are pointers to the objects to be filled in. */
+
+static boolean
+lookup_address_in_line_info_table (table,
+ addr,
+ filename_ptr,
+ linenumber_ptr)
+ struct line_info_table* table;
+ bfd_vma addr;
+ const char **filename_ptr;
+ unsigned int *linenumber_ptr;
+{
+ struct line_info* each_line;
+ struct line_info* next_line;
+
+ for (next_line = 0, each_line = table->last_line;
+ each_line;
+ next_line = each_line, each_line = each_line->prev_line)
+ {
+ if (addr >= each_line->address
+ && (next_line == 0
+ || addr < next_line->address))
+ {
+ *filename_ptr = each_line->filename;
+ *linenumber_ptr = each_line->line;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+
+
+/* Function table functions. */
+
+struct funcinfo {
+ struct funcinfo *prev_func;
+
+ char* name;
+ bfd_vma low;
+ bfd_vma high;
+};
+
+
+/* If ADDR is within TABLE, set FUNCTIONNAME_PTR, and return true. */
+
+static boolean
+lookup_address_in_function_table (table,
+ addr,
+ functionname_ptr)
+ struct funcinfo* table;
+ bfd_vma addr;
+ const char **functionname_ptr;
+{
+ struct funcinfo* each_func;
+
+ for (each_func = table;
+ each_func;
+ each_func = each_func->prev_func)
+ {
+ if (addr >= (each_func->low & 0xffffffff)
+ && addr < (each_func->high & 0xffffffff))
+ {
+ *functionname_ptr = each_func->name;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+
+
+/* DWARF2 Compilation unit functions. */
+
+
+/* A minimal decoding of DWARF2 compilation units. We only decode
+ what's needed to get to the line number information. */
+
+struct comp_unit {
+
+ /* Chain the previously read compilation units. */
+ struct comp_unit* next_unit;
+
+ /* Keep the bdf convenient (for memory allocation). */
+ bfd* abfd;
+
+ /* The lowest and higest addresses contained in this compilation
+ unit as specified in the compilation unit header. */
+ bfd_vma low;
+ bfd_vma high;
+
+ /* The DW_AT_name attribute (for error messages). */
+ char* name;
+
+ /* The abbrev hash table. */
+ struct abbrev_info** abbrevs;
+
+ /* Note that an error was found by comp_unit_find_nearest_line. */
+ int error;
+
+ /* The DW_AT_comp_dir attribute */
+ char* comp_dir;
+
+ /* True if there is a line number table associated with this comp. unit. */
+ int stmtlist;
+
+ /* The offset into .debug_line of the line number table. */
+ unsigned long line_offset;
+
+ /* Pointer to the first child die for the comp unit. */
+ char *first_child_die_ptr;
+
+ /* The end of the comp unit. */
+ char *end_ptr;
+
+ /* The decoded line number, NULL if not yet decoded. */
+ struct line_info_table* line_table;
+
+ /* A list of the functions found in this comp. unit. */
+ struct funcinfo* function_table;
+
+};
+
+
+
+/* Scan over each die in a comp. unit looking for functions to add
+ to the function table. */
+
+static boolean
+scan_unit_for_functions (unit)
+ struct comp_unit *unit;
+{
+ bfd *abfd = unit->abfd;
+ char *info_ptr = unit->first_child_die_ptr;
+ int nesting_level = 1;
+
+ while (nesting_level)
+ {
+ unsigned int abbrev_number, bytes_read, i;
+ struct abbrev_info *abbrev;
+ struct attribute attr;
+ struct funcinfo *func;
+ char* name = 0;
+
+ abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
+ info_ptr += bytes_read;
+
+ if (! abbrev_number)
+ {
+ nesting_level--;
+ continue;
+ }
+
+ abbrev = lookup_abbrev (abbrev_number,unit->abbrevs);
+ if (! abbrev)
+ {
+ (*_bfd_error_handler) ("Dwarf Error: Could not find abbrev number %d.",
+ abbrev_number);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
+ if (abbrev->tag == DW_TAG_subprogram)
+ {
+ func = (struct funcinfo*) bfd_zalloc (abfd, sizeof (struct funcinfo));
+ func->prev_func = unit->function_table;
+ unit->function_table = func;
+ }
+ else
+ func = NULL;
+
+ for (i = 0; i < abbrev->num_attrs; ++i)
+ {
+ info_ptr = read_attribute (&attr, &abbrev->attrs[i], abfd, info_ptr);
+
+ if (func)
+ {
+ switch (attr.name)
+ {
+ case DW_AT_name:
+
+ name = DW_STRING (&attr);
+
+ /* Prefer DW_AT_MIPS_linkage_name over DW_AT_name. */
+ if (func->name == NULL)
+ func->name = DW_STRING (&attr);
+ break;
+
+ case DW_AT_MIPS_linkage_name:
+ func->name = DW_STRING (&attr);
+ break;
+
+ case DW_AT_low_pc:
+ func->low = DW_ADDR (&attr);
+ break;
+
+ case DW_AT_high_pc:
+ func->high = DW_ADDR (&attr);
+ break;
+
+ default:
+ break;
+ }
+ }
+ else
+ {
+ switch (attr.name)
+ {
+ case DW_AT_name:
+ name = DW_STRING (&attr);
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ if (abbrev->has_children)
+ nesting_level++;
+ }
+
+ return true;
+}
+
+
+
+
+
+
+/* Parse a DWARF2 compilation unit starting at INFO_PTR. This includes
+ the compilation unit header that proceeds the DIE's, but does not
+ include the length field that preceeds each compilation unit header.
+ END_PTR points one past the end of this comp unit.
+
+ This routine does not read the whole compilation unit; only enough
+ to get to the line number information for the compilation unit.
+ */
+
+static struct comp_unit*
+parse_comp_unit (abfd, info_ptr, end_ptr)
+ bfd* abfd;
+ char* info_ptr;
+ char* end_ptr;
+{
+ struct comp_unit* unit;
+
+ unsigned short version;
+ unsigned int abbrev_offset;
+ unsigned char addr_size;
+ struct abbrev_info** abbrevs;
+
+ unsigned int abbrev_number, bytes_read, i;
+ struct abbrev_info *abbrev;
+ struct attribute attr;
+
+ version = read_2_bytes (abfd, info_ptr);
+ info_ptr += 2;
+ abbrev_offset = read_4_bytes (abfd, info_ptr);
+ info_ptr += 4;
+ addr_size = read_1_byte (abfd, info_ptr);
+ info_ptr += 1;
+
+ if (version != 2)
+ {
+ (*_bfd_error_handler) ("Dwarf Error: found dwarf version '%hu' in compilation unit '%s', this reader only handles version 2 information.",
+ version,
+ unit->name);
+ bfd_set_error (bfd_error_bad_value);
+ return 0;
+ }
+
+ if (addr_size != sizeof (bfd_vma))
+ {
+ (*_bfd_error_handler) ("Dwarf Error: found address size '%u' in compilation unit '%s', this readers only handles address size '%u'.",
+ addr_size,
+ unit->name,
+ sizeof (bfd_vma));
+ bfd_set_error (bfd_error_bad_value);
+ return 0;
+ }
+
+ /* Read the abbrevs for this compilation unit into a table */
+ abbrevs = read_abbrevs (abfd, abbrev_offset);
+ if (! abbrevs)
+ return 0;
+
+ abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
+ info_ptr += bytes_read;
+ if (! abbrev_number)
+ {
+ (*_bfd_error_handler) ("Dwarf Error: Bad abbrev number: %d.",
+ abbrev_number);
+ bfd_set_error (bfd_error_bad_value);
+ return 0;
+ }
+
+ abbrev = lookup_abbrev (abbrev_number, abbrevs);
+ if (! abbrev)
+ {
+ (*_bfd_error_handler) ("Dwarf Error: Could not find abbrev number %d.",
+ abbrev_number);
+ bfd_set_error (bfd_error_bad_value);
+ return 0;
+ }
+
+ unit = (struct comp_unit*) bfd_zalloc (abfd, sizeof (struct comp_unit));
+ unit->abfd = abfd;
+ unit->abbrevs = abbrevs;
+ unit->end_ptr = end_ptr;
+
+ for (i = 0; i < abbrev->num_attrs; ++i)
+ {
+ info_ptr = read_attribute (&attr, &abbrev->attrs[i], abfd, info_ptr);
+
+ /* Store the data if it is of an attribute we want to keep in a
+ partial symbol table. */
+ switch (attr.name)
+ {
+ case DW_AT_stmt_list:
+ unit->stmtlist = 1;
+ unit->line_offset = DW_UNSND (&attr);
+ break;
+
+ case DW_AT_name:
+ unit->name = DW_STRING (&attr);
+ break;
+
+ case DW_AT_low_pc:
+ unit->low = DW_ADDR (&attr);
+ break;
+
+ case DW_AT_high_pc:
+ unit->high = DW_ADDR (&attr);
+ break;
+
+ case DW_AT_comp_dir:
+ {
+ char* comp_dir = DW_STRING (&attr);
+ if (comp_dir)
+ {
+ /* Irix 6.2 native cc prepends <machine>.: to the compilation
+ directory, get rid of it. */
+ char *cp = (char*) strchr (comp_dir, ':');
+
+ if (cp && cp != comp_dir && cp[-1] == '.' && cp[1] == '/')
+ comp_dir = cp + 1;
+ }
+ unit->comp_dir = comp_dir;
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
+ unit->first_child_die_ptr = info_ptr;
+ return unit;
+}
+
+
+
+
+
+/* Return true if UNIT contains the address given by ADDR. */
+
+static boolean
+comp_unit_contains_address (unit, addr)
+ struct comp_unit* unit;
+ bfd_vma addr;
+{
+ return ! unit->error
+ && ( addr >= (unit->low & 0xffffffff)
+ && addr <= (unit->high & 0xffffffff));
+}
+
+
+/* If UNIT contains ADDR, set the output parameters to the values for
+ the line containing ADDR. The output parameters, FILENAME_PTR,
+ FUNCTIONNAME_PTR, and LINENUMBER_PTR, are pointers to the objects
+ to be filled in.
+
+ Return true of UNIT contains ADDR, and no errors were encountered;
+ false otherwise. */
+
+static boolean
+comp_unit_find_nearest_line (unit, addr,
+ filename_ptr, functionname_ptr, linenumber_ptr)
+ struct comp_unit* unit;
+ bfd_vma addr;
+ const char **filename_ptr;
+ const char **functionname_ptr;
+ unsigned int *linenumber_ptr;
+{
+ boolean line_p;
+ boolean func_p;
+
+ if (unit->error)
+ return false;
+
+ if (! unit->line_table)
+ {
+ if (! unit->stmtlist)
+ {
+ unit->error = 1;
+ return false;
+ }
+
+ unit->line_table = decode_line_info (unit->abfd,
+ unit->line_offset,
+ unit->comp_dir);
+
+ if (! unit->line_table)
+ {
+ unit->error = 1;
+ return false;
+ }
+
+ if (! scan_unit_for_functions (unit))
+ {
+ unit->error = 1;
+ return false;
+ }
+ }
+
+ line_p = lookup_address_in_line_info_table (unit->line_table,
+ addr,
+ filename_ptr,
+ linenumber_ptr);
+ func_p = lookup_address_in_function_table (unit->function_table,
+ addr,
+ functionname_ptr);
+ return line_p || func_p;
+}
+
+/* The DWARF2 version of find_nearest line.
+ Return true if the line is found without error. */
+
+boolean
+_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
+ filename_ptr, functionname_ptr, linenumber_ptr)
+ bfd *abfd;
+ asection *section;
+ asymbol **symbols;
+ bfd_vma offset;
+ const char **filename_ptr;
+ const char **functionname_ptr;
+ unsigned int *linenumber_ptr;
+{
+ /* Read each compilation unit from the section .debug_info, and check
+ to see if it contains the address we are searching for. If yes,
+ lookup the address, and return the line number info. If no, go
+ on to the next compilation unit.
+
+ We keep a list of all the previously read compilation units, and
+ a pointer to the next un-read compilation unit. Check the
+ previously read units before reading more.
+ */
+
+ struct dwarf2_debug *stash = elf_tdata (abfd)->dwarf2_find_line_info;
+
+ /* What address are we looking for? */
+ bfd_vma addr = offset + section->vma;
+
+ struct comp_unit* each;
+
+ *filename_ptr = NULL;
+ *functionname_ptr = NULL;
+ *linenumber_ptr = 0;
+
+ if (! stash)
+ {
+ asection *msec;
+ unsigned long size;
+
+ stash = elf_tdata (abfd)->dwarf2_find_line_info =
+ (struct dwarf2_debug*) bfd_zalloc (abfd, sizeof (struct dwarf2_debug));
+
+ if (! stash)
+ return false;
+
+ msec = bfd_get_section_by_name (abfd, ".debug_info");
+ if (! msec)
+ {
+ /* No dwarf2 info. Note that at this point the stash
+ has been allocated, but contains zeros, this lets
+ future calls to this function fail quicker. */
+ return false;
+ }
+
+ size = bfd_get_section_size_before_reloc (msec);
+ stash->info_ptr = (unsigned char*) bfd_alloc (abfd, size);
+
+ if (! stash->info_ptr)
+ return false;
+
+ if (! bfd_get_section_contents (abfd, msec, stash->info_ptr, 0, size))
+ {
+ stash->info_ptr = 0;
+ return false;
+ }
+
+ stash->info_ptr_end = stash->info_ptr + size;
+ }
+
+
+ /* A null info_ptr indicates that there is no dwarf2 info
+ (or that an error occured while setting up the stash). */
+
+ if (! stash->info_ptr)
+ return false;
+
+
+
+ /* Check the previously read comp. units first. */
+
+ for (each = stash->all_comp_units; each; each = each->next_unit)
+ {
+ if (comp_unit_contains_address (each, addr))
+ return comp_unit_find_nearest_line (each, addr,
+ filename_ptr,
+ functionname_ptr,
+ linenumber_ptr);
+ }
+
+
+ /* Read each remaining comp. units checking each as they are read. */
+ while (stash->info_ptr < stash->info_ptr_end)
+ {
+ struct comp_unit* each;
+ unsigned int length;
+
+ length = read_4_bytes (abfd, stash->info_ptr);
+ stash->info_ptr += 4;
+
+ if (length > 0)
+ {
+ each = parse_comp_unit (abfd, stash->info_ptr,
+ stash->info_ptr + length);
+ stash->info_ptr += length;
+
+ if (each)
+ {
+ each->next_unit = stash->all_comp_units;
+ stash->all_comp_units = each;
+
+ if (comp_unit_contains_address (each, addr))
+ return comp_unit_find_nearest_line (each, addr,
+ filename_ptr,
+ functionname_ptr,
+ linenumber_ptr);
+ }
+ }
+ }
+
+ return false;
+}
+
+/* end of file */
diff --git a/contrib/binutils/bfd/ecoff.c b/contrib/binutils/bfd/ecoff.c
index a5e44a3..274baef 100644
--- a/contrib/binutils/bfd/ecoff.c
+++ b/contrib/binutils/bfd/ecoff.c
@@ -1,5 +1,6 @@
/* Generic ECOFF (Extended-COFF) routines.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@@ -3141,7 +3142,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
/* Ultrix appears to use as a hash table size the least power of two
greater than twice the number of entries. */
- for (hashlog = 0; (1 << hashlog) <= 2 * orl_count; hashlog++)
+ for (hashlog = 0; ((unsigned int) 1 << hashlog) <= 2 * orl_count; hashlog++)
;
hashsize = 1 << hashlog;
diff --git a/contrib/binutils/bfd/ecofflink.c b/contrib/binutils/bfd/ecofflink.c
index db18339..a120a2b 100644
--- a/contrib/binutils/bfd/ecofflink.c
+++ b/contrib/binutils/bfd/ecofflink.c
@@ -706,17 +706,18 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
struct string_hash_entry *fh;
/* We look up a string formed from the file name and the
- number of symbols. Sometimes an include file will
- conditionally define a typedef or something based on the
- order of include files. Using the number of symbols as a
- hash reduces the chance that we will merge symbol
- information that should not be merged. */
+ number of symbols and aux entries. Sometimes an include
+ file will conditionally define a typedef or something
+ based on the order of include files. Using the number of
+ symbols and aux entries as a hash reduces the chance that
+ we will merge symbol information that should not be
+ merged. */
name = input_debug->ss + fdr.issBase + fdr.rss;
lookup = (char *) bfd_malloc (strlen (name) + 20);
if (lookup == NULL)
return false;
- sprintf (lookup, "%s %lx", name, fdr.csym);
+ sprintf (lookup, "%s %lx %lx", name, fdr.csym, fdr.caux);
fh = string_hash_lookup (&ainfo->fdr_hash, lookup, true, true);
free (lookup);
diff --git a/contrib/binutils/bfd/elf-bfd.h b/contrib/binutils/bfd/elf-bfd.h
index ecee307..571998a 100644
--- a/contrib/binutils/bfd/elf-bfd.h
+++ b/contrib/binutils/bfd/elf-bfd.h
@@ -1,5 +1,5 @@
/* BFD back-end data structures for ELF files.
- Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -483,9 +483,15 @@ struct elf_backend_data
const struct elf_size_info *s;
+ /* offset of the _GLOBAL_OFFSET_TABLE_ symbol from the start of the
+ .got section */
+ bfd_vma got_symbol_offset;
+
unsigned want_got_plt : 1;
unsigned plt_readonly : 1;
unsigned want_plt_sym : 1;
+ unsigned plt_not_loaded : 1;
+ unsigned plt_alignment : 4;
};
/* Information stored for each BFD section in an ELF file. This
@@ -559,7 +565,7 @@ typedef struct elf_linker_section
bfd_vma max_hole_offset; /* maximum offset for the hole */
elf_linker_section_enum_t which; /* which section this is */
boolean hole_written_p; /* whether the hole has been initialized */
- int alignment; /* alignment for the section */
+ unsigned int alignment; /* alignment for the section */
flagword flags; /* flags to use to create the section */
} elf_linker_section_t;
@@ -651,6 +657,9 @@ struct elf_obj_tdata
find_nearest_line. */
struct mips_elf_find_line *find_line_info;
+ /* A place to stash dwarf2 info for this bfd. */
+ struct dwarf2_debug *dwarf2_find_line_info;
+
/* An array of stub sections indexed by symbol number, used by the
MIPS ELF linker. FIXME: We should figure out some way to only
include this field for a MIPS ELF target. */
@@ -660,10 +669,10 @@ struct elf_obj_tdata
boolean flags_init;
/* Number of symbol version definitions we are about to emit. */
- int cverdefs;
+ unsigned int cverdefs;
/* Number of symbol version references we are about to emit. */
- int cverrefs;
+ unsigned int cverrefs;
/* Symbol version definitions in external objects. */
Elf_Internal_Verdef *verdef;
@@ -964,6 +973,8 @@ extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs
#define bfd_elf32_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
#define bfd_elf64_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
+extern boolean _bfd_elf_close_and_cleanup PARAMS ((bfd *));
+
/* MIPS ELF specific routines. */
extern boolean _bfd_mips_elf_object_p PARAMS ((bfd *));
diff --git a/contrib/binutils/bfd/elf32-arc.c b/contrib/binutils/bfd/elf32-arc.c
new file mode 100644
index 0000000..81fafd5
--- /dev/null
+++ b/contrib/binutils/bfd/elf32-arc.c
@@ -0,0 +1,213 @@
+/* ARC-specific support for 32-bit ELF
+ Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
+ Contributed by Doug Evans (dje@cygnus.com).
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/arc.h"
+
+static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
+ PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+static void arc_info_to_howto_rel
+ PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
+static boolean arc_elf_object_p PARAMS ((bfd *));
+static void arc_elf_final_write_processing PARAMS ((bfd *, boolean));
+
+/* Try to minimize the amount of space occupied by relocation tables
+ on the ROM (not that the ROM won't be swamped by other ELF overhead). */
+#define USE_REL
+
+static reloc_howto_type elf_arc_howto_table[] =
+{
+ /* This reloc does nothing. */
+ HOWTO (R_ARC_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_ARC_NONE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A standard 32 bit relocation. */
+ HOWTO (R_ARC_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_ARC_32", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 26 bit absolute branch, right shifted by 2. */
+ HOWTO (R_ARC_B26, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARC_B26", /* name */
+ false, /* partial_inplace */
+ 0x00ffffff, /* src_mask */
+ 0x00ffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A relative 22 bit branch; bits 21-2 are stored in bits 26-7. */
+ HOWTO (R_ARC_B22_PCREL, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 22, /* bitsize */
+ true, /* pc_relative */
+ 7, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARC_B22_PCREL", /* name */
+ false, /* partial_inplace */
+ 0x07ffff80, /* src_mask */
+ 0x07ffff80, /* dst_mask */
+ true), /* pcrel_offset */
+
+};
+
+/* Map BFD reloc types to ARC ELF reloc types. */
+
+struct arc_reloc_map
+{
+ unsigned char bfd_reloc_val;
+ unsigned char elf_reloc_val;
+};
+
+static const struct arc_reloc_map arc_reloc_map[] =
+{
+ { BFD_RELOC_NONE, R_ARC_NONE, },
+ { BFD_RELOC_32, R_ARC_32 },
+ { BFD_RELOC_CTOR, R_ARC_32 },
+ { BFD_RELOC_ARC_B26, R_ARC_B26 },
+ { BFD_RELOC_ARC_B22_PCREL, R_ARC_B22_PCREL },
+};
+
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_type_lookup (abfd, code)
+ bfd *abfd;
+ bfd_reloc_code_real_type code;
+{
+ unsigned int i;
+
+ for (i = 0;
+ i < sizeof (arc_reloc_map) / sizeof (struct arc_reloc_map);
+ i++)
+ {
+ if (arc_reloc_map[i].bfd_reloc_val == code)
+ return &elf_arc_howto_table[arc_reloc_map[i].elf_reloc_val];
+ }
+
+ return NULL;
+}
+
+/* Set the howto pointer for an ARC ELF reloc. */
+
+static void
+arc_info_to_howto_rel (abfd, cache_ptr, dst)
+ bfd *abfd;
+ arelent *cache_ptr;
+ Elf32_Internal_Rel *dst;
+{
+ unsigned int r_type;
+
+ r_type = ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (r_type < (unsigned int) R_ARC_max);
+ cache_ptr->howto = &elf_arc_howto_table[r_type];
+}
+
+/* Set the right machine number for an ARC ELF file. */
+
+static boolean
+arc_elf_object_p (abfd)
+ bfd *abfd;
+{
+ int mach;
+ unsigned long arch = elf_elfheader (abfd)->e_flags & EF_ARC_MACH;
+
+ switch (arch)
+ {
+ case E_ARC_MACH_BASE:
+ mach = bfd_mach_arc_base;
+ break;
+ default:
+ /* Unknown cpu type. ??? What to do? */
+ return false;
+ }
+
+ (void) bfd_default_set_arch_mach (abfd, bfd_arch_arc, mach);
+ return true;
+}
+
+/* The final processing done just before writing out an ARC ELF object file.
+ This gets the ARC architecture right based on the machine number. */
+
+static void
+arc_elf_final_write_processing (abfd, linker)
+ bfd *abfd;
+ boolean linker;
+{
+ int mach;
+ unsigned long val;
+
+ switch (mach = bfd_get_mach (abfd))
+ {
+ case bfd_mach_arc_base:
+ val = E_ARC_MACH_BASE;
+ break;
+ default:
+ return;
+ }
+
+ elf_elfheader (abfd)->e_flags &=~ EF_ARC_MACH;
+ elf_elfheader (abfd)->e_flags |= val;
+}
+
+#define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec
+#define TARGET_LITTLE_NAME "elf32-littlearc"
+#define TARGET_BIG_SYM bfd_elf32_bigarc_vec
+#define TARGET_BIG_NAME "elf32-bigarc"
+#define ELF_ARCH bfd_arch_arc
+#define ELF_MACHINE_CODE EM_CYGNUS_ARC
+#define ELF_MAXPAGESIZE 0x1000
+
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel arc_info_to_howto_rel
+#define elf_backend_object_p arc_elf_object_p
+#define elf_backend_final_write_processing \
+ arc_elf_final_write_processing
+
+#include "elf32-target.h"
diff --git a/contrib/binutils/bfd/elf32-sh.c b/contrib/binutils/bfd/elf32-sh.c
index c65114c..7153803 100644
--- a/contrib/binutils/bfd/elf32-sh.c
+++ b/contrib/binutils/bfd/elf32-sh.c
@@ -1,5 +1,5 @@
/* Hitachi SH specific support for 32-bit ELF
- Copyright 1996 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -694,7 +694,7 @@ sh_elf_relax_section (abfd, sec, link_info, again)
continue;
}
- /* Read the local symbols. */
+ /* Read this BFD's symbols if we haven't done so already. */
if (extsyms == NULL)
{
if (symtab_hdr->contents != NULL)
@@ -702,15 +702,13 @@ sh_elf_relax_section (abfd, sec, link_info, again)
else
{
extsyms = ((Elf32_External_Sym *)
- bfd_malloc (symtab_hdr->sh_info
- * sizeof (Elf32_External_Sym)));
+ bfd_malloc (symtab_hdr->sh_size));
if (extsyms == NULL)
goto error_return;
free_extsyms = extsyms;
if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
- || (bfd_read (extsyms, sizeof (Elf32_External_Sym),
- symtab_hdr->sh_info, abfd)
- != (symtab_hdr->sh_info * sizeof (Elf32_External_Sym))))
+ || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd)
+ != symtab_hdr->sh_size))
goto error_return;
}
}
@@ -975,13 +973,13 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
{
Elf_Internal_Shdr *symtab_hdr;
Elf32_External_Sym *extsyms;
- int shndx;
+ int shndx, index;
bfd_byte *contents;
Elf_Internal_Rela *irel, *irelend;
Elf_Internal_Rela *irelalign;
bfd_vma toaddr;
Elf32_External_Sym *esym, *esymend;
- struct elf_link_hash_entry **sym_hash, **sym_hash_end;
+ struct elf_link_hash_entry *sym_hash;
asection *o;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -1029,11 +1027,12 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
/* Adjust all the relocs. */
for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
{
- bfd_vma nraddr, start, stop;
+ bfd_vma nraddr, stop;
+ bfd_vma start = 0;
int insn = 0;
Elf_Internal_Sym sym;
int off, adjust, oinsn;
- bfd_signed_vma voff;
+ bfd_signed_vma voff = 0;
boolean overflow;
/* Get the new reloc address. */
@@ -1051,7 +1050,8 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
&& irel->r_offset < addr + count
&& ELF32_R_TYPE (irel->r_info) != (int) R_SH_ALIGN
&& ELF32_R_TYPE (irel->r_info) != (int) R_SH_CODE
- && ELF32_R_TYPE (irel->r_info) != (int) R_SH_DATA)
+ && ELF32_R_TYPE (irel->r_info) != (int) R_SH_DATA
+ && ELF32_R_TYPE (irel->r_info) != (int) R_SH_LABEL)
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
(int) R_SH_NONE);
@@ -1325,7 +1325,7 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
}
}
- /* Adjust all the symbols. */
+ /* Adjust the local symbols defined in this section. */
esym = extsyms;
esymend = esym + symtab_hdr->sh_info;
for (; esym < esymend; esym++)
@@ -1343,19 +1343,23 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
}
}
- sym_hash = elf_sym_hashes (abfd);
- sym_hash_end = (sym_hash
- + (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
- - symtab_hdr->sh_info));
- for (; sym_hash < sym_hash_end; sym_hash++)
+ /* Now adjust the global symbols defined in this section. */
+ esym = extsyms + symtab_hdr->sh_info;
+ esymend = extsyms + (symtab_hdr->sh_size / sizeof (Elf32_External_Sym));
+ for (index = 0; esym < esymend; esym++, index++)
{
- if (((*sym_hash)->root.type == bfd_link_hash_defined
- || (*sym_hash)->root.type == bfd_link_hash_defweak)
- && (*sym_hash)->root.u.def.section == sec
- && (*sym_hash)->root.u.def.value > addr
- && (*sym_hash)->root.u.def.value < toaddr)
+ Elf_Internal_Sym isym;
+
+ bfd_elf32_swap_symbol_in (abfd, esym, &isym);
+ sym_hash = elf_sym_hashes (abfd)[index];
+ if (isym.st_shndx == shndx
+ && ((sym_hash)->root.type == bfd_link_hash_defined
+ || (sym_hash)->root.type == bfd_link_hash_defweak)
+ && (sym_hash)->root.u.def.section == sec
+ && (sym_hash)->root.u.def.value > addr
+ && (sym_hash)->root.u.def.value < toaddr)
{
- (*sym_hash)->root.u.def.value -= count;
+ (sym_hash)->root.u.def.value -= count;
}
}
@@ -1618,6 +1622,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_vma relocation;
bfd_reloc_status_type r;
+ r_symndx = ELF32_R_SYM (rel->r_info);
+
if (info->relocateable)
{
/* This is a relocateable link. We don't have to change
@@ -1659,8 +1665,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
howto = sh_elf_howto_table + r_type;
- r_symndx = ELF32_R_SYM (rel->r_info);
-
/* This is a final link. */
h = NULL;
sym = NULL;
diff --git a/contrib/binutils/bfd/elf32-v850.c b/contrib/binutils/bfd/elf32-v850.c
new file mode 100644
index 0000000..c66513a
--- /dev/null
+++ b/contrib/binutils/bfd/elf32-v850.c
@@ -0,0 +1,1785 @@
+/* V850-specific support for 32-bit ELF
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+
+
+/* XXX FIXME: This code is littered with 32bit int, 16bit short, 8bit char
+ dependencies. As is the gas & simulator code or the v850. */
+
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/v850.h"
+
+/* sign-extend a 24-bit number */
+#define SEXT24(x) ((((x) & 0xffffff) ^ (~ 0x7fffff)) + 0x800000)
+
+static reloc_howto_type *v850_elf_reloc_type_lookup
+ PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+static void v850_elf_info_to_howto_rel
+ PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
+static bfd_reloc_status_type v850_elf_reloc
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static boolean v850_elf_is_local_label_name PARAMS ((bfd *, const char *));
+static boolean v850_elf_relocate_section PARAMS((bfd *,
+ struct bfd_link_info *,
+ bfd *,
+ asection *,
+ bfd_byte *,
+ Elf_Internal_Rela *,
+ Elf_Internal_Sym *,
+ asection **));
+/* Try to minimize the amount of space occupied by relocation tables
+ on the ROM (not that the ROM won't be swamped by other ELF overhead). */
+#define USE_REL
+
+/* Note: It is REQUIRED that the 'type' value of each entry in this array
+ match the index of the entry in the array. */
+static reloc_howto_type v850_elf_howto_table[] =
+{
+ /* This reloc does nothing. */
+ HOWTO (R_V850_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_V850_NONE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A PC relative 9 bit branch. */
+ HOWTO (R_V850_9_PCREL, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_9_PCREL", /* name */
+ false, /* partial_inplace */
+ 0x00ffffff, /* src_mask */
+ 0x00ffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* A PC relative 22 bit branch. */
+ HOWTO (R_V850_22_PCREL, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 22, /* bitsize */
+ true, /* pc_relative */
+ 7, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_22_PCREL", /* name */
+ false, /* partial_inplace */
+ 0x07ffff80, /* src_mask */
+ 0x07ffff80, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* High 16 bits of symbol value. */
+ HOWTO (R_V850_HI16_S, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_HI16_S", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* High 16 bits of symbol value. */
+ HOWTO (R_V850_HI16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_HI16", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Low 16 bits of symbol value. */
+ HOWTO (R_V850_LO16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_LO16", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Simple 32bit reloc. */
+ HOWTO (R_V850_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Simple 16bit reloc. */
+ HOWTO (R_V850_16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_V850_16", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Simple 8bit reloc. */
+ HOWTO (R_V850_8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_V850_8", /* name */
+ true, /* partial_inplace */
+ 0xff, /* src_mask */
+ 0xff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit offset from the short data area pointer. */
+ HOWTO (R_V850_SDA_16_16_OFFSET, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_SDA_16_16_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 15 bit offset from the short data area pointer. */
+ HOWTO (R_V850_SDA_15_16_OFFSET, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_SDA_15_16_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0xfffe, /* src_mask */
+ 0xfffe, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit offset from the zero data area pointer. */
+ HOWTO (R_V850_ZDA_16_16_OFFSET, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_ZDA_16_16_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 15 bit offset from the zero data area pointer. */
+ HOWTO (R_V850_ZDA_15_16_OFFSET, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_ZDA_15_16_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0xfffe, /* src_mask */
+ 0xfffe, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 6 bit offset from the tiny data area pointer. */
+ HOWTO (R_V850_TDA_6_8_OFFSET, /* type */
+ 2, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_TDA_6_8_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0x7e, /* src_mask */
+ 0x7e, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 8 bit offset from the tiny data area pointer. */
+ HOWTO (R_V850_TDA_7_8_OFFSET, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_TDA_7_8_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0x7f, /* src_mask */
+ 0x7f, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 7 bit offset from the tiny data area pointer. */
+ HOWTO (R_V850_TDA_7_7_OFFSET, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 7, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_TDA_7_7_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0x7f, /* src_mask */
+ 0x7f, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit offset from the tiny data area pointer! */
+ HOWTO (R_V850_TDA_16_16_OFFSET, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_TDA_16_16_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xfff, /* dst_mask */
+ false), /* pcrel_offset */
+
+};
+
+/* Map BFD reloc types to V850 ELF reloc types. */
+
+struct v850_elf_reloc_map
+{
+ unsigned char bfd_reloc_val;
+ unsigned char elf_reloc_val;
+};
+
+static const struct v850_elf_reloc_map v850_elf_reloc_map[] =
+{
+ { BFD_RELOC_NONE, R_V850_NONE },
+ { BFD_RELOC_V850_9_PCREL, R_V850_9_PCREL },
+ { BFD_RELOC_V850_22_PCREL, R_V850_22_PCREL },
+ { BFD_RELOC_HI16_S, R_V850_HI16_S },
+ { BFD_RELOC_HI16, R_V850_HI16 },
+ { BFD_RELOC_LO16, R_V850_LO16 },
+ { BFD_RELOC_32, R_V850_32 },
+ { BFD_RELOC_16, R_V850_16 },
+ { BFD_RELOC_8, R_V850_8 },
+ { BFD_RELOC_V850_SDA_16_16_OFFSET, R_V850_SDA_16_16_OFFSET },
+ { BFD_RELOC_V850_SDA_15_16_OFFSET, R_V850_SDA_15_16_OFFSET },
+ { BFD_RELOC_V850_ZDA_16_16_OFFSET, R_V850_ZDA_16_16_OFFSET },
+ { BFD_RELOC_V850_ZDA_15_16_OFFSET, R_V850_ZDA_15_16_OFFSET },
+ { BFD_RELOC_V850_TDA_6_8_OFFSET, R_V850_TDA_6_8_OFFSET },
+ { BFD_RELOC_V850_TDA_7_8_OFFSET, R_V850_TDA_7_8_OFFSET },
+ { BFD_RELOC_V850_TDA_7_7_OFFSET, R_V850_TDA_7_7_OFFSET },
+ { BFD_RELOC_V850_TDA_16_16_OFFSET, R_V850_TDA_16_16_OFFSET },
+};
+
+
+/* Map a bfd relocation into the appropriate howto structure */
+static reloc_howto_type *
+v850_elf_reloc_type_lookup (abfd, code)
+ bfd * abfd;
+ bfd_reloc_code_real_type code;
+{
+ unsigned int i;
+
+ for (i = 0;
+ i < sizeof (v850_elf_reloc_map) / sizeof (struct v850_elf_reloc_map);
+ i++)
+ {
+ if (v850_elf_reloc_map[i].bfd_reloc_val == code)
+ {
+ BFD_ASSERT (v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val].type == v850_elf_reloc_map[i].elf_reloc_val);
+
+ return & v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val];
+ }
+ }
+
+ return NULL;
+}
+
+
+/* Set the howto pointer for an V850 ELF reloc. */
+static void
+v850_elf_info_to_howto_rel (abfd, cache_ptr, dst)
+ bfd * abfd;
+ arelent * cache_ptr;
+ Elf32_Internal_Rel * dst;
+{
+ unsigned int r_type;
+
+ r_type = ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (r_type < (unsigned int) R_V850_max);
+ cache_ptr->howto = &v850_elf_howto_table[r_type];
+}
+
+
+/* Look through the relocs for a section during the first phase, and
+ allocate space in the global offset table or procedure linkage
+ table. */
+
+static boolean
+v850_elf_check_relocs (abfd, info, sec, relocs)
+ bfd * abfd;
+ struct bfd_link_info * info;
+ asection * sec;
+ const Elf_Internal_Rela * relocs;
+{
+ boolean ret = true;
+ bfd *dynobj;
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ const Elf_Internal_Rela *rel;
+ const Elf_Internal_Rela *rel_end;
+ asection *sreloc;
+ enum v850_reloc_type r_type;
+ int other = 0;
+ const char *common = (const char *)0;
+
+ if (info->relocateable)
+ return true;
+
+#ifdef DEBUG
+ fprintf (stderr, "v850_elf_check_relocs called for section %s in %s\n",
+ bfd_get_section_name (abfd, sec),
+ bfd_get_filename (abfd));
+#endif
+
+ dynobj = elf_hash_table (info)->dynobj;
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ sreloc = NULL;
+
+ rel_end = relocs + sec->reloc_count;
+ for (rel = relocs; rel < rel_end; rel++)
+ {
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ h = NULL;
+ else
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+ r_type = (enum v850_reloc_type) ELF32_R_TYPE (rel->r_info);
+ switch (r_type)
+ {
+ default:
+ case R_V850_NONE:
+ case R_V850_9_PCREL:
+ case R_V850_22_PCREL:
+ case R_V850_HI16_S:
+ case R_V850_HI16:
+ case R_V850_LO16:
+ case R_V850_32:
+ case R_V850_16:
+ case R_V850_8:
+ break;
+
+ case R_V850_SDA_16_16_OFFSET:
+ case R_V850_SDA_15_16_OFFSET:
+ other = V850_OTHER_SDA;
+ common = ".scommon";
+ goto small_data_common;
+
+ case R_V850_ZDA_16_16_OFFSET:
+ case R_V850_ZDA_15_16_OFFSET:
+ other = V850_OTHER_ZDA;
+ common = ".zcommon";
+ goto small_data_common;
+
+ case R_V850_TDA_6_8_OFFSET:
+ case R_V850_TDA_7_8_OFFSET:
+ case R_V850_TDA_7_7_OFFSET:
+ case R_V850_TDA_16_16_OFFSET:
+ other = V850_OTHER_TDA;
+ common = ".tcommon";
+ /* fall through */
+
+#define V850_OTHER_MASK (V850_OTHER_TDA | V850_OTHER_SDA | V850_OTHER_ZDA)
+
+ small_data_common:
+ if (h)
+ {
+ h->other |= other; /* flag which type of relocation was used */
+ if ((h->other & V850_OTHER_MASK) != (other & V850_OTHER_MASK)
+ && (h->other & V850_OTHER_ERROR) == 0)
+ {
+ const char * msg;
+ static char buff[100]; /* XXX */
+
+ switch (h->other & V850_OTHER_MASK)
+ {
+ default:
+ msg = "cannot occupy in multiple small data regions";
+ break;
+ case V850_OTHER_SDA | V850_OTHER_ZDA | V850_OTHER_TDA:
+ msg = "can only be in one of the small, zero, and tiny data regions";
+ break;
+ case V850_OTHER_SDA | V850_OTHER_ZDA:
+ msg = "cannot be in both small and zero data regions simultaneously";
+ break;
+ case V850_OTHER_SDA | V850_OTHER_TDA:
+ msg = "cannot be in both small and tiny data regions simultaneously";
+ break;
+ case V850_OTHER_ZDA | V850_OTHER_TDA:
+ msg = "cannot be in both zero and tiny data regions simultaneously";
+ break;
+ }
+
+ sprintf (buff, "Variable '%s' %s", h->root.root.string, msg );
+ info->callbacks->warning (info, buff, h->root.root.string,
+ abfd, h->root.u.def.section, 0);
+
+ bfd_set_error (bfd_error_bad_value);
+ h->other |= V850_OTHER_ERROR;
+ ret = false;
+ }
+ }
+
+ if (h && h->root.type == bfd_link_hash_common
+ && h->root.u.c.p
+ && !strcmp (bfd_get_section_name (abfd, h->root.u.c.p->section), "COMMON"))
+ {
+ asection *section = h->root.u.c.p->section = bfd_make_section_old_way (abfd, common);
+ section->flags |= SEC_IS_COMMON;
+ }
+
+#ifdef DEBUG
+ fprintf (stderr, "v850_elf_check_relocs, found %s relocation for %s%s\n",
+ v850_elf_howto_table[ (int)r_type ].name,
+ (h && h->root.root.string) ? h->root.root.string : "<unknown>",
+ (h->root.type == bfd_link_hash_common) ? ", symbol is common" : "");
+#endif
+ break;
+ }
+ }
+
+ return ret;
+}
+
+typedef struct
+{
+ long addend;
+ bfd_byte * address;
+ unsigned long counter;
+}
+hi16s_location;
+
+static hi16s_location previous_hi16s[ 10 ]; /* XXX is this enough ? */
+static unsigned long hi16s_counter;
+
+static void
+remember_hi16s_reloc (addend, address)
+ long addend;
+ bfd_byte * address;
+{
+ hi16s_location * oldest = NULL;
+ int i;
+
+ /* Find a free slot. */
+ for (i = sizeof (previous_hi16s) / sizeof (previous_hi16s[0]); i--;)
+ {
+ hi16s_location * entry = previous_hi16s + i;
+
+ if (entry->addend == 0 && entry->address == 0)
+ {
+ /* Use this entry. */
+ oldest = entry;
+ break;
+ }
+
+ /* Remember the least recently added entry. */
+ if (oldest == NULL || oldest->counter > entry->counter)
+ oldest = entry;
+ }
+
+ oldest->addend = addend;
+ oldest->address = address;
+ oldest->counter = hi16s_counter ++;
+
+ /* Cope with wrap around of our counter. */
+ if (hi16s_counter == 0)
+ {
+ /* XXX - Assume that all counter entries differ only in their low 16 bits. */
+ for (i = sizeof (previous_hi16s) / sizeof (previous_hi16s[0]); i--;)
+ {
+ hi16s_location * entry = previous_hi16s + i;
+
+ entry->counter &= 0xffff;
+ }
+
+ hi16s_counter = 0x10000;
+ }
+
+ return;
+}
+
+static bfd_byte *
+find_remembered_hi16s_reloc (addend)
+ long addend;
+{
+ hi16s_location * match = NULL;
+ int i;
+
+ /* Search the table. Record the most recent entry that matches. */
+ for (i = sizeof (previous_hi16s) / sizeof (previous_hi16s[0]); i--;)
+ {
+ hi16s_location * entry = previous_hi16s + i;
+
+ if (entry->addend == addend)
+ {
+ if (match == NULL || match->counter < entry->counter)
+ match = entry;
+ }
+ }
+
+ if (match != NULL)
+ {
+ bfd_byte * addr;
+
+ /* Empty the table entry. */
+ match->addend = 0;
+
+ addr = match->address;
+ match->address = NULL;
+
+ return addr;
+ }
+
+ return NULL;
+}
+
+static bfd_reloc_status_type
+v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
+ bfd * abfd;
+ int r_type;
+ long addend;
+ bfd_byte * address;
+ boolean replace;
+{
+ unsigned long insn;
+
+ switch (r_type)
+ {
+ default:
+ /* fprintf (stderr, "reloc type %d not SUPPORTED\n", r_type ); */
+ return bfd_reloc_notsupported;
+
+ case R_V850_32:
+ if (! replace)
+ addend += bfd_get_32 (abfd, address);
+
+ bfd_put_32 (abfd, addend, address);
+ return bfd_reloc_ok;
+
+ case R_V850_22_PCREL:
+ if (addend > 0x1fffff || addend < -0x200000)
+ return bfd_reloc_overflow;
+
+ if ((addend % 2) != 0)
+ return bfd_reloc_dangerous;
+
+ insn = bfd_get_32 (abfd, address);
+ insn &= ~0xfffe003f;
+ insn |= (((addend & 0xfffe) << 16) | ((addend & 0x3f0000) >> 16));
+ bfd_put_32 (abfd, insn, address);
+ return bfd_reloc_ok;
+
+ case R_V850_9_PCREL:
+ if (addend > 0xff || addend < -0x100)
+ return bfd_reloc_overflow;
+
+ if ((addend % 2) != 0)
+ return bfd_reloc_dangerous;
+
+ insn = bfd_get_16 (abfd, address);
+ insn &= ~ 0xf870;
+ insn |= ((addend & 0x1f0) << 7) | ((addend & 0x0e) << 3);
+ break;
+
+ case R_V850_HI16:
+ addend += (bfd_get_16 (abfd, address) << 16);
+ addend = (addend >> 16);
+ insn = addend;
+ break;
+
+ case R_V850_HI16_S:
+ /* Remember where this relocation took place. */
+ remember_hi16s_reloc (addend, address);
+
+ addend += (bfd_get_16 (abfd, address) << 16);
+ addend = (addend >> 16) + ((addend & 0x8000) != 0);
+
+ /* This relocation cannot overflow. */
+ if (addend > 0x7fff || addend < -0x8000)
+ addend = 0;
+
+ insn = addend;
+ break;
+
+ case R_V850_LO16:
+ /* Calculate the sum of the value stored in the instruction and the
+ addend and check for overflow from the low 16 bits into the high
+ 16 bits. The assembler has already done some of this: If the
+ value stored in the instruction has its 15th bit set, (counting
+ from zero) then the assembler will have added 1 to the value
+ stored in the associated HI16S reloc. So for example, these
+ relocations:
+
+ movhi hi( fred ), r0, r1
+ movea lo( fred ), r1, r1
+
+ will store 0 in the value fields for the MOVHI and MOVEA instructions
+ and addend will be the address of fred, but for these instructions:
+
+ movhi hi( fred + 0x123456), r0, r1
+ movea lo( fred + 0x123456), r1, r1
+
+ the value stored in the MOVHI instruction will be 0x12 and the value
+ stored in the MOVEA instruction will be 0x3456. If however the
+ instructions were:
+
+ movhi hi( fred + 0x10ffff), r0, r1
+ movea lo( fred + 0x10ffff), r1, r1
+
+ then the value stored in the MOVHI instruction would be 0x11 (not
+ 0x10) and the value stored in the MOVEA instruction would be 0xffff.
+ Thus (assuming for the moment that the addend is 0), at run time the
+ MOVHI instruction loads 0x110000 into r1, then the MOVEA instruction
+ adds 0xffffffff (sign extension!) producing 0x10ffff. Similarly if
+ the instructions were:
+
+ movhi hi( fred - 1), r0, r1
+ movea lo( fred - 1), r1, r1
+
+ then 0 is stored in the MOVHI instruction and -1 is stored in the
+ MOVEA instruction.
+
+ Overflow can occur if the addition of the value stored in the
+ instruction plus the addend sets the 15th bit when before it was clear.
+ This is because the 15th bit will be sign extended into the high part,
+ thus reducing its value by one, but since the 15th bit was originally
+ clear, the assembler will not have added 1 to the previous HI16S reloc
+ to compensate for this effect. For example:
+
+ movhi hi( fred + 0x123456), r0, r1
+ movea lo( fred + 0x123456), r1, r1
+
+ The value stored in HI16S reloc is 0x12, the value stored in the LO16
+ reloc is 0x3456. If we assume that the address of fred is 0x00007000
+ then the relocations become:
+
+ HI16S: 0x0012 + (0x00007000 >> 16) = 0x12
+ LO16: 0x3456 + (0x00007000 & 0xffff) = 0xa456
+
+ but when the instructions are executed, the MOVEA instruction's value
+ is signed extended, so the sum becomes:
+
+ 0x00120000
+ + 0xffffa456
+ ------------
+ 0x0011a456 but 'fred + 0x123456' = 0x0012a456
+
+ Note that if the 15th bit was set in the value stored in the LO16
+ reloc, then we do not have to do anything:
+
+ movhi hi( fred + 0x10ffff), r0, r1
+ movea lo( fred + 0x10ffff), r1, r1
+
+ HI16S: 0x0011 + (0x00007000 >> 16) = 0x11
+ LO16: 0xffff + (0x00007000 & 0xffff) = 0x6fff
+
+ 0x00110000
+ + 0x00006fff
+ ------------
+ 0x00116fff = fred + 0x10ffff = 0x7000 + 0x10ffff
+
+
+ Overflow can also occur if the computation carries into the 16th bit
+ and it also results in the 15th bit having the same value as the 15th
+ bit of the original value. What happens is that the HI16S reloc
+ will have already examined the 15th bit of the original value and
+ added 1 to the high part if the bit is set. This compensates for the
+ sign extension of 15th bit of the result of the computation. But now
+ there is a carry into the 16th bit, and this has not been allowed for.
+
+ So, for example if fred is at address 0xf000:
+
+ movhi hi( fred + 0xffff), r0, r1 [bit 15 of the offset is set]
+ movea lo( fred + 0xffff), r1, r1
+
+ HI16S: 0x0001 + (0x0000f000 >> 16) = 0x0001
+ LO16: 0xffff + (0x0000f000 & 0xffff) = 0xefff (carry into bit 16 is lost)
+
+ 0x00010000
+ + 0xffffefff
+ ------------
+ 0x0000efff but 'fred + 0xffff' = 0x0001efff
+
+ Similarly, if the 15th bit remains clear, but overflow occurs into
+ the 16th bit then (assuming the address of fred is 0xf000):
+
+ movhi hi( fred + 0x7000), r0, r1 [bit 15 of the offset is clear]
+ movea lo( fred + 0x7000), r1, r1
+
+ HI16S: 0x0000 + (0x0000f000 >> 16) = 0x0000
+ LO16: 0x7000 + (0x0000f000 & 0xffff) = 0x6fff (carry into bit 16 is lost)
+
+ 0x00000000
+ + 0x00006fff
+ ------------
+ 0x00006fff but 'fred + 0x7000' = 0x00016fff
+
+ Note - there is no need to change anything if a carry occurs, and the
+ 15th bit changes its value from being set to being clear, as the HI16S
+ reloc will have already added in 1 to the high part for us:
+
+ movhi hi( fred + 0xffff), r0, r1 [bit 15 of the offset is set]
+ movea lo( fred + 0xffff), r1, r1
+
+ HI16S: 0x0001 + (0x00007000 >> 16)
+ LO16: 0xffff + (0x00007000 & 0xffff) = 0x6fff (carry into bit 16 is lost)
+
+ 0x00010000
+ + 0x00006fff (bit 15 not set, so the top half is zero)
+ ------------
+ 0x00016fff which is right (assuming that fred is at 0x7000)
+
+ but if the 15th bit goes from being clear to being set, then we must
+ once again handle overflow:
+
+ movhi hi( fred + 0x7000), r0, r1 [bit 15 of the offset is clear]
+ movea lo( fred + 0x7000), r1, r1
+
+ HI16S: 0x0000 + (0x0000ffff >> 16)
+ LO16: 0x7000 + (0x0000ffff & 0xffff) = 0x6fff (carry into bit 16)
+
+ 0x00000000
+ + 0x00006fff (bit 15 not set, so the top half is zero)
+ ------------
+ 0x00006fff which is wrong (assuming that fred is at 0xffff)
+ */
+
+ {
+ long result;
+
+ insn = bfd_get_16 (abfd, address);
+ result = insn + addend;
+
+#define BIT15_SET(x) ((x) & 0x8000)
+#define OVERFLOWS(a,i) ((((a) & 0xffff) + (i)) > 0xffff)
+
+ if ((BIT15_SET (result) && ! BIT15_SET (addend))
+ || (OVERFLOWS (addend, insn)
+ && ((! BIT15_SET (insn)) || (BIT15_SET (addend)))))
+ {
+ bfd_byte * hi16s_address = find_remembered_hi16s_reloc (addend);
+
+ /* Amend the matching HI16_S relocation. */
+ if (hi16s_address != NULL)
+ {
+ insn = bfd_get_16 (abfd, hi16s_address);
+ insn += 1;
+ bfd_put_16 (abfd, insn, hi16s_address);
+ }
+ else
+ {
+ fprintf (stderr, "FAILED to find previous HI16 reloc\n");
+ return bfd_reloc_overflow;
+ }
+ }
+
+ /* Do not complain if value has top bit set, as this has been anticipated. */
+ insn = result & 0xffff;
+ break;
+ }
+
+ case R_V850_8:
+ if (! replace)
+ addend += (char) bfd_get_8 (abfd, address);
+
+ if (addend > 0x7f || addend < -0x80)
+ return bfd_reloc_overflow;
+
+ bfd_put_8 (abfd, addend, address);
+ return bfd_reloc_ok;
+
+
+ case R_V850_16:
+ replace = false;
+ /* drop through */
+ case R_V850_SDA_16_16_OFFSET:
+ case R_V850_ZDA_16_16_OFFSET:
+ case R_V850_TDA_16_16_OFFSET:
+ if (! replace)
+ addend += bfd_get_16 (abfd, address);
+
+ if (addend > 0x7fff || addend < -0x8000)
+ return bfd_reloc_overflow;
+
+ insn = addend;
+ break;
+
+ case R_V850_SDA_15_16_OFFSET:
+ case R_V850_ZDA_15_16_OFFSET:
+ insn = bfd_get_16 (abfd, address);
+
+ if (! replace)
+ addend += (insn & 0xfffe);
+
+ if (addend > 0x7ffe || addend < -0x8000)
+ return bfd_reloc_overflow;
+
+ if (addend & 1)
+ return bfd_reloc_dangerous;
+
+ insn = (addend & ~1) | (insn & 1);
+ break;
+
+ case R_V850_TDA_6_8_OFFSET:
+ insn = bfd_get_16 (abfd, address);
+
+ if (! replace)
+ addend += ((insn & 0x7e) << 1);
+
+ if (addend > 0xfc || addend < 0)
+ return bfd_reloc_overflow;
+
+ if (addend & 3)
+ return bfd_reloc_dangerous;
+
+ insn &= 0xff81;
+ insn |= (addend >> 1);
+ break;
+
+ case R_V850_TDA_7_8_OFFSET:
+ insn = bfd_get_16 (abfd, address);
+
+ if (! replace)
+ addend += ((insn & 0x7f) << 1);
+
+ if (addend > 0xfe || addend < 0)
+ return bfd_reloc_overflow;
+
+ if (addend & 1)
+ return bfd_reloc_dangerous;
+
+ insn &= 0xff80;
+ insn |= (addend >> 1);
+ break;
+
+ case R_V850_TDA_7_7_OFFSET:
+ insn = bfd_get_16 (abfd, address);
+
+ if (! replace)
+ addend += insn & 0x7f;
+
+ if (addend > 0x7f || addend < 0)
+ return bfd_reloc_overflow;
+
+ insn &= 0xff80;
+ insn |= addend;
+ break;
+
+ }
+
+ bfd_put_16 (abfd, insn, address);
+ return bfd_reloc_ok;
+}
+
+
+/* Insert the addend into the instruction. */
+static bfd_reloc_status_type
+v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err)
+ bfd * abfd;
+ arelent * reloc;
+ asymbol * symbol;
+ PTR data;
+ asection * isection;
+ bfd * obfd;
+ char ** err;
+{
+ long relocation;
+
+ /* If there is an output BFD,
+ and the symbol is not a section name (which is only defined at final link time),
+ and either we are not putting the addend into the instruction
+ or the addend is zero, so there is nothing to add into the instruction
+ then just fixup the address and return. */
+ if (obfd != (bfd *) NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (! reloc->howto->partial_inplace
+ || reloc->addend == 0))
+ {
+ reloc->address += isection->output_offset;
+ return bfd_reloc_ok;
+ }
+#if 0
+ else if (obfd != NULL)
+ {
+ return bfd_reloc_continue;
+ }
+#endif
+
+ /* Catch relocs involving undefined symbols. */
+ if (bfd_is_und_section (symbol->section)
+ && (symbol->flags & BSF_WEAK) == 0
+ && obfd == NULL)
+ return bfd_reloc_undefined;
+
+ /* We handle final linking of some relocs ourselves. */
+
+ /* Is the address of the relocation really within the section? */
+ if (reloc->address > isection->_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;
+
+ /* Convert input-section-relative symbol value to absolute + addend. */
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc->addend;
+
+ if (reloc->howto->pc_relative == true)
+ {
+ /* Here the variable relocation holds the final address of the
+ symbol we are relocating against, plus any addend. */
+ relocation -= isection->output_section->vma + isection->output_offset;
+
+ /* Deal with pcrel_offset */
+ relocation -= reloc->address;
+ }
+
+ /* I've got no clue... */
+ reloc->addend = 0;
+
+ return v850_elf_store_addend_in_insn (abfd, reloc->howto->type, relocation,
+ (bfd_byte *) data + reloc->address, true);
+}
+
+
+/*ARGSUSED*/
+static boolean
+v850_elf_is_local_label_name (abfd, name)
+ bfd * abfd;
+ const char * name;
+{
+ return ( (name[0] == '.' && (name[1] == 'L' || name[1] == '.'))
+ || (name[0] == '_' && name[1] == '.' && name[2] == 'L' && name[3] == '_'));
+}
+
+
+/* Perform a relocation as part of a final link. */
+static bfd_reloc_status_type
+v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
+ input_section, contents, offset, value,
+ addend, info, sym_sec, is_local)
+ reloc_howto_type * howto;
+ bfd * input_bfd;
+ bfd * output_bfd;
+ asection * input_section;
+ bfd_byte * contents;
+ bfd_vma offset;
+ bfd_vma value;
+ bfd_vma addend;
+ struct bfd_link_info * info;
+ asection * sym_sec;
+ int is_local;
+{
+ unsigned long r_type = howto->type;
+ bfd_byte * hit_data = contents + offset;
+
+ /* Adjust the value according to the relocation. */
+ switch (r_type)
+ {
+ case R_V850_9_PCREL:
+ value -= (input_section->output_section->vma
+ + input_section->output_offset);
+ value -= offset;
+ break;
+
+ case R_V850_22_PCREL:
+ value -= (input_section->output_section->vma
+ + input_section->output_offset
+ + offset);
+
+ value = SEXT24 (value); /* Only the bottom 24 bits of the PC are valid */
+ break;
+
+ case R_V850_HI16_S:
+ case R_V850_HI16:
+ case R_V850_LO16:
+ case R_V850_16:
+ case R_V850_32:
+ case R_V850_8:
+ break;
+
+ case R_V850_ZDA_15_16_OFFSET:
+ case R_V850_ZDA_16_16_OFFSET:
+ if (sym_sec == NULL)
+ return bfd_reloc_undefined;
+
+ value -= sym_sec->output_section->vma;
+ break;
+
+ case R_V850_SDA_15_16_OFFSET:
+ case R_V850_SDA_16_16_OFFSET:
+ {
+ unsigned long gp;
+ struct bfd_link_hash_entry * h;
+
+ if (sym_sec == NULL)
+ return bfd_reloc_undefined;
+
+ /* Get the value of __gp. */
+ h = bfd_link_hash_lookup (info->hash, "__gp", false, false, true);
+ if (h == (struct bfd_link_hash_entry *) NULL
+ || h->type != bfd_link_hash_defined)
+ return bfd_reloc_other;
+
+ gp = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+
+ value -= sym_sec->output_section->vma;
+ value -= (gp - sym_sec->output_section->vma);
+ }
+ break;
+
+ case R_V850_TDA_16_16_OFFSET:
+ case R_V850_TDA_7_7_OFFSET:
+ case R_V850_TDA_7_8_OFFSET:
+ case R_V850_TDA_6_8_OFFSET:
+ {
+ unsigned long ep;
+ struct bfd_link_hash_entry * h;
+
+ /* Get the value of __ep. */
+ h = bfd_link_hash_lookup (info->hash, "__ep", false, false, true);
+ if (h == (struct bfd_link_hash_entry *) NULL
+ || h->type != bfd_link_hash_defined)
+ return bfd_reloc_continue; /* Actually this indicates that __ep could not be found. */
+
+ ep = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+
+ value -= ep;
+ }
+ break;
+
+
+ case R_V850_NONE:
+ return bfd_reloc_ok;
+
+ default:
+ return bfd_reloc_notsupported;
+ }
+
+ /* Perform the relocation. */
+ return v850_elf_store_addend_in_insn (input_bfd, r_type, value, hit_data, false);
+}
+
+
+/* Relocate an V850 ELF section. */
+static boolean
+v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, local_syms, local_sections)
+ bfd * output_bfd;
+ struct bfd_link_info * info;
+ bfd * input_bfd;
+ asection * input_section;
+ bfd_byte * contents;
+ Elf_Internal_Rela * relocs;
+ Elf_Internal_Sym * local_syms;
+ asection ** local_sections;
+{
+ Elf_Internal_Shdr * symtab_hdr;
+ 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);
+
+ rel = relocs;
+ relend = relocs + input_section->reloc_count;
+ for (; rel < relend; rel++)
+ {
+ int r_type;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
+ struct elf_link_hash_entry * h;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ r_type = ELF32_R_TYPE (rel->r_info);
+ howto = v850_elf_howto_table + r_type;
+
+ if (info->relocateable)
+ {
+ /* This is a relocateable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ sec = local_sections[r_symndx];
+#ifdef USE_REL
+ /* The Elf_Internal_Rel structure does not have space for the
+ modified addend value, so we store it in the instruction
+ instead. */
+
+ if (sec->output_offset + sym->st_value != 0)
+ {
+ if (v850_elf_store_addend_in_insn (input_bfd, r_type,
+ sec->output_offset +
+ sym->st_value,
+ contents + rel->r_offset,
+ false)
+ != bfd_reloc_ok)
+ {
+ info->callbacks->warning
+ (info,
+ "Unable to handle relocation during incremental link",
+ NULL, input_bfd, input_section, rel->r_offset);
+ }
+ }
+#else
+ rel->r_addend += sec->output_offset + sym->st_value;
+#endif
+ }
+ }
+
+ continue;
+ }
+
+ /* This is a final link. */
+ h = NULL;
+ sym = NULL;
+ sec = NULL;
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ relocation = (sec->output_section->vma
+ + sec->output_offset
+ + sym->st_value);
+#if 0
+ {
+ char * name;
+ name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name);
+ name = (name == NULL) ? "<none>" : name;
+fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n",
+ sec->name, name, sym->st_name,
+ sec->output_section->vma, sec->output_offset, sym->st_value, rel->r_addend);
+ }
+#endif
+ }
+ else
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ sec = h->root.u.def.section;
+ relocation = (h->root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+#if 0
+fprintf (stderr, "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n",
+ sec->name, h->root.root.string, h->root.u.def.value, sec->output_section->vma, sec->output_offset, relocation);
+#endif
+ }
+ else if (h->root.type == bfd_link_hash_undefweak)
+ {
+#if 0
+fprintf (stderr, "undefined: sec: %s, name: %s\n",
+ sec->name, h->root.root.string);
+#endif
+ relocation = 0;
+ }
+ else
+ {
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd,
+ input_section, rel->r_offset)))
+ return false;
+#if 0
+fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
+#endif
+ relocation = 0;
+ }
+ }
+
+ /* FIXME: We should use the addend, but the COFF relocations
+ don't. */
+ r = v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
+ input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend,
+ info, sec, h == NULL);
+
+ if (r != bfd_reloc_ok)
+ {
+ const char * name;
+ const char * msg = (const char *)0;
+
+ if (h != NULL)
+ name = h->root.root.string;
+ else
+ {
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name));
+ if (name == NULL || *name == '\0')
+ name = bfd_section_name (input_bfd, sec);
+ }
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
+ if (! ((*info->callbacks->reloc_overflow)
+ (info, name, howto->name, (bfd_vma) 0,
+ input_bfd, input_section, rel->r_offset)))
+ return false;
+ break;
+
+ case bfd_reloc_undefined:
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, name, input_bfd, input_section,
+ rel->r_offset)))
+ return false;
+ break;
+
+ case bfd_reloc_outofrange:
+ msg = "internal error: out of range error";
+ goto common_error;
+
+ case bfd_reloc_notsupported:
+ msg = "internal error: unsupported relocation error";
+ goto common_error;
+
+ case bfd_reloc_dangerous:
+ msg = "internal error: dangerous relocation";
+ goto common_error;
+
+ case bfd_reloc_other:
+ msg = "could not locate special linker symbol __gp";
+ goto common_error;
+
+ case bfd_reloc_continue:
+ msg = "could not locate special linker symbol __ep";
+ goto common_error;
+
+ case (bfd_reloc_dangerous + 1):
+ msg = "could not locate special linker symbol __ctbp";
+ goto common_error;
+
+ default:
+ msg = "internal error: unknown error";
+ /* fall through */
+
+ common_error:
+ if (!((*info->callbacks->warning)
+ (info, msg, name, input_bfd, input_section,
+ rel->r_offset)))
+ return false;
+ break;
+ }
+ }
+ }
+
+ return true;
+}
+
+/* Set the right machine number. */
+static boolean
+v850_elf_object_p (abfd)
+ bfd *abfd;
+{
+ switch (elf_elfheader (abfd)->e_flags & EF_V850_ARCH)
+ {
+ default:
+ case E_V850_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, 0); break;
+ }
+ return true;
+}
+
+/* Store the machine number in the flags field. */
+void
+v850_elf_final_write_processing (abfd, linker)
+ bfd * abfd;
+ boolean linker;
+{
+ unsigned long val;
+
+ switch (bfd_get_mach (abfd))
+ {
+ default:
+ case 0: val = E_V850_ARCH; break;
+ }
+
+ elf_elfheader (abfd)->e_flags &=~ EF_V850_ARCH;
+ elf_elfheader (abfd)->e_flags |= val;
+}
+
+/* Function to keep V850 specific file flags. */
+boolean
+v850_elf_set_private_flags (abfd, flags)
+ bfd * abfd;
+ flagword flags;
+{
+ BFD_ASSERT (!elf_flags_init (abfd)
+ || elf_elfheader (abfd)->e_flags == flags);
+
+ elf_elfheader (abfd)->e_flags = flags;
+ elf_flags_init (abfd) = true;
+ return true;
+}
+
+/* Copy backend specific data from one object module to another */
+boolean
+v850_elf_copy_private_bfd_data (ibfd, obfd)
+ bfd * ibfd;
+ bfd * obfd;
+{
+ if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return true;
+
+ BFD_ASSERT (!elf_flags_init (obfd)
+ || (elf_elfheader (obfd)->e_flags
+ == elf_elfheader (ibfd)->e_flags));
+
+ elf_gp (obfd) = elf_gp (ibfd);
+ elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
+ elf_flags_init (obfd) = true;
+ return true;
+}
+
+/* Merge backend specific data from an object file to the output
+ object file when linking. */
+boolean
+v850_elf_merge_private_bfd_data (ibfd, obfd)
+ bfd * ibfd;
+ bfd * obfd;
+{
+ flagword out_flags;
+ flagword in_flags;
+
+ if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return true;
+
+ in_flags = elf_elfheader (ibfd)->e_flags;
+ out_flags = elf_elfheader (obfd)->e_flags;
+
+ if (! elf_flags_init (obfd))
+ {
+ /* If the input is the default architecture then do not
+ bother setting the flags for the output architecture,
+ instead allow future merges to do this. If no future
+ merges ever set these flags then they will retain their
+ unitialised values, which surprise surprise, correspond
+ to the default values. */
+ if (bfd_get_arch_info (ibfd)->the_default)
+ return true;
+
+ elf_flags_init (obfd) = true;
+ elf_elfheader (obfd)->e_flags = in_flags;
+
+ if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
+ && bfd_get_arch_info (obfd)->the_default)
+ {
+ return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd));
+ }
+
+ return true;
+ }
+
+ /* Check flag compatibility. */
+ if (in_flags == out_flags)
+ return true;
+
+ if ((in_flags & EF_V850_ARCH) != (out_flags & EF_V850_ARCH)
+ && (in_flags & EF_V850_ARCH) != E_V850_ARCH)
+ _bfd_error_handler ("%s: Architecture mismatch with previous modules",
+ bfd_get_filename (ibfd));
+
+ return true;
+}
+/* Display the flags field */
+
+static boolean
+v850_elf_print_private_bfd_data (abfd, ptr)
+ bfd * abfd;
+ PTR ptr;
+{
+ FILE * file = (FILE *) ptr;
+
+ BFD_ASSERT (abfd != NULL && ptr != NULL)
+
+ fprintf (file, "private flags = %lx", elf_elfheader (abfd)->e_flags);
+
+ switch (elf_elfheader (abfd)->e_flags & EF_V850_ARCH)
+ {
+ default:
+ case E_V850_ARCH: fprintf (file, ": v850 architecture"); break;
+ }
+
+ fputc ('\n', file);
+
+ return true;
+}
+
+/* V850 ELF uses four common sections. One is the usual one, and the
+ others are for (small) objects in one of the special data areas:
+ small, tiny and zero. All the objects are kept together, and then
+ referenced via the gp register, the ep register or the r0 register
+ respectively, which yields smaller, faster assembler code. This
+ approach is copied from elf32-mips.c. */
+
+static asection v850_elf_scom_section;
+static asymbol v850_elf_scom_symbol;
+static asymbol * v850_elf_scom_symbol_ptr;
+static asection v850_elf_tcom_section;
+static asymbol v850_elf_tcom_symbol;
+static asymbol * v850_elf_tcom_symbol_ptr;
+static asection v850_elf_zcom_section;
+static asymbol v850_elf_zcom_symbol;
+static asymbol * v850_elf_zcom_symbol_ptr;
+
+
+/* Given a BFD section, try to locate the corresponding ELF section
+ index. */
+
+static boolean
+v850_elf_section_from_bfd_section (abfd, hdr, sec, retval)
+ bfd * abfd;
+ Elf32_Internal_Shdr * hdr;
+ asection * sec;
+ int * retval;
+{
+ if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
+ {
+ *retval = SHN_V850_SCOMMON;
+ return true;
+ }
+ if (strcmp (bfd_get_section_name (abfd, sec), ".tcommon") == 0)
+ {
+ *retval = SHN_V850_TCOMMON;
+ return true;
+ }
+ if (strcmp (bfd_get_section_name (abfd, sec), ".zcommon") == 0)
+ {
+ *retval = SHN_V850_ZCOMMON;
+ return true;
+ }
+ return false;
+}
+
+/* Handle the special V850 section numbers that a symbol may use. */
+
+static void
+v850_elf_symbol_processing (abfd, asym)
+ bfd * abfd;
+ asymbol * asym;
+{
+ elf_symbol_type * elfsym = (elf_symbol_type *) asym;
+
+ switch (elfsym->internal_elf_sym.st_shndx)
+ {
+ case SHN_V850_SCOMMON:
+ if (v850_elf_scom_section.name == NULL)
+ {
+ /* Initialize the small common section. */
+ v850_elf_scom_section.name = ".scommon";
+ v850_elf_scom_section.flags = SEC_IS_COMMON | SEC_ALLOC | SEC_DATA;
+ v850_elf_scom_section.output_section = & v850_elf_scom_section;
+ v850_elf_scom_section.symbol = & v850_elf_scom_symbol;
+ v850_elf_scom_section.symbol_ptr_ptr = & v850_elf_scom_symbol_ptr;
+ v850_elf_scom_symbol.name = ".scommon";
+ v850_elf_scom_symbol.flags = BSF_SECTION_SYM;
+ v850_elf_scom_symbol.section = & v850_elf_scom_section;
+ v850_elf_scom_symbol_ptr = & v850_elf_scom_symbol;
+ }
+ asym->section = & v850_elf_scom_section;
+ asym->value = elfsym->internal_elf_sym.st_size;
+ break;
+
+ case SHN_V850_TCOMMON:
+ if (v850_elf_tcom_section.name == NULL)
+ {
+ /* Initialize the tcommon section. */
+ v850_elf_tcom_section.name = ".tcommon";
+ v850_elf_tcom_section.flags = SEC_IS_COMMON;
+ v850_elf_tcom_section.output_section = & v850_elf_tcom_section;
+ v850_elf_tcom_section.symbol = & v850_elf_tcom_symbol;
+ v850_elf_tcom_section.symbol_ptr_ptr = & v850_elf_tcom_symbol_ptr;
+ v850_elf_tcom_symbol.name = ".tcommon";
+ v850_elf_tcom_symbol.flags = BSF_SECTION_SYM;
+ v850_elf_tcom_symbol.section = & v850_elf_tcom_section;
+ v850_elf_tcom_symbol_ptr = & v850_elf_tcom_symbol;
+ }
+ asym->section = & v850_elf_tcom_section;
+ asym->value = elfsym->internal_elf_sym.st_size;
+ break;
+
+ case SHN_V850_ZCOMMON:
+ if (v850_elf_zcom_section.name == NULL)
+ {
+ /* Initialize the zcommon section. */
+ v850_elf_zcom_section.name = ".zcommon";
+ v850_elf_zcom_section.flags = SEC_IS_COMMON;
+ v850_elf_zcom_section.output_section = & v850_elf_zcom_section;
+ v850_elf_zcom_section.symbol = & v850_elf_zcom_symbol;
+ v850_elf_zcom_section.symbol_ptr_ptr = & v850_elf_zcom_symbol_ptr;
+ v850_elf_zcom_symbol.name = ".zcommon";
+ v850_elf_zcom_symbol.flags = BSF_SECTION_SYM;
+ v850_elf_zcom_symbol.section = & v850_elf_zcom_section;
+ v850_elf_zcom_symbol_ptr = & v850_elf_zcom_symbol;
+ }
+ asym->section = & v850_elf_zcom_section;
+ asym->value = elfsym->internal_elf_sym.st_size;
+ break;
+ }
+}
+
+/* Hook called by the linker routine which adds symbols from an object
+ file. We must handle the special MIPS section numbers here. */
+
+/*ARGSUSED*/
+static boolean
+v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
+ bfd * abfd;
+ struct bfd_link_info * info;
+ const Elf_Internal_Sym * sym;
+ const char ** namep;
+ flagword * flagsp;
+ asection ** secp;
+ bfd_vma * valp;
+{
+ switch (sym->st_shndx)
+ {
+ case SHN_V850_SCOMMON:
+ *secp = bfd_make_section_old_way (abfd, ".scommon");
+ (*secp)->flags |= SEC_IS_COMMON;
+ *valp = sym->st_size;
+ break;
+
+ case SHN_V850_TCOMMON:
+ *secp = bfd_make_section_old_way (abfd, ".tcommon");
+ (*secp)->flags |= SEC_IS_COMMON;
+ *valp = sym->st_size;
+ break;
+
+ case SHN_V850_ZCOMMON:
+ *secp = bfd_make_section_old_way (abfd, ".zcommon");
+ (*secp)->flags |= SEC_IS_COMMON;
+ *valp = sym->st_size;
+ break;
+ }
+
+ return true;
+}
+
+/*ARGSIGNORED*/
+static boolean
+v850_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec)
+ bfd * abfd;
+ struct bfd_link_info * info;
+ const char * name;
+ Elf_Internal_Sym * sym;
+ asection * input_sec;
+{
+ /* If we see a common symbol, which implies a relocatable link, then
+ if a symbol was in a special common section in an input file, mark
+ it as a special common in the output file. */
+
+ if (sym->st_shndx == SHN_COMMON)
+ {
+ if (strcmp (input_sec->name, ".scommon") == 0)
+ sym->st_shndx = SHN_V850_SCOMMON;
+ else if (strcmp (input_sec->name, ".tcommon") == 0)
+ sym->st_shndx = SHN_V850_TCOMMON;
+ else if (strcmp (input_sec->name, ".zcommon") == 0)
+ sym->st_shndx = SHN_V850_ZCOMMON;
+ }
+
+ return true;
+}
+
+static boolean
+v850_elf_section_from_shdr (abfd, hdr, name)
+ bfd * abfd;
+ Elf_Internal_Shdr * hdr;
+ char * name;
+{
+ /* There ought to be a place to keep ELF backend specific flags, but
+ at the moment there isn't one. We just keep track of the
+ sections by their name, instead. */
+
+ if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
+ return false;
+
+ switch (hdr->sh_type)
+ {
+ case SHT_V850_SCOMMON:
+ case SHT_V850_TCOMMON:
+ case SHT_V850_ZCOMMON:
+ if (! bfd_set_section_flags (abfd, hdr->bfd_section,
+ (bfd_get_section_flags (abfd,
+ hdr->bfd_section)
+ | SEC_IS_COMMON)))
+ return false;
+ }
+
+ return true;
+}
+
+/* Set the correct type for a V850 ELF section. We do this by the
+ section name, which is a hack, but ought to work. */
+static boolean
+v850_elf_fake_sections (abfd, hdr, sec)
+ bfd * abfd;
+ Elf32_Internal_Shdr * hdr;
+ asection * sec;
+{
+ register const char * name;
+
+ name = bfd_get_section_name (abfd, sec);
+
+ if (strcmp (name, ".scommon") == 0)
+ {
+ hdr->sh_type = SHT_V850_SCOMMON;
+ }
+ else if (strcmp (name, ".tcommon") == 0)
+ {
+ hdr->sh_type = SHT_V850_TCOMMON;
+ }
+ else if (strcmp (name, ".zcommon") == 0)
+ hdr->sh_type = SHT_V850_ZCOMMON;
+
+ return true;
+}
+
+
+
+#define TARGET_LITTLE_SYM bfd_elf32_v850_vec
+#define TARGET_LITTLE_NAME "elf32-v850"
+#define ELF_ARCH bfd_arch_v850
+#define ELF_MACHINE_CODE EM_CYGNUS_V850
+#define ELF_MAXPAGESIZE 0x1000
+
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel v850_elf_info_to_howto_rel
+
+#define elf_backend_check_relocs v850_elf_check_relocs
+#define elf_backend_relocate_section v850_elf_relocate_section
+#define elf_backend_object_p v850_elf_object_p
+#define elf_backend_final_write_processing v850_elf_final_write_processing
+#define elf_backend_section_from_bfd_section v850_elf_section_from_bfd_section
+#define elf_backend_symbol_processing v850_elf_symbol_processing
+#define elf_backend_add_symbol_hook v850_elf_add_symbol_hook
+#define elf_backend_link_output_symbol_hook v850_elf_link_output_symbol_hook
+#define elf_backend_section_from_shdr v850_elf_section_from_shdr
+#define elf_backend_fake_sections v850_elf_fake_sections
+
+#define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name
+#define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup
+#define bfd_elf32_bfd_copy_private_bfd_data v850_elf_copy_private_bfd_data
+#define bfd_elf32_bfd_merge_private_bfd_data v850_elf_merge_private_bfd_data
+#define bfd_elf32_bfd_set_private_flags v850_elf_set_private_flags
+#define bfd_elf32_bfd_print_private_bfd_data v850_elf_print_private_bfd_data
+
+#define elf_symbol_leading_char '_'
+
+#include "elf32-target.h"
diff --git a/contrib/binutils/bfd/elf64-alpha.c b/contrib/binutils/bfd/elf64-alpha.c
index 2800272d..6d9c539 100644
--- a/contrib/binutils/bfd/elf64-alpha.c
+++ b/contrib/binutils/bfd/elf64-alpha.c
@@ -1,5 +1,5 @@
/* Alpha specific support for 64-bit ELF
- Copyright 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library.
@@ -555,7 +555,8 @@ static reloc_howto_type elf64_alpha_howto_table[] =
false), /* pcrel_offset */
/* Push a value on the reloc evaluation stack. */
- HOWTO (ALPHA_R_OP_PUSH, /* type */
+ /* Not implemented -- it's dumb. */
+ HOWTO (R_ALPHA_OP_PUSH, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */
@@ -571,7 +572,8 @@ static reloc_howto_type elf64_alpha_howto_table[] =
/* Store the value from the stack at the given address. Store it in
a bitfield of size r_size starting at bit position r_offset. */
- HOWTO (ALPHA_R_OP_STORE, /* type */
+ /* Not implemented -- it's dumb. */
+ HOWTO (R_ALPHA_OP_STORE, /* type */
0, /* rightshift */
4, /* size (0 = byte, 1 = short, 2 = long) */
64, /* bitsize */
@@ -587,7 +589,8 @@ static reloc_howto_type elf64_alpha_howto_table[] =
/* Subtract the reloc address from the value on the top of the
relocation stack. */
- HOWTO (ALPHA_R_OP_PSUB, /* type */
+ /* Not implemented -- it's dumb. */
+ HOWTO (R_ALPHA_OP_PSUB, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */
@@ -603,7 +606,8 @@ static reloc_howto_type elf64_alpha_howto_table[] =
/* Shift the value on the top of the relocation stack right by the
given value. */
- HOWTO (ALPHA_R_OP_PRSHIFT, /* type */
+ /* Not implemented -- it's dumb. */
+ HOWTO (R_ALPHA_OP_PRSHIFT, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */
@@ -617,7 +621,146 @@ static reloc_howto_type elf64_alpha_howto_table[] =
0, /* dst_mask */
false), /* pcrel_offset */
+ /* Change the value of GP used by +r_addend until the next GPVALUE or the
+ end of the input bfd. */
+ /* Not implemented -- it's dumb. */
+ HOWTO (R_ALPHA_GPVALUE,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ elf64_alpha_reloc_bad, /* special_function */
+ "GPVALUE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The high 16 bits of the displacement from GP to the target. */
+ /* XXX: Not implemented. */
+ HOWTO (R_ALPHA_GPRELHIGH,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ elf64_alpha_reloc_bad, /* special_function */
+ "GPRELHIGH", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The low 16 bits of the displacement from GP to the target. */
+ /* XXX: Not implemented. */
+ HOWTO (R_ALPHA_GPRELLOW,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ elf64_alpha_reloc_bad, /* special_function */
+ "GPRELLOW", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 16-bit displacement from the GP to the target. */
+ /* XXX: Not implemented. */
+ HOWTO (R_ALPHA_IMMED_GP_16,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ elf64_alpha_reloc_bad, /* special_function */
+ "IMMED_GP_16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The high bits of a 32-bit displacement from the GP to the target; the
+ low bits are supplied in the subsequent R_ALPHA_IMMED_LO32 relocs. */
+ /* XXX: Not implemented. */
+ HOWTO (R_ALPHA_IMMED_GP_HI32,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ elf64_alpha_reloc_bad, /* special_function */
+ "IMMED_GP_HI32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The high bits of a 32-bit displacement to the starting address of the
+ current section (the relocation target is ignored); the low bits are
+ supplied in the subsequent R_ALPHA_IMMED_LO32 relocs. */
+ /* XXX: Not implemented. */
+ HOWTO (R_ALPHA_IMMED_SCN_HI32,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ elf64_alpha_reloc_bad, /* special_function */
+ "IMMED_SCN_HI32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The high bits of a 32-bit displacement from the previous br, bsr, jsr
+ or jmp insn (as tagged by a BRADDR or HINT reloc) to the target; the
+ low bits are supplied by subsequent R_ALPHA_IMMED_LO32 relocs. */
+ /* XXX: Not implemented. */
+ HOWTO (R_ALPHA_IMMED_BR_HI32,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ elf64_alpha_reloc_bad, /* special_function */
+ "IMMED_BR_HI32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The low 16 bits of a displacement calculated in a previous HI32 reloc. */
+ /* XXX: Not implemented. */
+ HOWTO (R_ALPHA_IMMED_LO32,
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ elf64_alpha_reloc_bad, /* special_function */
+ "IMMED_LO32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
/* Misc ELF relocations. */
+
+ /* A dynamic relocation to copy the target into our .dynbss section. */
+ /* Not generated, as all Alpha objects use PIC, so it is not needed. It
+ is present because every other ELF has one, but should not be used
+ because .dynbss is an ugly thing. */
HOWTO (R_ALPHA_COPY,
0,
0,
@@ -632,6 +775,7 @@ static reloc_howto_type elf64_alpha_howto_table[] =
0,
true),
+ /* A dynamic relocation for a .got entry. */
HOWTO (R_ALPHA_GLOB_DAT,
0,
0,
@@ -646,6 +790,7 @@ static reloc_howto_type elf64_alpha_howto_table[] =
0,
true),
+ /* A dynamic relocation for a .plt entry. */
HOWTO (R_ALPHA_JMP_SLOT,
0,
0,
@@ -660,6 +805,7 @@ static reloc_howto_type elf64_alpha_howto_table[] =
0,
true),
+ /* A dynamic relocation to add the base of the DSO to a 64-bit field. */
HOWTO (R_ALPHA_RELATIVE,
0,
0,
@@ -866,9 +1012,9 @@ elf64_alpha_info_to_howto (abfd, cache_ptr, dst)
#define PLT_HEADER_WORD4 0x6b7b0000 /* jmp $27,($27) */
#define PLT_ENTRY_SIZE 12
-#define PLT_ENTRY_WORD1 0x279f0000 /* ldah $28, 0($31) */
-#define PLT_ENTRY_WORD2 0x239c0000 /* lda $28, 0($28) */
-#define PLT_ENTRY_WORD3 0xc3e00000 /* br $31, plt0 */
+#define PLT_ENTRY_WORD1 0xc3800000 /* br $28, plt0 */
+#define PLT_ENTRY_WORD2 0
+#define PLT_ENTRY_WORD3 0
#define MAX_GOT_ENTRIES (64*1024 / 8)
@@ -1545,6 +1691,11 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+ while (h->root.root.type == bfd_link_hash_indirect
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
+
h->root.elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
}
r_type = ELF64_R_TYPE (rel->r_info);
@@ -1855,6 +2006,79 @@ elf64_alpha_adjust_dynamic_symbol (info, h)
return true;
}
+/* Symbol versioning can create new symbols, and make our old symbols
+ indirect to the new ones. Consolidate the got and reloc information
+ in these situations. */
+
+static boolean
+elf64_alpha_merge_ind_symbols (hi, dummy)
+ struct alpha_elf_link_hash_entry *hi;
+ PTR dummy;
+{
+ struct alpha_elf_link_hash_entry *hs;
+
+ if (hi->root.root.type != bfd_link_hash_indirect)
+ return true;
+ hs = hi;
+ do {
+ hs = (struct alpha_elf_link_hash_entry *)hs->root.root.u.i.link;
+ } while (hs->root.root.type == bfd_link_hash_indirect);
+
+ /* Merge the flags. Whee. */
+
+ hs->flags |= hi->flags;
+
+ /* Merge the .got entries. Cannibalize the old symbol's list in
+ doing so, since we don't need it anymore. */
+
+ if (hs->got_entries == NULL)
+ hs->got_entries = hi->got_entries;
+ else
+ {
+ struct alpha_elf_got_entry *gi, *gs, *gin, *gsh;
+
+ gsh = hs->got_entries;
+ for (gi = hi->got_entries; gi ; gi = gin)
+ {
+ gin = gi->next;
+ for (gs = gsh; gs ; gs = gs->next)
+ if (gi->gotobj == gs->gotobj && gi->addend == gs->addend )
+ goto got_found;
+ gi->next = hs->got_entries;
+ hs->got_entries = gi;
+ got_found:;
+ }
+ }
+ hi->got_entries = NULL;
+
+ /* And similar for the reloc entries. */
+
+ if (hs->reloc_entries == NULL)
+ hs->reloc_entries = hi->reloc_entries;
+ else
+ {
+ struct alpha_elf_reloc_entry *ri, *rs, *rin, *rsh;
+
+ rsh = hs->reloc_entries;
+ for (ri = hi->reloc_entries; ri ; ri = rin)
+ {
+ rin = ri->next;
+ for (rs = rsh; rs ; rs = rs->next)
+ if (ri->rtype == rs->rtype)
+ {
+ rs->count += ri->count;
+ goto found_reloc;
+ }
+ ri->next = hs->reloc_entries;
+ hs->reloc_entries = ri;
+ found_reloc:;
+ }
+ }
+ hi->reloc_entries = NULL;
+
+ return true;
+}
+
/* Is it possible to merge two object file's .got tables? */
static boolean
@@ -1883,12 +2107,19 @@ elf64_alpha_can_merge_gots (a, b)
for (i = 0; i < n; ++i)
{
struct alpha_elf_got_entry *ae, *be;
- for (be = hashes[i]->got_entries; be ; be = be->next)
+ struct alpha_elf_link_hash_entry *h;
+
+ h = hashes[i];
+ while (h->root.root.type == bfd_link_hash_indirect
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
+
+ for (be = h->got_entries; be ; be = be->next)
{
if (be->gotobj != b)
continue;
- for (ae = hashes[i]->got_entries; ae ; ae = ae->next)
+ for (ae = h->got_entries; ae ; ae = ae->next)
if (ae->gotobj == a && ae->addend == be->addend)
goto global_found;
@@ -1945,7 +2176,14 @@ elf64_alpha_merge_gots (a, b)
for (i = 0; i < n; ++i)
{
struct alpha_elf_got_entry *ae, *be, **pbe, **start;
- start = &hashes[i]->got_entries;
+ struct alpha_elf_link_hash_entry *h;
+
+ h = hashes[i];
+ while (h->root.root.type == bfd_link_hash_indirect
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
+
+ start = &h->got_entries;
for (pbe = start, be = *start; be ; pbe = &be->next, be = be->next)
{
if (be->gotobj != b)
@@ -2061,6 +2299,11 @@ elf64_alpha_always_size_sections (output_bfd, info)
if (info->relocateable)
return true;
+ /* First, take care of the indirect symbols created by versioning. */
+ alpha_elf_link_hash_traverse (alpha_elf_hash_table (info),
+ elf64_alpha_merge_ind_symbols,
+ NULL);
+
ngots = 0;
got_list = NULL;
cur_got_obj = NULL;
@@ -2162,8 +2405,10 @@ elf64_alpha_calc_dynrel_sizes (h, info)
}
/* If the symbol is dynamic, we'll need all the relocations in their
- natural form. */
- if (alpha_elf_dynamic_symbol_p (&h->root, info))
+ natural form. If it has been forced local, we'll need the same
+ number of RELATIVE relocations. */
+ if (alpha_elf_dynamic_symbol_p (&h->root, info)
+ || (info->shared && h->root.dynindx == -1))
{
struct alpha_elf_reloc_entry *relent;
@@ -2306,7 +2551,8 @@ elf64_alpha_size_dynamic_sections (output_bfd, info)
s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 5);
if (target != NULL
- && (target->flags & SEC_READONLY) != 0)
+ && (target->flags & SEC_READONLY) != 0
+ && (target->flags & SEC_ALLOC) != 0)
reltext = true;
if (strcmp(name, ".rela.plt") == 0)
@@ -2619,6 +2865,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (h != NULL)
{
gotent = h->got_entries;
+ BFD_ASSERT(gotent != NULL);
+
while (gotent->gotobj != gotobj || gotent->addend != addend)
gotent = gotent->next;
@@ -2628,8 +2876,26 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_put_64 (output_bfd, relocation+addend,
sgot->contents + gotent->got_offset);
- /* The dynamic relocations for the .got entries are
- done in finish_dynamic_symbol. */
+ /* If the symbol has been forced local, output a
+ RELATIVE reloc, otherwise it will be handled in
+ finish_dynamic_symbol. */
+ if (info->shared && h->root.dynindx == -1)
+ {
+ Elf_Internal_Rela outrel;
+
+ BFD_ASSERT(srelgot != NULL);
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + gotent->got_offset);
+ outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
+ outrel.r_addend = 0;
+
+ bfd_elf64_swap_reloca_out (output_bfd, &outrel,
+ ((Elf64_External_Rela *)
+ srelgot->contents)
+ + srelgot->reloc_count++);
+ }
gotent->flags |= ALPHA_ELF_GOT_ENTRY_RELOCS_DONE;
}
@@ -2851,16 +3117,10 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Fill in the entry in the procedure linkage table. */
{
unsigned insn1, insn2, insn3;
- long hi, lo;
-
- /* decompose the reloc offset for the plt for ldah+lda */
- hi = plt_index * sizeof(Elf64_External_Rela);
- lo = ((hi & 0xffff) ^ 0x8000) - 0x8000;
- hi = (hi - lo) >> 16;
- insn1 = PLT_ENTRY_WORD1 | (hi & 0xffff);
- insn2 = PLT_ENTRY_WORD2 | (lo & 0xffff);
- insn3 = PLT_ENTRY_WORD3 | ((-(h->plt_offset + 12) >> 2) & 0x1fffff);
+ insn1 = PLT_ENTRY_WORD1 | ((-(h->plt_offset + 4) >> 2) & 0x1fffff);
+ insn2 = PLT_ENTRY_WORD2;
+ insn3 = PLT_ENTRY_WORD3;
bfd_put_32 (output_bfd, insn1, splt->contents + h->plt_offset);
bfd_put_32 (output_bfd, insn2, splt->contents + h->plt_offset + 4);
@@ -3733,7 +3993,7 @@ elf64_alpha_ecoff_debug_swap =
#define TARGET_LITTLE_NAME "elf64-alpha"
#define ELF_ARCH bfd_arch_alpha
#define ELF_MACHINE_CODE EM_ALPHA
-#define ELF_MAXPAGESIZE 0x100000
+#define ELF_MAXPAGESIZE 0x10000
#define bfd_elf64_bfd_link_hash_table_create \
elf64_alpha_bfd_link_hash_table_create
diff --git a/contrib/binutils/bfd/elfcode.h b/contrib/binutils/bfd/elfcode.h
index 0443a32..4591e5f 100644
--- a/contrib/binutils/bfd/elfcode.h
+++ b/contrib/binutils/bfd/elfcode.h
@@ -1,5 +1,5 @@
/* ELF executable support for BFD.
- Copyright 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -176,11 +176,15 @@ static char *elf_symbol_flags PARAMS ((flagword));
can be handled by explicitly specifying 32 bits or "the long type". */
#if ARCH_SIZE == 64
#define put_word bfd_h_put_64
+#define put_signed_word bfd_h_put_signed_64
#define get_word bfd_h_get_64
+#define get_signed_word bfd_h_get_signed_64
#endif
#if ARCH_SIZE == 32
#define put_word bfd_h_put_32
+#define put_signed_word bfd_h_put_signed_32
#define get_word bfd_h_get_32
+#define get_signed_word bfd_h_get_signed_32
#endif
/* Translate an ELF symbol in external format into an ELF symbol in internal
@@ -372,7 +376,7 @@ elf_swap_reloca_in (abfd, src, dst)
{
dst->r_offset = get_word (abfd, (bfd_byte *) src->r_offset);
dst->r_info = get_word (abfd, (bfd_byte *) src->r_info);
- dst->r_addend = get_word (abfd, (bfd_byte *) src->r_addend);
+ dst->r_addend = get_signed_word (abfd, (bfd_byte *) src->r_addend);
}
/* Translate an ELF reloc from internal format to external format. */
@@ -394,7 +398,7 @@ elf_swap_reloca_out (abfd, src, dst)
{
put_word (abfd, src->r_offset, dst->r_offset);
put_word (abfd, src->r_info, dst->r_info);
- put_word (abfd, src->r_addend, dst->r_addend);
+ put_signed_word (abfd, src->r_addend, dst->r_addend);
}
INLINE void
@@ -926,7 +930,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
{
Elf_Internal_Shdr *hdr;
Elf_Internal_Shdr *verhdr;
- long symcount; /* Number of external ELF symbols */
+ unsigned long symcount; /* Number of external ELF symbols */
elf_symbol_type *sym; /* Pointer to current bfd symbol */
elf_symbol_type *symbase; /* Buffer for generated bfd symbols */
Elf_Internal_Sym i_sym;
@@ -974,7 +978,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
sym = symbase = NULL;
else
{
- long i;
+ unsigned long i;
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1)
return -1;
diff --git a/contrib/binutils/bfd/elfcore.h b/contrib/binutils/bfd/elfcore.h
index 77f683a..5bea812 100644
--- a/contrib/binutils/bfd/elfcore.h
+++ b/contrib/binutils/bfd/elfcore.h
@@ -35,7 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static boolean bfd_prstatus PARAMS ((bfd *, char *, int, long, int));
static boolean bfd_prpsinfo PARAMS ((bfd *, char *, int, long));
static boolean bfd_fpregset PARAMS ((bfd *, char *, int, long, int));
-static boolean elf_corefile_note PARAMS ((bfd *, Elf_Internal_Phdr *));
#else
#define bfd_prstatus(abfd, descdata, descsz, filepos, thread) true
@@ -44,6 +43,8 @@ static boolean elf_corefile_note PARAMS ((bfd *, Elf_Internal_Phdr *));
#define get_thread(STATUS) (1)
#endif
+static boolean elf_corefile_note PARAMS ((bfd *, Elf_Internal_Phdr *));
+
#ifdef HAVE_SYS_PROCFS_H
static int did_reg;
@@ -77,7 +78,7 @@ bfd_prstatus (abfd, descdata, descsz, filepos, thread)
newsect->_raw_size = sizeof (status->pr_reg);
newsect->filepos = filepos + (long) &status->pr_reg;
newsect->flags = SEC_HAS_CONTENTS;
- newsect->alignment_power = 2;
+ newsect->alignment_power = LOG_FILE_ALIGN;
if ((core_prstatus (abfd) = bfd_alloc (abfd, descsz)) != NULL)
{
memcpy (core_prstatus (abfd), descdata, descsz);
diff --git a/contrib/binutils/bfd/elflink.c b/contrib/binutils/bfd/elflink.c
index 7ca2b44..92e8d17 100644
--- a/contrib/binutils/bfd/elflink.c
+++ b/contrib/binutils/bfd/elflink.c
@@ -33,18 +33,26 @@ _bfd_elf_create_got_section (abfd, info)
register asection *s;
struct elf_link_hash_entry *h;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ int ptralign;
/* This function may be called more than once. */
if (bfd_get_section_by_name (abfd, ".got") != NULL)
return true;
+ switch (bed->s->arch_size)
+ {
+ case 32: ptralign = 2; break;
+ case 64: ptralign = 3; break;
+ default: abort();
+ }
+
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_LINKER_CREATED);
s = bfd_make_section (abfd, ".got");
if (s == NULL
|| !bfd_set_section_flags (abfd, s, flags)
- || !bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (abfd, s, ptralign))
return false;
if (bed->want_got_plt)
@@ -52,7 +60,7 @@ _bfd_elf_create_got_section (abfd, info)
s = bfd_make_section (abfd, ".got.plt");
if (s == NULL
|| !bfd_set_section_flags (abfd, s, flags)
- || !bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (abfd, s, ptralign))
return false;
}
@@ -62,9 +70,9 @@ _bfd_elf_create_got_section (abfd, info)
a global offset table. */
h = NULL;
if (!(_bfd_generic_link_add_one_symbol
- (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s, (bfd_vma) 0,
- (const char *) NULL, false, get_elf_backend_data (abfd)->collect,
- (struct bfd_link_hash_entry **) &h)))
+ (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
+ bed->got_symbol_offset, (const char *) NULL, false,
+ bed->collect, (struct bfd_link_hash_entry **) &h)))
return false;
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
h->type = STT_OBJECT;
@@ -75,8 +83,9 @@ _bfd_elf_create_got_section (abfd, info)
elf_hash_table (info)->hgot = h;
- /* The first three global offset table entries are reserved. */
- s->_raw_size += 3 * 4;
+ /* The first three global offset table entries after
+ '_GLOBAL_OFFSET_TABLE_' are reserved. */
+ s->_raw_size += (3 << ptralign) + bed->got_symbol_offset;
return true;
}
@@ -89,9 +98,17 @@ _bfd_elf_create_dynamic_sections (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
- flagword flags;
+ flagword flags, pltflags;
register asection *s;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ int ptralign;
+
+ switch (bed->s->arch_size)
+ {
+ case 32: ptralign = 2; break;
+ case 64: ptralign = 3; break;
+ default: abort();
+ }
/* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
.rel[a].bss sections. */
@@ -99,12 +116,17 @@ _bfd_elf_create_dynamic_sections (abfd, info)
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_LINKER_CREATED);
+ pltflags = flags;
+ pltflags |= SEC_CODE;
+ if (bed->plt_not_loaded)
+ pltflags &= ~ (SEC_LOAD | SEC_HAS_CONTENTS);
+ if (bed->plt_readonly)
+ pltflags |= SEC_READONLY;
+
s = bfd_make_section (abfd, ".plt");
if (s == NULL
- || ! bfd_set_section_flags (abfd, s,
- (flags | SEC_CODE
- | (bed->plt_readonly ? SEC_READONLY : 0)))
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || ! bfd_set_section_flags (abfd, s, pltflags)
+ || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
return false;
if (bed->want_plt_sym)
@@ -129,7 +151,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
s = bfd_make_section (abfd, bed->use_rela_p ? ".rela.plt" : ".rel.plt");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || ! bfd_set_section_alignment (abfd, s, ptralign))
return false;
if (! _bfd_elf_create_got_section (abfd, info))
@@ -162,7 +184,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
s = bfd_make_section (abfd, bed->use_rela_p ? ".rela.bss" : ".rel.bss");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || ! bfd_set_section_alignment (abfd, s, ptralign))
return false;
}
diff --git a/contrib/binutils/bfd/elflink.h b/contrib/binutils/bfd/elflink.h
index a6d06b1..21bd270 100644
--- a/contrib/binutils/bfd/elflink.h
+++ b/contrib/binutils/bfd/elflink.h
@@ -1,5 +1,5 @@
/* ELF linker support.
- Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -19,12 +19,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* ELF linker code. */
+/* This struct is used to pass information to routines called via
+ elf_link_hash_traverse which must return failure. */
+
+struct elf_info_failed
+{
+ boolean failed;
+ struct bfd_link_info *info;
+};
+
static boolean elf_link_add_object_symbols
PARAMS ((bfd *, struct bfd_link_info *));
static boolean elf_link_add_archive_symbols
PARAMS ((bfd *, struct bfd_link_info *));
+static boolean elf_merge_symbol
+ PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
+ asection **, bfd_vma *, struct elf_link_hash_entry **,
+ boolean *, boolean *, boolean *));
static boolean elf_export_symbol
PARAMS ((struct elf_link_hash_entry *, PTR));
+static boolean elf_fix_symbol_flags
+ PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *));
static boolean elf_adjust_dynamic_symbol
PARAMS ((struct elf_link_hash_entry *, PTR));
static boolean elf_link_find_version_dependencies
@@ -36,15 +51,6 @@ static boolean elf_link_assign_sym_version
static boolean elf_link_renumber_dynsyms
PARAMS ((struct elf_link_hash_entry *, PTR));
-/* This struct is used to pass information to routines called via
- elf_link_hash_traverse which must return failure. */
-
-struct elf_info_failed
-{
- boolean failed;
- struct bfd_link_info *info;
-};
-
/* Given an ELF BFD, add symbols to the global hash table as
appropriate. */
@@ -261,6 +267,360 @@ elf_link_add_archive_symbols (abfd, info)
return false;
}
+/* This function is called when we want to define a new symbol. It
+ handles the various cases which arise when we find a definition in
+ a dynamic object, or when there is already a definition in a
+ dynamic object. The new symbol is described by NAME, SYM, PSEC,
+ and PVALUE. We set SYM_HASH to the hash table entry. We set
+ OVERRIDE if the old symbol is overriding a new definition. We set
+ TYPE_CHANGE_OK if it is OK for the type to change. We set
+ SIZE_CHANGE_OK if it is OK for the size to change. By OK to
+ change, we mean that we shouldn't warn if the type or size does
+ change. */
+
+static boolean
+elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
+ override, type_change_ok, size_change_ok)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ const char *name;
+ Elf_Internal_Sym *sym;
+ asection **psec;
+ bfd_vma *pvalue;
+ struct elf_link_hash_entry **sym_hash;
+ boolean *override;
+ boolean *type_change_ok;
+ boolean *size_change_ok;
+{
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ int bind;
+ bfd *oldbfd;
+ boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon;
+
+ *override = false;
+ *type_change_ok = false;
+ *size_change_ok = false;
+
+ sec = *psec;
+ bind = ELF_ST_BIND (sym->st_info);
+
+ if (! bfd_is_und_section (sec))
+ h = elf_link_hash_lookup (elf_hash_table (info), name, true, false, false);
+ else
+ h = ((struct elf_link_hash_entry *)
+ bfd_wrapped_link_hash_lookup (abfd, info, name, true, false, false));
+ if (h == NULL)
+ return false;
+ *sym_hash = h;
+
+ /* This code is for coping with dynamic objects, and is only useful
+ if we are doing an ELF link. */
+ if (info->hash->creator != abfd->xvec)
+ return true;
+
+ /* For merging, we only care about real symbols. */
+
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ /* If we just created the symbol, mark it as being an ELF symbol.
+ Other than that, there is nothing to do--there is no merge issue
+ with a newly defined symbol--so we just return. */
+
+ if (h->root.type == bfd_link_hash_new)
+ {
+ h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
+ return true;
+ }
+
+ /* OLDBFD is a BFD associated with the existing symbol. */
+
+ switch (h->root.type)
+ {
+ default:
+ oldbfd = NULL;
+ break;
+
+ case bfd_link_hash_undefined:
+ case bfd_link_hash_undefweak:
+ oldbfd = h->root.u.undef.abfd;
+ break;
+
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ oldbfd = h->root.u.def.section->owner;
+ break;
+
+ case bfd_link_hash_common:
+ oldbfd = h->root.u.c.p->section->owner;
+ break;
+ }
+
+ /* NEWDYN and OLDDYN indicate whether the new or old symbol,
+ respectively, is from a dynamic object. */
+
+ if ((abfd->flags & DYNAMIC) != 0)
+ newdyn = true;
+ else
+ newdyn = false;
+
+ if (oldbfd == NULL || (oldbfd->flags & DYNAMIC) == 0)
+ olddyn = false;
+ else
+ olddyn = true;
+
+ /* NEWDEF and OLDDEF indicate whether the new or old symbol,
+ respectively, appear to be a definition rather than reference. */
+
+ if (bfd_is_und_section (sec) || bfd_is_com_section (sec))
+ newdef = false;
+ else
+ newdef = true;
+
+ if (h->root.type == bfd_link_hash_undefined
+ || h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_common)
+ olddef = false;
+ else
+ olddef = true;
+
+ /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old
+ symbol, respectively, appears to be a common symbol in a dynamic
+ object. If a symbol appears in an uninitialized section, and is
+ not weak, and is not a function, then it may be a common symbol
+ which was resolved when the dynamic object was created. We want
+ to treat such symbols specially, because they raise special
+ considerations when setting the symbol size: if the symbol
+ appears as a common symbol in a regular object, and the size in
+ the regular object is larger, we must make sure that we use the
+ larger size. This problematic case can always be avoided in C,
+ but it must be handled correctly when using Fortran shared
+ libraries.
+
+ Note that if NEWDYNCOMMON is set, NEWDEF will be set, and
+ likewise for OLDDYNCOMMON and OLDDEF.
+
+ Note that this test is just a heuristic, and that it is quite
+ possible to have an uninitialized symbol in a shared object which
+ is really a definition, rather than a common symbol. This could
+ lead to some minor confusion when the symbol really is a common
+ symbol in some regular object. However, I think it will be
+ harmless. */
+
+ if (newdyn
+ && newdef
+ && (sec->flags & SEC_ALLOC) != 0
+ && (sec->flags & SEC_LOAD) == 0
+ && sym->st_size > 0
+ && bind != STB_WEAK
+ && ELF_ST_TYPE (sym->st_info) != STT_FUNC)
+ newdyncommon = true;
+ else
+ newdyncommon = false;
+
+ if (olddyn
+ && olddef
+ && h->root.type == bfd_link_hash_defined
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->root.u.def.section->flags & SEC_ALLOC) != 0
+ && (h->root.u.def.section->flags & SEC_LOAD) == 0
+ && h->size > 0
+ && h->type != STT_FUNC)
+ olddyncommon = true;
+ else
+ olddyncommon = false;
+
+ /* It's OK to change the type if either the existing symbol or the
+ new symbol is weak. */
+
+ if (h->root.type == bfd_link_hash_defweak
+ || h->root.type == bfd_link_hash_undefweak
+ || bind == STB_WEAK)
+ *type_change_ok = true;
+
+ /* It's OK to change the size if either the existing symbol or the
+ new symbol is weak, or if the old symbol is undefined. */
+
+ if (*type_change_ok
+ || h->root.type == bfd_link_hash_undefined)
+ *size_change_ok = true;
+
+ /* If both the old and the new symbols look like common symbols in a
+ dynamic object, set the size of the symbol to the larger of the
+ two. */
+
+ if (olddyncommon
+ && newdyncommon
+ && sym->st_size != h->size)
+ {
+ /* Since we think we have two common symbols, issue a multiple
+ common warning if desired. Note that we only warn if the
+ size is different. If the size is the same, we simply let
+ the old symbol override the new one as normally happens with
+ symbols defined in dynamic objects. */
+
+ if (! ((*info->callbacks->multiple_common)
+ (info, h->root.root.string, oldbfd, bfd_link_hash_common,
+ h->size, abfd, bfd_link_hash_common, sym->st_size)))
+ return false;
+
+ if (sym->st_size > h->size)
+ h->size = sym->st_size;
+
+ *size_change_ok = true;
+ }
+
+ /* If we are looking at a dynamic object, and we have found a
+ definition, we need to see if the symbol was already defined by
+ some other object. If so, we want to use the existing
+ definition, and we do not want to report a multiple symbol
+ definition error; we do this by clobbering *PSEC to be
+ bfd_und_section_ptr.
+
+ We treat a common symbol as a definition if the symbol in the
+ shared library is a function, since common symbols always
+ represent variables; this can cause confusion in principle, but
+ any such confusion would seem to indicate an erroneous program or
+ shared library. We also permit a common symbol in a regular
+ object to override a weak symbol in a shared object. */
+
+ if (newdyn
+ && newdef
+ && (olddef
+ || (h->root.type == bfd_link_hash_common
+ && (bind == STB_WEAK
+ || ELF_ST_TYPE (sym->st_info) == STT_FUNC))))
+ {
+ *override = true;
+ newdef = false;
+ newdyncommon = false;
+
+ *psec = sec = bfd_und_section_ptr;
+ *size_change_ok = true;
+
+ /* If we get here when the old symbol is a common symbol, then
+ we are explicitly letting it override a weak symbol or
+ function in a dynamic object, and we don't want to warn about
+ a type change. If the old symbol is a defined symbol, a type
+ change warning may still be appropriate. */
+
+ if (h->root.type == bfd_link_hash_common)
+ *type_change_ok = true;
+ }
+
+ /* Handle the special case of an old common symbol merging with a
+ new symbol which looks like a common symbol in a shared object.
+ We change *PSEC and *PVALUE to make the new symbol look like a
+ common symbol, and let _bfd_generic_link_add_one_symbol will do
+ the right thing. */
+
+ if (newdyncommon
+ && h->root.type == bfd_link_hash_common)
+ {
+ *override = true;
+ newdef = false;
+ newdyncommon = false;
+ *pvalue = sym->st_size;
+ *psec = sec = bfd_com_section_ptr;
+ *size_change_ok = true;
+ }
+
+ /* If the old symbol is from a dynamic object, and the new symbol is
+ a definition which is not from a dynamic object, then the new
+ symbol overrides the old symbol. Symbols from regular files
+ always take precedence over symbols from dynamic objects, even if
+ they are defined after the dynamic object in the link.
+
+ As above, we again permit a common symbol in a regular object to
+ override a definition in a shared object if the shared object
+ symbol is a function or is weak. */
+
+ if (! newdyn
+ && (newdef
+ || (bfd_is_com_section (sec)
+ && (h->root.type == bfd_link_hash_defweak
+ || h->type == STT_FUNC)))
+ && olddyn
+ && olddef
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+ {
+ /* Change the hash table entry to undefined, and let
+ _bfd_generic_link_add_one_symbol do the right thing with the
+ new definition. */
+
+ h->root.type = bfd_link_hash_undefined;
+ h->root.u.undef.abfd = h->root.u.def.section->owner;
+ *size_change_ok = true;
+
+ olddef = false;
+ olddyncommon = false;
+
+ /* We again permit a type change when a common symbol may be
+ overriding a function. */
+
+ if (bfd_is_com_section (sec))
+ *type_change_ok = true;
+
+ /* This union may have been set to be non-NULL when this symbol
+ was seen in a dynamic object. We must force the union to be
+ NULL, so that it is correct for a regular symbol. */
+
+ h->verinfo.vertree = NULL;
+
+ /* In this special case, if H is the target of an indirection,
+ we want the caller to frob with H rather than with the
+ indirect symbol. That will permit the caller to redefine the
+ target of the indirection, rather than the indirect symbol
+ itself. FIXME: This will break the -y option if we store a
+ symbol with a different name. */
+ *sym_hash = h;
+ }
+
+ /* Handle the special case of a new common symbol merging with an
+ old symbol that looks like it might be a common symbol defined in
+ a shared object. Note that we have already handled the case in
+ which a new common symbol should simply override the definition
+ in the shared library. */
+
+ if (! newdyn
+ && bfd_is_com_section (sec)
+ && olddyncommon)
+ {
+ /* It would be best if we could set the hash table entry to a
+ common symbol, but we don't know what to use for the section
+ or the alignment. */
+ if (! ((*info->callbacks->multiple_common)
+ (info, h->root.root.string, oldbfd, bfd_link_hash_common,
+ h->size, abfd, bfd_link_hash_common, sym->st_size)))
+ return false;
+
+ /* If the predumed common symbol in the dynamic object is
+ larger, pretend that the new symbol has its size. */
+
+ if (h->size > *pvalue)
+ *pvalue = h->size;
+
+ /* FIXME: We no longer know the alignment required by the symbol
+ in the dynamic object, so we just wind up using the one from
+ the regular object. */
+
+ olddef = false;
+ olddyncommon = false;
+
+ h->root.type = bfd_link_hash_undefined;
+ h->root.u.undef.abfd = h->root.u.def.section->owner;
+
+ *size_change_ok = true;
+ *type_change_ok = true;
+
+ h->verinfo.vertree = NULL;
+ }
+
+ return true;
+}
+
/* Add symbols from an ELF object file to the linker hash table. */
static boolean
@@ -395,57 +755,8 @@ elf_link_add_object_symbols (abfd, info)
{
/* Read in any version definitions. */
- if (elf_dynverdef (abfd) != 0)
- {
- Elf_Internal_Shdr *verdefhdr;
- bfd_byte *dynver;
- int i;
- const Elf_External_Verdef *extverdef;
- Elf_Internal_Verdef *intverdef;
-
- verdefhdr = &elf_tdata (abfd)->dynverdef_hdr;
- elf_tdata (abfd)->verdef =
- ((Elf_Internal_Verdef *)
- bfd_zalloc (abfd,
- verdefhdr->sh_info * sizeof (Elf_Internal_Verdef)));
- if (elf_tdata (abfd)->verdef == NULL)
- goto error_return;
-
- dynver = (bfd_byte *) bfd_malloc (verdefhdr->sh_size);
- if (dynver == NULL)
- goto error_return;
-
- if (bfd_seek (abfd, verdefhdr->sh_offset, SEEK_SET) != 0
- || (bfd_read ((PTR) dynver, 1, verdefhdr->sh_size, abfd)
- != verdefhdr->sh_size))
- goto error_return;
-
- extverdef = (const Elf_External_Verdef *) dynver;
- intverdef = elf_tdata (abfd)->verdef;
- for (i = 0; i < verdefhdr->sh_info; i++, intverdef++)
- {
- const Elf_External_Verdaux *extverdaux;
- Elf_Internal_Verdaux intverdaux;
-
- _bfd_elf_swap_verdef_in (abfd, extverdef, intverdef);
-
- /* Pick up the name of the version. */
- extverdaux = ((const Elf_External_Verdaux *)
- ((bfd_byte *) extverdef + intverdef->vd_aux));
- _bfd_elf_swap_verdaux_in (abfd, extverdaux, &intverdaux);
-
- intverdef->vd_bfd = abfd;
- intverdef->vd_nodename =
- bfd_elf_string_from_elf_section (abfd, verdefhdr->sh_link,
- intverdaux.vda_name);
-
- extverdef = ((const Elf_External_Verdef *)
- ((bfd_byte *) extverdef + intverdef->vd_next));
- }
-
- free (dynver);
- dynver = NULL;
- }
+ if (! _bfd_elf_slurp_version_tables (abfd))
+ goto error_return;
/* Read in the symbol versions, but don't bother to convert them
to internal format. */
@@ -787,7 +1098,7 @@ elf_link_add_object_symbols (abfd, info)
if (info->hash->creator->flavour == bfd_target_elf_flavour)
{
Elf_Internal_Versym iver;
- int vernum;
+ unsigned int vernum = 0;
boolean override;
if (ever != NULL)
@@ -807,19 +1118,58 @@ elf_link_add_object_symbols (abfd, info)
int namelen, newlen;
char *newname, *p;
- if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info)
+ if (sym.st_shndx != SHN_UNDEF)
{
- (*_bfd_error_handler)
- ("%s: %s: invalid version %d (max %d)",
- abfd->filename, name, vernum,
- elf_tdata (abfd)->dynverdef_hdr.sh_info);
- bfd_set_error (bfd_error_bad_value);
- goto error_return;
+ if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info)
+ {
+ (*_bfd_error_handler)
+ ("%s: %s: invalid version %u (max %d)",
+ abfd->filename, name, vernum,
+ elf_tdata (abfd)->dynverdef_hdr.sh_info);
+ bfd_set_error (bfd_error_bad_value);
+ goto error_return;
+ }
+ else if (vernum > 1)
+ verstr =
+ elf_tdata (abfd)->verdef[vernum - 1].vd_nodename;
+ else
+ verstr = "";
}
- else if (vernum > 1)
- verstr = elf_tdata (abfd)->verdef[vernum - 1].vd_nodename;
else
- verstr = "";
+ {
+ /* We cannot simply test for the number of
+ entries in the VERNEED section since the
+ numbers for the needed versions do not start
+ at 0. */
+ Elf_Internal_Verneed *t;
+
+ verstr = NULL;
+ for (t = elf_tdata (abfd)->verref;
+ t != NULL;
+ t = t->vn_nextref)
+ {
+ Elf_Internal_Vernaux *a;
+
+ for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
+ {
+ if (a->vna_other == vernum)
+ {
+ verstr = a->vna_nodename;
+ break;
+ }
+ }
+ if (a != NULL)
+ break;
+ }
+ if (verstr == NULL)
+ {
+ (*_bfd_error_handler)
+ ("%s: %s: invalid needed version %d",
+ abfd->filename, name, vernum);
+ bfd_set_error (bfd_error_bad_value);
+ goto error_return;
+ }
+ }
namelen = strlen (name);
newlen = namelen + strlen (verstr) + 2;
@@ -840,212 +1190,31 @@ elf_link_add_object_symbols (abfd, info)
}
}
- /* We need to look up the symbol now in order to get some of
- the dynamic object handling right. We pass the hash
- table entry in to _bfd_generic_link_add_one_symbol so
- that it does not have to look it up again. */
- if (! bfd_is_und_section (sec))
- h = elf_link_hash_lookup (elf_hash_table (info), name,
- true, false, false);
- else
- h = ((struct elf_link_hash_entry *)
- bfd_wrapped_link_hash_lookup (abfd, info, name, true,
- false, false));
- if (h == NULL)
+ if (! elf_merge_symbol (abfd, info, name, &sym, &sec, &value,
+ sym_hash, &override, &type_change_ok,
+ &size_change_ok))
goto error_return;
- *sym_hash = h;
- if (h->root.type == bfd_link_hash_new)
- h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
+ if (override)
+ definition = false;
+ h = *sym_hash;
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;
- /* FIXME: There are too many cases here, and it's too
- confusing. This code needs to be reorganized somehow. */
-
- /* It's OK to change the type if it used to be a weak
- definition, or if the current definition is weak (and
- hence might be ignored). */
- if (h->root.type == bfd_link_hash_defweak
- || h->root.type == bfd_link_hash_undefweak
- || bind == STB_WEAK)
- type_change_ok = true;
-
- /* It's OK to change the size if it used to be a weak
- definition, or if it used to be undefined, or if we will
- be overriding an old definition. */
- if (type_change_ok
- || h->root.type == bfd_link_hash_undefined)
- size_change_ok = true;
-
+ /* Remember the old alignment if this is a common symbol, so
+ that we don't reduce the alignment later on. We can't
+ check later, because _bfd_generic_link_add_one_symbol
+ will set a default for the alignment which we want to
+ override. */
if (h->root.type == bfd_link_hash_common)
old_alignment = h->root.u.c.p->alignment_power;
- override = false;
-
- /* If we are looking at a dynamic object, and this is a
- definition, we need to see if it has already been defined
- by some other object. If it has, we want to use the
- existing definition, and we do not want to report a
- multiple symbol definition error; we do this by
- clobbering sec to be bfd_und_section_ptr. We treat a
- common symbol as a definition if the symbol in the shared
- library is a function, since common symbols always
- represent variables; this can cause confusion in
- principle, but any such confusion would seem to indicate
- an erroneous program or shared library. */
- if (dynamic && definition)
- {
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak
- || (h->root.type == bfd_link_hash_common
- && (bind == STB_WEAK
- || ELF_ST_TYPE (sym.st_info) == STT_FUNC)))
- {
- /* In the special case of two symbols which look
- like common symbols in a dynamic object, set the
- size of the symbol to the larger of the two. */
- if ((sec->flags & SEC_ALLOC) != 0
- && (sec->flags & SEC_LOAD) == 0
- && sym.st_size > 0
- && bind != STB_WEAK
- && ELF_ST_TYPE (sym.st_info) != STT_FUNC
- && h->root.type == bfd_link_hash_defined
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->root.u.def.section->owner->flags & DYNAMIC) != 0
- && (h->root.u.def.section->flags & SEC_ALLOC) != 0
- && (h->root.u.def.section->flags & SEC_LOAD) == 0
- && h->size > 0
- && h->type != STT_FUNC
- && sym.st_size != h->size)
- {
- /* Note that we only warn if the size is
- different. If the size is the same, then we
- simply let the first shared library override
- the second. */
- if (! ((*info->callbacks->multiple_common)
- (info, h->root.root.string,
- h->root.u.def.section->owner,
- bfd_link_hash_common,
- h->size, abfd, bfd_link_hash_common,
- sym.st_size)))
- goto error_return;
- if (sym.st_size > h->size)
- h->size = sym.st_size;
- }
-
- override = true;
- sec = bfd_und_section_ptr;
- definition = false;
- size_change_ok = true;
- if (h->root.type == bfd_link_hash_common)
- type_change_ok = true;
- }
- }
-
- /* If we already have a common symbol, and the symbol in the
- shared library is in an uninitialized section, then treat
- the shared library symbol as a common symbol. This will
- not always be correct, but it should do little harm. */
- if (dynamic
- && definition
- && h->root.type == bfd_link_hash_common
- && (sec->flags & SEC_ALLOC) != 0
- && (sec->flags & SEC_LOAD) == 0
- && sym.st_size > 0
- && bind != STB_WEAK
- && ELF_ST_TYPE (sym.st_info) != STT_FUNC)
- {
- override = true;
- sec = bfd_com_section_ptr;
- definition = false;
- value = sym.st_size;
- size_change_ok = true;
- }
-
- /* If we are not looking at a dynamic object, and we have a
- definition, we want to override any definition we may
- have from a dynamic object. Symbols from regular files
- always take precedence over symbols from dynamic objects,
- even if they are defined after the dynamic object in the
- link. */
- if (! dynamic
- && (definition
- || (bfd_is_com_section (sec)
- && (h->root.type == bfd_link_hash_defweak
- || h->type == STT_FUNC)))
- && (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->root.u.def.section->owner->flags & DYNAMIC) != 0)
- {
- override = true;
- /* Change the hash table entry to undefined, and let
- _bfd_generic_link_add_one_symbol do the right thing
- with the new definition. */
- h->root.type = bfd_link_hash_undefined;
- h->root.u.undef.abfd = h->root.u.def.section->owner;
- size_change_ok = true;
- if (bfd_is_com_section (sec))
- type_change_ok = true;
-
- /* This union may have been set to be non-NULL when this
- symbol was seen in a dynamic object. We must force
- the union to be NULL, so that it is correct for a
- regular symbol. */
- h->verinfo.vertree = NULL;
- }
-
- /* If we are not looking at a shared library and we have a
- common symbol, and the symbol in the shared library is in
- an uninitialized section, then treat the shared library
- symbol as a common symbol. This will not always be
- correct, but it should do little harm. Note that the
- above condition already handled cases in which a common
- symbol should simply override the definition in the
- shared library. */
- if (! dynamic
- && ! override
- && bfd_is_com_section (sec)
- && h->root.type == bfd_link_hash_defined
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->root.u.def.section->owner->flags & DYNAMIC) != 0
- && (h->root.u.def.section->flags & SEC_ALLOC) != 0
- && (h->root.u.def.section->flags & SEC_LOAD) == 0
- && h->size > 0
- && h->type != STT_FUNC)
- {
- /* It would be best if we could set the hash table entry
- to a common symbol, but we don't know what to use for
- the section or the alignment. */
- if (! ((*info->callbacks->multiple_common)
- (info, h->root.root.string,
- h->root.u.def.section->owner, bfd_link_hash_common,
- h->size, abfd, bfd_link_hash_common, value)))
- goto error_return;
-
- if (h->size > value)
- value = h->size;
-
- /* FIXME: We no longer know the alignment required by
- the symbol in the shared library, so we just wind up
- using the one from the regular object. */
-
- override = true;
- h->root.type = bfd_link_hash_undefined;
- h->root.u.undef.abfd = h->root.u.def.section->owner;
- size_change_ok = true;
- type_change_ok = true;
- h->verinfo.vertree = NULL;
- }
-
- if (ever != NULL
+ if (elf_tdata (abfd)->verdef != NULL
&& ! override
&& vernum > 1
- && (h->verinfo.verdef == NULL || definition))
+ && definition)
h->verinfo.verdef = &elf_tdata (abfd)->verdef[vernum - 1];
}
@@ -1188,7 +1357,8 @@ elf_link_add_object_symbols (abfd, info)
if (p != NULL && p[1] == ELF_VER_CHR)
{
char *shortname;
- struct elf_link_hash_entry *hold;
+ struct elf_link_hash_entry *hi;
+ boolean override;
shortname = bfd_hash_allocate (&info->hash->table,
p - name + 1);
@@ -1197,124 +1367,134 @@ elf_link_add_object_symbols (abfd, info)
strncpy (shortname, name, p - name);
shortname[p - name] = '\0';
- /* First look to see if we have an existing symbol
- with this name. */
- hold = elf_link_hash_lookup (elf_hash_table (info),
- shortname, false, false,
- false);
-
- /* If we are looking at a normal object, and the
- symbol was seen in a shared object, clobber the
- definition in the shared object. */
- if (hold != NULL
- && ! dynamic
- && (hold->root.type == bfd_link_hash_defined
- || hold->root.type == bfd_link_hash_defweak)
- && (hold->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && ((hold->root.u.def.section->owner->flags & DYNAMIC)
- != 0))
- {
- /* Change the hash table entry to undefined, so
- that _bfd_generic_link_add_one_symbol will do
- the right thing. */
- hold->root.type = bfd_link_hash_undefined;
- hold->root.u.undef.abfd =
- hold->root.u.def.section->owner;
- hold->verinfo.vertree = NULL;
- hold = NULL;
- }
+ /* We are going to create a new symbol. Merge it
+ with any existing symbol with this name. For the
+ purposes of the merge, act as though we were
+ defining the symbol we just defined, although we
+ actually going to define an indirect symbol. */
+ if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec,
+ &value, &hi, &override,
+ &type_change_ok, &size_change_ok))
+ goto error_return;
- /* If we are looking at a shared object, and we have
- already seen this symbol defined elsewhere, then
- don't try to define it again. */
- if (hold != NULL
- && dynamic
- && (hold->root.type == bfd_link_hash_defined
- || hold->root.type == bfd_link_hash_defweak
- || hold->root.type == bfd_link_hash_indirect
- || (hold->root.type == bfd_link_hash_common
- && (bind == STB_WEAK
- || ELF_ST_TYPE (sym.st_info) == STT_FUNC))))
- {
- /* Don't add an indirect symbol. */
- }
- else
+ if (! override)
{
- struct elf_link_hash_entry *hi;
-
- hi = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, shortname, BSF_INDIRECT,
bfd_ind_section_ptr, (bfd_vma) 0, name, false,
collect, (struct bfd_link_hash_entry **) &hi)))
goto error_return;
+ }
+ else
+ {
+ /* In this case the symbol named SHORTNAME is
+ overriding the indirect symbol we want to
+ add. We were planning on making SHORTNAME an
+ indirect symbol referring to NAME. SHORTNAME
+ is the name without a version. NAME is the
+ fully versioned name, and it is the default
+ version.
+
+ Overriding means that we already saw a
+ definition for the symbol SHORTNAME in a
+ regular object, and it is overriding the
+ symbol defined in the dynamic object.
+
+ When this happens, we actually want to change
+ NAME, the symbol we just added, to refer to
+ SHORTNAME. This will cause references to
+ NAME in the shared object to become
+ references to SHORTNAME in the regular
+ object. This is what we expect when we
+ override a function in a shared object: that
+ the references in the shared object will be
+ mapped to the definition in the regular
+ object. */
+
+ while (hi->root.type == bfd_link_hash_indirect
+ || hi->root.type == bfd_link_hash_warning)
+ hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
+
+ h->root.type = bfd_link_hash_indirect;
+ h->root.u.i.link = (struct bfd_link_hash_entry *) hi;
+ if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
+ {
+ h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC;
+ hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ if (! _bfd_elf_link_record_dynamic_symbol (info, hi))
+ goto error_return;
+ }
- /* If there is a duplicate definition somewhere,
- then HI may not point to an indirect symbol.
- We will have reported an error to the user in
- that case. */
+ /* Now set HI to H, so that the following code
+ will set the other fields correctly. */
+ hi = h;
+ }
- if (hi->root.type == bfd_link_hash_indirect)
+ /* If there is a duplicate definition somewhere,
+ then HI may not point to an indirect symbol. We
+ will have reported an error to the user in that
+ case. */
+
+ if (hi->root.type == bfd_link_hash_indirect)
+ {
+ struct elf_link_hash_entry *ht;
+
+ /* If the symbol became indirect, then we assume
+ that we have not seen a definition before. */
+ BFD_ASSERT ((hi->elf_link_hash_flags
+ & (ELF_LINK_HASH_DEF_DYNAMIC
+ | ELF_LINK_HASH_DEF_REGULAR))
+ == 0);
+
+ ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
+
+ /* Copy down any references that we may have
+ already seen to the symbol which just became
+ indirect. */
+ ht->elf_link_hash_flags |=
+ (hi->elf_link_hash_flags
+ & (ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_HASH_REF_REGULAR));
+
+ /* Copy over the global table offset entry.
+ This may have been already set up by a
+ check_relocs routine. */
+ if (ht->got_offset == (bfd_vma) -1)
{
- hi->elf_link_hash_flags &= ~ ELF_LINK_NON_ELF;
+ ht->got_offset = hi->got_offset;
+ hi->got_offset = (bfd_vma) -1;
+ }
+ BFD_ASSERT (hi->got_offset == (bfd_vma) -1);
- /* If the symbol became indirect, then we
- assume that we have not seen a definition
- before. */
- BFD_ASSERT ((hi->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_DYNAMIC
- | ELF_LINK_HASH_DEF_REGULAR))
- == 0);
+ if (ht->dynindx == -1)
+ {
+ ht->dynindx = hi->dynindx;
+ ht->dynstr_index = hi->dynstr_index;
+ hi->dynindx = -1;
+ hi->dynstr_index = 0;
+ }
+ BFD_ASSERT (hi->dynindx == -1);
- /* Copy down any references that we may have
- already seen to the symbol which just
- became indirect. */
- h->elf_link_hash_flags |=
- (hi->elf_link_hash_flags
- & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR));
+ /* FIXME: There may be other information to copy
+ over for particular targets. */
- /* Copy over the global table offset entry.
- This may have been already set up by a
- check_relocs routine. */
- if (h->got_offset == (bfd_vma) -1)
- {
- h->got_offset = hi->got_offset;
- hi->got_offset = (bfd_vma) -1;
- }
- BFD_ASSERT (hi->got_offset == (bfd_vma) -1);
-
- if (h->dynindx == -1)
+ /* See if the new flags lead us to realize that
+ the symbol must be dynamic. */
+ if (! dynsym)
+ {
+ if (! dynamic)
{
- h->dynindx = hi->dynindx;
- h->dynstr_index = hi->dynstr_index;
- hi->dynindx = -1;
- hi->dynstr_index = 0;
+ if (info->shared
+ || ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_DYNAMIC)
+ != 0))
+ dynsym = true;
}
- BFD_ASSERT (hi->dynindx == -1);
-
- /* FIXME: There may be other information to
- copy over for particular targets. */
-
- /* See if the new flags lead us to realize
- that the symbol must be dynamic. */
- if (! dynsym)
+ else
{
- if (! dynamic)
- {
- if (info->shared
- || ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_DYNAMIC)
- != 0))
- dynsym = true;
- }
- else
- {
- if ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_REGULAR) != 0)
- dynsym = true;
- }
+ if ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_REGULAR) != 0)
+ dynsym = true;
}
}
}
@@ -1329,53 +1509,23 @@ elf_link_add_object_symbols (abfd, info)
strncpy (shortname, name, p - name);
strcpy (shortname + (p - name), p + 1);
- /* First look to see if we have an existing symbol
- with this name. */
- hold = elf_link_hash_lookup (elf_hash_table (info),
- shortname, false, false,
- false);
-
- /* If we are looking at a normal object, and the
- symbol was seen in a shared object, clobber the
- definition in the shared object. */
- if (hold != NULL
- && ! dynamic
- && (hold->root.type == bfd_link_hash_defined
- || hold->root.type == bfd_link_hash_defweak)
- && (hold->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && ((hold->root.u.def.section->owner->flags & DYNAMIC)
- != 0))
- {
- /* Change the hash table entry to undefined, so
- that _bfd_generic_link_add_one_symbol will do
- the right thing. */
- hold->root.type = bfd_link_hash_undefined;
- hold->root.u.undef.abfd =
- hold->root.u.def.section->owner;
- hold->verinfo.vertree = NULL;
- hold = NULL;
- }
+ /* Once again, merge with any existing symbol. */
+ if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec,
+ &value, &hi, &override,
+ &type_change_ok, &size_change_ok))
+ goto error_return;
- /* If we are looking at a shared object, and we have
- already seen this symbol defined elsewhere, then
- don't try to define it again. */
- if (hold != NULL
- && dynamic
- && (hold->root.type == bfd_link_hash_defined
- || hold->root.type == bfd_link_hash_defweak
- || hold->root.type == bfd_link_hash_indirect
- || (hold->root.type == bfd_link_hash_common
- && (bind == STB_WEAK
- || ELF_ST_TYPE (sym.st_info) == STT_FUNC))))
+ if (override)
{
- /* Don't add an indirect symbol. */
+ /* Here SHORTNAME is a versioned name, so we
+ don't expect to see the type of override we
+ do in the case above. */
+ (*_bfd_error_handler)
+ ("%s: warning: unexpected redefinition of `%s'",
+ bfd_get_filename (abfd), shortname);
}
else
{
- struct elf_link_hash_entry *hi;
-
- hi = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, shortname, BSF_INDIRECT,
bfd_ind_section_ptr, (bfd_vma) 0, name, false,
@@ -1389,8 +1539,6 @@ elf_link_add_object_symbols (abfd, info)
if (hi->root.type == bfd_link_hash_indirect)
{
- hi->elf_link_hash_flags &= ~ ELF_LINK_NON_ELF;
-
/* If the symbol became indirect, then we
assume that we have not seen a definition
before. */
@@ -1586,7 +1734,8 @@ elf_link_add_object_symbols (abfd, info)
if ((o->flags & SEC_RELOC) == 0
|| o->reloc_count == 0
|| ((info->strip == strip_all || info->strip == strip_debugger)
- && (o->flags & SEC_DEBUGGING) != 0))
+ && (o->flags & SEC_DEBUGGING) != 0)
+ || bfd_is_abs_section (o->output_section))
continue;
internal_relocs = (NAME(_bfd_elf,link_read_relocs)
@@ -1695,7 +1844,7 @@ elf_link_create_dynamic_sections (abfd, info)
s = bfd_make_section (abfd, ".gnu.version_d");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
return false;
s = bfd_make_section (abfd, ".gnu.version");
@@ -1707,7 +1856,7 @@ elf_link_create_dynamic_sections (abfd, info)
s = bfd_make_section (abfd, ".gnu.version_r");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
return false;
s = bfd_make_section (abfd, ".dynsym");
@@ -1954,6 +2103,15 @@ NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
h->root.type = bfd_link_hash_undefined;
+ /* If this symbol is not being provided by the linker script, and it is
+ currently defined by a dynamic object, but not by a regular object,
+ then clear out any version information because the symbol will not be
+ associated with the dynamic object any more. */
+ if (!provide
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ h->verinfo.verdef = NULL;
+
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
h->type = STT_OBJECT;
@@ -2049,10 +2207,11 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
bfd *dynobj;
struct elf_backend_data *bed;
bfd_size_type old_dynsymcount;
+ struct elf_assign_sym_version_info asvinfo;
*sinterpptr = NULL;
- soname_indx = -1;
+ soname_indx = (bfd_size_type) -1;
if (info->hash->creator->flavour != bfd_target_elf_flavour)
return true;
@@ -2147,6 +2306,20 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
}
}
+ /* Attach all the symbols to their version information. */
+ asvinfo.output_bfd = output_bfd;
+ asvinfo.info = info;
+ asvinfo.verdefs = verdefs;
+ asvinfo.export_dynamic = export_dynamic;
+ asvinfo.removed_dynamic = false;
+ asvinfo.failed = false;
+
+ elf_link_hash_traverse (elf_hash_table (info),
+ elf_link_assign_sym_version,
+ (PTR) &asvinfo);
+ if (asvinfo.failed)
+ return false;
+
/* Find all symbols which were defined in a dynamic object and make
the backend pick a reasonable value for them. */
eif.failed = false;
@@ -2201,30 +2374,14 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
size_t i;
size_t bucketcount = 0;
Elf_Internal_Sym isym;
- struct elf_assign_sym_version_info sinfo;
/* Set up the version definition section. */
s = bfd_get_section_by_name (dynobj, ".gnu.version_d");
BFD_ASSERT (s != NULL);
- /* Attach all the symbols to their version information. This
- may cause some symbols to be unexported. */
- sinfo.output_bfd = output_bfd;
- sinfo.info = info;
- sinfo.verdefs = verdefs;
- sinfo.export_dynamic = export_dynamic;
- sinfo.removed_dynamic = false;
- sinfo.failed = false;
-
- elf_link_hash_traverse (elf_hash_table (info),
- elf_link_assign_sym_version,
- (PTR) &sinfo);
- if (sinfo.failed)
- return false;
-
/* We may have created additional version definitions if we are
just linking a regular application. */
- verdefs = sinfo.verdefs;
+ verdefs = asvinfo.verdefs;
if (verdefs == NULL)
{
@@ -2247,7 +2404,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
Elf_Internal_Verdef def;
Elf_Internal_Verdaux defaux;
- if (sinfo.removed_dynamic)
+ if (asvinfo.removed_dynamic)
{
/* Some dynamic symbols were changed to be local
symbols. In this case, we renumber all of the
@@ -2301,7 +2458,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
def.vd_next = (sizeof (Elf_External_Verdef)
+ sizeof (Elf_External_Verdaux));
- if (soname_indx != -1)
+ if (soname_indx != (bfd_size_type) -1)
{
def.vd_hash = bfd_elf_hash ((const unsigned char *) soname);
defaux.vda_name = soname_indx;
@@ -2385,7 +2542,14 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
for (n = t->deps; n != NULL; n = n->next)
{
- defaux.vda_name = n->version_needed->name_indx;
+ if (n->version_needed == NULL)
+ {
+ /* This can happen if there was an error in the
+ version script. */
+ defaux.vda_name = 0;
+ }
+ else
+ defaux.vda_name = n->version_needed->name_indx;
if (n->next == NULL)
defaux.vda_next = 0;
else
@@ -2478,8 +2642,13 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
t->vn_version = VER_NEED_CURRENT;
t->vn_cnt = caux;
- indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr,
- t->vn_bfd->filename, true, false);
+ if (elf_dt_name (t->vn_bfd) != NULL)
+ indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr,
+ elf_dt_name (t->vn_bfd),
+ true, false);
+ else
+ indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr,
+ t->vn_bfd->filename, true, false);
if (indx == (bfd_size_type) -1)
return false;
t->vn_file = indx;
@@ -2606,23 +2775,17 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
return true;
}
-/* Make the backend pick a good value for a dynamic symbol. This is
- called via elf_link_hash_traverse, and also calls itself
- recursively. */
+/* Fix up the flags for a symbol. This handles various cases which
+ can only be fixed after all the input files are seen. This is
+ currently called by both adjust_dynamic_symbol and
+ assign_sym_version, which is unnecessary but perhaps more robust in
+ the face of future changes. */
static boolean
-elf_adjust_dynamic_symbol (h, data)
+elf_fix_symbol_flags (h, eif)
struct elf_link_hash_entry *h;
- PTR data;
+ struct elf_info_failed *eif;
{
- struct elf_info_failed *eif = (struct elf_info_failed *) data;
- bfd *dynobj;
- struct elf_backend_data *bed;
-
- /* Ignore indirect symbols. These are added by the versioning code. */
- if (h->root.type == bfd_link_hash_indirect)
- return true;
-
/* If this symbol was mentioned in a non-ELF file, try to set
DEF_REGULAR and REF_REGULAR correctly. This is the only way to
permit a non-ELF file to correctly refer to a symbol defined in
@@ -2642,8 +2805,9 @@ elf_adjust_dynamic_symbol (h, data)
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
}
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
+ if (h->dynindx == -1
+ && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0))
{
if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
{
@@ -2675,6 +2839,30 @@ elf_adjust_dynamic_symbol (h, data)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
+ return true;
+}
+
+/* Make the backend pick a good value for a dynamic symbol. This is
+ called via elf_link_hash_traverse, and also calls itself
+ recursively. */
+
+static boolean
+elf_adjust_dynamic_symbol (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct elf_info_failed *eif = (struct elf_info_failed *) data;
+ bfd *dynobj;
+ struct elf_backend_data *bed;
+
+ /* Ignore indirect symbols. These are added by the versioning code. */
+ if (h->root.type == bfd_link_hash_indirect)
+ return true;
+
+ /* Fix the symbol flags. */
+ if (! elf_fix_symbol_flags (h, eif))
+ return false;
+
/* If this symbol does not require a PLT entry, and it is not
defined by a dynamic object, or is not referenced by a regular
object, ignore it. We do have to handle a weak defined symbol,
@@ -2819,7 +3007,7 @@ elf_link_find_version_dependencies (h, data)
/* See if we already know about this version. */
for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref)
{
- if (t->vn_bfd == h->verinfo.verdef->vd_bfd)
+ if (t->vn_bfd != h->verinfo.verdef->vd_bfd)
continue;
for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
@@ -2879,8 +3067,19 @@ elf_link_assign_sym_version (h, data)
struct elf_assign_sym_version_info *sinfo =
(struct elf_assign_sym_version_info *) data;
struct bfd_link_info *info = sinfo->info;
+ struct elf_info_failed eif;
char *p;
+ /* Fix the symbol flags. */
+ eif.failed = false;
+ eif.info = info;
+ if (! elf_fix_symbol_flags (h, &eif))
+ {
+ if (eif.failed)
+ sinfo->failed = true;
+ return false;
+ }
+
/* We only need version numbers for symbols defined in regular
objects. */
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
@@ -2916,26 +3115,37 @@ elf_link_assign_sym_version (h, data)
{
if (strcmp (t->name, p) == 0)
{
+ int len;
+ char *alc;
+ struct bfd_elf_version_expr *d;
+
+ len = p - h->root.root.string;
+ alc = bfd_alloc (sinfo->output_bfd, len);
+ if (alc == NULL)
+ return false;
+ strncpy (alc, h->root.root.string, len - 1);
+ alc[len - 1] = '\0';
+ if (alc[len - 2] == ELF_VER_CHR)
+ alc[len - 2] = '\0';
+
h->verinfo.vertree = t;
t->used = true;
+ d = NULL;
+
+ if (t->globals != NULL)
+ {
+ for (d = t->globals; d != NULL; d = d->next)
+ {
+ if ((d->match[0] == '*' && d->match[1] == '\0')
+ || fnmatch (d->match, alc, 0) == 0)
+ break;
+ }
+ }
/* See if there is anything to force this symbol to
local scope. */
- if (t->locals != NULL)
+ if (d == NULL && t->locals != NULL)
{
- int len;
- char *alc;
- struct bfd_elf_version_expr *d;
-
- len = p - h->root.root.string;
- alc = bfd_alloc (sinfo->output_bfd, len);
- if (alc == NULL)
- return false;
- strncpy (alc, h->root.root.string, len - 1);
- alc[len - 1] = '\0';
- if (alc[len - 2] == ELF_VER_CHR)
- alc[len - 2] = '\0';
-
for (d = t->locals; d != NULL; d = d->next)
{
if ((d->match[0] == '*' && d->match[1] == '\0')
@@ -2943,12 +3153,12 @@ elf_link_assign_sym_version (h, data)
{
if (h->dynindx != -1
&& info->shared
- && ! sinfo->export_dynamic
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_NEEDS_PLT) == 0)
+ && ! sinfo->export_dynamic)
{
sinfo->removed_dynamic = true;
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+ h->elf_link_hash_flags &=~
+ ELF_LINK_HASH_NEEDS_PLT;
h->dynindx = -1;
/* FIXME: The name of the symbol has
already been recorded in the dynamic
@@ -2958,10 +3168,9 @@ elf_link_assign_sym_version (h, data)
break;
}
}
-
- bfd_release (sinfo->output_bfd, alc);
}
+ bfd_release (sinfo->output_bfd, alc);
break;
}
}
@@ -3008,7 +3217,7 @@ elf_link_assign_sym_version (h, data)
/* We could not find the version for a symbol when
generating a shared archive. Return an error. */
(*_bfd_error_handler)
- ("%s: undefined version name %s",
+ ("%s: undefined versioned symbol name %s",
bfd_get_filename (sinfo->output_bfd), h->root.root.string);
bfd_set_error (bfd_error_bad_value);
sinfo->failed = true;
@@ -3028,7 +3237,7 @@ elf_link_assign_sym_version (h, data)
struct bfd_elf_version_expr *d;
/* See if can find what version this symbol is in. If the
- symbol is supposed to eb local, then don't actually register
+ symbol is supposed to be local, then don't actually register
it. */
deflt = NULL;
for (t = sinfo->verdefs; t != NULL; t = t->next)
@@ -3059,12 +3268,11 @@ elf_link_assign_sym_version (h, data)
h->verinfo.vertree = t;
if (h->dynindx != -1
&& info->shared
- && ! sinfo->export_dynamic
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_NEEDS_PLT) == 0)
+ && ! sinfo->export_dynamic)
{
sinfo->removed_dynamic = true;
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+ h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
h->dynindx = -1;
/* FIXME: The name of the symbol has already
been recorded in the dynamic string table
@@ -3084,11 +3292,11 @@ elf_link_assign_sym_version (h, data)
h->verinfo.vertree = deflt;
if (h->dynindx != -1
&& info->shared
- && ! sinfo->export_dynamic
- && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
+ && ! sinfo->export_dynamic)
{
sinfo->removed_dynamic = true;
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+ h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
h->dynindx = -1;
/* FIXME: The name of the symbol has already been
recorded in the dynamic string table section. */
@@ -4099,7 +4307,7 @@ elf_link_output_extsym (h, data)
break;
case bfd_link_hash_common:
- input_sec = bfd_com_section_ptr;
+ input_sec = h->root.u.c.p->section;
sym.st_shndx = SHN_COMMON;
sym.st_value = 1 << h->root.u.c.p->alignment_power;
break;
@@ -4127,13 +4335,30 @@ elf_link_output_extsym (h, data)
((struct elf_link_hash_entry *) h->root.u.i.link, data));
}
+ /* Give the processor backend a chance to tweak the symbol value,
+ and also to finish up anything that needs to be done for this
+ symbol. */
+ if ((h->dynindx != -1
+ || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+ && elf_hash_table (finfo->info)->dynamic_sections_created)
+ {
+ struct elf_backend_data *bed;
+
+ bed = get_elf_backend_data (finfo->output_bfd);
+ if (! ((*bed->elf_backend_finish_dynamic_symbol)
+ (finfo->output_bfd, finfo->info, h, &sym)))
+ {
+ eoinfo->failed = true;
+ return false;
+ }
+ }
+
/* If this symbol should be put in the .dynsym section, then put it
there now. We have already know the symbol index. We also fill
in the entry in the .hash section. */
if (h->dynindx != -1
&& elf_hash_table (finfo->info)->dynamic_sections_created)
{
- struct elf_backend_data *bed;
char *p, *copy;
const char *name;
size_t bucketcount;
@@ -4143,17 +4368,6 @@ elf_link_output_extsym (h, data)
sym.st_name = h->dynstr_index;
- /* Give the processor backend a chance to tweak the symbol
- value, and also to finish up anything that needs to be done
- for this symbol. */
- bed = get_elf_backend_data (finfo->output_bfd);
- if (! ((*bed->elf_backend_finish_dynamic_symbol)
- (finfo->output_bfd, finfo->info, h, &sym)))
- {
- eoinfo->failed = true;
- return false;
- }
-
elf_swap_symbol_out (finfo->output_bfd, &sym,
(PTR) (((Elf_External_Sym *)
finfo->dynsym_sec->contents)
@@ -4517,6 +4731,7 @@ elf_link_input_bfd (finfo, input_bfd)
|| (elf_bad_symtab (input_bfd)
&& finfo->sections[r_symndx] == NULL))
{
+ struct elf_link_hash_entry *rh;
long indx;
/* This is a reloc against a global symbol. We
@@ -4527,13 +4742,18 @@ elf_link_input_bfd (finfo, input_bfd)
for this symbol. The symbol index is then
set at the end of elf_bfd_final_link. */
indx = r_symndx - extsymoff;
- *rel_hash = elf_sym_hashes (input_bfd)[indx];
+ rh = elf_sym_hashes (input_bfd)[indx];
+ while (rh->root.type == bfd_link_hash_indirect
+ || rh->root.type == bfd_link_hash_warning)
+ rh = (struct elf_link_hash_entry *) rh->root.u.i.link;
/* Setting the index to -2 tells
elf_link_output_extsym that this symbol is
used by a reloc. */
- BFD_ASSERT ((*rel_hash)->indx < 0);
- (*rel_hash)->indx = -2;
+ BFD_ASSERT (rh->indx < 0);
+ rh->indx = -2;
+
+ *rel_hash = rh;
continue;
}
@@ -4881,7 +5101,7 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel)
/* Allocate a table to hold the local symbols if first time */
if (!ptr)
{
- int num_symbols = elf_tdata (abfd)->symtab_hdr.sh_info;
+ unsigned int num_symbols = elf_tdata (abfd)->symtab_hdr.sh_info;
register unsigned int i;
ptr = (elf_linker_section_pointers_t **)
diff --git a/contrib/binutils/bfd/elfxx-target.h b/contrib/binutils/bfd/elfxx-target.h
index 1b551a7..e4d2b3d 100644
--- a/contrib/binutils/bfd/elfxx-target.h
+++ b/contrib/binutils/bfd/elfxx-target.h
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
There are two such structures here: one for big-endian machines and
one for little-endian machines. */
-#define bfd_elfNN_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup
#define bfd_elfNN_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
#ifndef bfd_elfNN_get_section_contents
#define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents
@@ -61,6 +61,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define bfd_elfNN_get_section_contents_in_window \
_bfd_generic_get_section_contents_in_window
+#ifndef elf_backend_got_symbol_offset
+#define elf_backend_got_symbol_offset (bfd_vma) 0
+#endif
#ifndef elf_backend_want_got_plt
#define elf_backend_want_got_plt 0
#endif
@@ -70,6 +73,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef elf_backend_want_plt_sym
#define elf_backend_want_plt_sym 0
#endif
+#ifndef elf_backend_plt_not_loaded
+#define elf_backend_plt_not_loaded 0
+#endif
+#ifndef elf_backend_plt_alignment
+#define elf_backend_plt_alignment 2
+#endif
#define bfd_elfNN_bfd_debug_info_start bfd_void
#define bfd_elfNN_bfd_debug_info_end bfd_void
@@ -309,9 +318,12 @@ static CONST struct elf_backend_data elfNN_bed =
ELF_MACHINE_ALT1,
ELF_MACHINE_ALT2,
&elf_backend_size_info,
+ elf_backend_got_symbol_offset,
elf_backend_want_got_plt,
elf_backend_plt_readonly,
- elf_backend_want_plt_sym
+ elf_backend_want_plt_sym,
+ elf_backend_plt_not_loaded,
+ elf_backend_plt_alignment
};
#ifdef TARGET_BIG_SYM
diff --git a/contrib/binutils/bfd/i386netbsd.c b/contrib/binutils/bfd/i386netbsd.c
index 32feaa7..327b6f9 100644
--- a/contrib/binutils/bfd/i386netbsd.c
+++ b/contrib/binutils/bfd/i386netbsd.c
@@ -1,5 +1,5 @@
/* BFD back-end for NetBSD/386 a.out-ish binaries.
- Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 94, 95, 96, 1998 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define DEFAULT_ARCH bfd_arch_i386
-#define MACHTYPE_OK(mtype) ((mtype) == M_386_NETBSD || (mtype) == M_UNKNOWN)
+#define DEFAULT_MID M_386_NETBSD
#define MY(OP) CAT(i386netbsd_,OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
diff --git a/contrib/binutils/bfd/ieee.c b/contrib/binutils/bfd/ieee.c
index b559208..ab09140 100644
--- a/contrib/binutils/bfd/ieee.c
+++ b/contrib/binutils/bfd/ieee.c
@@ -1,5 +1,5 @@
/* BFD back-end for ieee-695 objects.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
@@ -1646,10 +1646,8 @@ do_one (ieee, current_map, location_ptr, s, iterations)
s->flags |= SEC_RELOC;
s->owner->flags |= HAS_RELOC;
s->reloc_count++;
- if (r->relent.sym_ptr_ptr == 0)
- {
- r->relent.sym_ptr_ptr = section->symbol_ptr_ptr;
- }
+ if (r->relent.sym_ptr_ptr == NULL && section != NULL)
+ r->relent.sym_ptr_ptr = section->symbol_ptr_ptr;
if (this_byte (&(ieee->h)) == (int) ieee_comma)
{
@@ -1987,8 +1985,9 @@ ieee_canonicalize_reloc (abfd, section, relptr, symbols)
symbols + src->symbol.index + ieee->external_reference_base_offset;
break;
case 0:
- src->relent.sym_ptr_ptr =
- src->relent.sym_ptr_ptr[0]->section->symbol_ptr_ptr;
+ if (src->relent.sym_ptr_ptr != NULL)
+ src->relent.sym_ptr_ptr =
+ src->relent.sym_ptr_ptr[0]->section->symbol_ptr_ptr;
break;
default:
@@ -3642,9 +3641,11 @@ ieee_generic_stat_arch_elt (abfd, buf)
bfd *abfd;
struct stat *buf;
{
- ieee_ar_data_type *ar = abfd->my_archive->tdata.ieee_ar_data;
+ ieee_ar_data_type *ar = (ieee_ar_data_type *) NULL;
ieee_data_type *ieee;
+ if (abfd->my_archive != NULL)
+ ar = abfd->my_archive->tdata.ieee_ar_data;
if (ar == (ieee_ar_data_type *) NULL)
{
bfd_set_error (bfd_error_invalid_operation);
diff --git a/contrib/binutils/bfd/ihex.c b/contrib/binutils/bfd/ihex.c
index c70cfe0..e4b098e 100644
--- a/contrib/binutils/bfd/ihex.c
+++ b/contrib/binutils/bfd/ihex.c
@@ -1,5 +1,5 @@
/* BFD back-end for Intel Hex objects.
- Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -270,6 +270,7 @@ ihex_scan (abfd)
bfd *abfd;
{
bfd_vma segbase;
+ bfd_vma extbase;
asection *sec;
int lineno;
boolean error;
@@ -283,6 +284,7 @@ ihex_scan (abfd)
abfd->start_address = 0;
segbase = 0;
+ extbase = 0;
sec = NULL;
lineno = 1;
error = false;
@@ -376,7 +378,7 @@ ihex_scan (abfd)
case 0:
/* This is a data record. */
if (sec != NULL
- && sec->vma + sec->_raw_size == segbase + addr)
+ && sec->vma + sec->_raw_size == extbase + segbase + addr)
{
/* This data goes at the end of the section we are
currently building. */
@@ -396,8 +398,8 @@ ihex_scan (abfd)
if (sec == NULL)
goto error_return;
sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
- sec->vma = segbase + addr;
- sec->lma = segbase + addr;
+ sec->vma = extbase + segbase + addr;
+ sec->lma = extbase + segbase + addr;
sec->_raw_size = len;
sec->filepos = pos;
}
@@ -456,7 +458,7 @@ ihex_scan (abfd)
goto error_return;
}
- segbase = HEX4 (buf) << 16;
+ extbase = HEX4 (buf) << 16;
sec = NULL;
@@ -791,9 +793,11 @@ ihex_write_object_contents (abfd)
bfd *abfd;
{
bfd_vma segbase;
+ bfd_vma extbase;
struct ihex_data_list *l;
segbase = 0;
+ extbase = 0;
for (l = abfd->tdata.ihex_data->head; l != NULL; l = l->next)
{
bfd_vma where;
@@ -811,13 +815,16 @@ ihex_write_object_contents (abfd)
if (now > CHUNK)
now = CHUNK;
- if (where > segbase + 0xffff)
+ if (where > segbase + extbase + 0xffff)
{
bfd_byte addr[2];
/* We need a new base address. */
if (where <= 0xfffff)
{
+ /* The addresses should be sorted. */
+ BFD_ASSERT (extbase == 0);
+
segbase = where & 0xf0000;
addr[0] = (bfd_byte)(segbase >> 12) & 0xff;
addr[1] = (bfd_byte)(segbase >> 4) & 0xff;
@@ -826,8 +833,23 @@ ihex_write_object_contents (abfd)
}
else
{
- segbase = where & 0xffff0000;
- if (where > segbase + 0xffff)
+ /* The extended address record and the extended
+ linear address record are combined, at least by
+ some readers. We need an extended linear address
+ record here, so if we've already written out an
+ extended address record, zero it out to avoid
+ confusion. */
+ if (segbase != 0)
+ {
+ addr[0] = 0;
+ addr[1] = 0;
+ if (! ihex_write_record (abfd, 2, 0, 2, addr))
+ return false;
+ segbase = 0;
+ }
+
+ extbase = where & 0xffff0000;
+ if (where > extbase + 0xffff)
{
char buf[20];
@@ -838,14 +860,15 @@ ihex_write_object_contents (abfd)
bfd_set_error (bfd_error_bad_value);
return false;
}
- addr[0] = (bfd_byte)(segbase >> 24) & 0xff;
- addr[1] = (bfd_byte)(segbase >> 16) & 0xff;
+ addr[0] = (bfd_byte)(extbase >> 24) & 0xff;
+ addr[1] = (bfd_byte)(extbase >> 16) & 0xff;
if (! ihex_write_record (abfd, 2, 0, 4, addr))
return false;
}
}
- if (! ihex_write_record (abfd, now, where - segbase, 0, p))
+ if (! ihex_write_record (abfd, now, where - (extbase + segbase),
+ 0, p))
return false;
where += now;
diff --git a/contrib/binutils/bfd/libaout.h b/contrib/binutils/bfd/libaout.h
index 09c45d5..3e6a56a 100644
--- a/contrib/binutils/bfd/libaout.h
+++ b/contrib/binutils/bfd/libaout.h
@@ -1,5 +1,6 @@
/* BFD back-end data structures for a.out (and similar) files.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -228,6 +229,9 @@ enum machine_type {
M_68K4K_NETBSD = 136, /* NetBSD/m68k4k binary */
M_532_NETBSD = 137, /* NetBSD/ns32k binary */
M_SPARC_NETBSD = 138, /* NetBSD/sparc binary */
+ M_PMAX_NETBSD = 139, /* NetBSD/pmax (MIPS little-endian) binary */
+ M_VAX_NETBSD = 140, /* NetBSD/vax binary */
+ M_ALPHA_NETBSD = 141, /* NetBSD/alpha binary */
M_SPARCLET_1 = 147, /* 0x93, reserved */
M_MIPS1 = 151, /* MIPS R2000/R3000 binary */
M_MIPS2 = 152, /* MIPS R4000/R6000 binary */
diff --git a/contrib/binutils/bfd/libbfd-in.h b/contrib/binutils/bfd/libbfd-in.h
index 8e332dd..30911b2 100644
--- a/contrib/binutils/bfd/libbfd-in.h
+++ b/contrib/binutils/bfd/libbfd-in.h
@@ -1,6 +1,6 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Cygnus Support.
** NOTE: libbfd.h is a GENERATED file. Don't change it; instead,
@@ -24,9 +24,13 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Align an address upward to a boundary, expressed as a number of bytes.
- E.g. align to an 8-byte boundary with argument of 8. */
-#define BFD_ALIGN(this, boundary) \
- ((( (this) + ((boundary) -1)) & (~((boundary)-1))))
+ E.g. align to an 8-byte boundary with argument of 8. Take care never
+ to wrap around if the address is within boundary-1 of the end of the
+ address space. */
+#define BFD_ALIGN(this, boundary) \
+ ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
+ ? (((bfd_vma) (this) + ((boundary) - 1)) & (~((boundary)-1))) \
+ : ~ (bfd_vma) 0)
/* If you want to read and write large blocks, you might want to do it
in quanta of this amount */
@@ -348,6 +352,11 @@ extern boolean _bfd_stab_section_find_nearest_line
PARAMS ((bfd *, asymbol **, asection *, bfd_vma, boolean *, const char **,
const char **, unsigned int *, PTR *));
+/* Find the nearest line using DWARF 2 debugging information. */
+extern boolean _bfd_dwarf2_find_nearest_line
+ PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
+ const char **, unsigned int *));
+
/* A routine to create entries for a bfd_link_hash_table. */
extern struct bfd_hash_entry *_bfd_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *entry,
diff --git a/contrib/binutils/bfd/libbfd.c b/contrib/binutils/bfd/libbfd.c
index 5c18a48..042bdee 100644
--- a/contrib/binutils/bfd/libbfd.c
+++ b/contrib/binutils/bfd/libbfd.c
@@ -1,5 +1,6 @@
/* Assorted BFD support routines, only used internally.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -687,9 +688,20 @@ bfd_seek (abfd, position, direction)
if (result != 0)
{
+ int hold_errno = errno;
+
/* Force redetermination of `where' field. */
bfd_tell (abfd);
- bfd_set_error (bfd_error_system_call);
+
+ /* An EINVAL error probably means that the file offset was
+ absurd. */
+ if (hold_errno == EINVAL)
+ bfd_set_error (bfd_error_file_truncated);
+ else
+ {
+ bfd_set_error (bfd_error_system_call);
+ errno = hold_errno;
+ }
}
else
{
diff --git a/contrib/binutils/bfd/libbfd.h b/contrib/binutils/bfd/libbfd.h
index 815dcfb..296bf41 100644
--- a/contrib/binutils/bfd/libbfd.h
+++ b/contrib/binutils/bfd/libbfd.h
@@ -1,6 +1,6 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Cygnus Support.
** NOTE: libbfd.h is a GENERATED file. Don't change it; instead,
@@ -24,9 +24,13 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Align an address upward to a boundary, expressed as a number of bytes.
- E.g. align to an 8-byte boundary with argument of 8. */
-#define BFD_ALIGN(this, boundary) \
- ((( (this) + ((boundary) -1)) & (~((boundary)-1))))
+ E.g. align to an 8-byte boundary with argument of 8. Take care never
+ to wrap around if the address is within boundary-1 of the end of the
+ address space. */
+#define BFD_ALIGN(this, boundary) \
+ ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \
+ ? (((bfd_vma) (this) + ((boundary) - 1)) & (~((boundary)-1))) \
+ : ~ (bfd_vma) 0)
/* If you want to read and write large blocks, you might want to do it
in quanta of this amount */
@@ -348,6 +352,11 @@ extern boolean _bfd_stab_section_find_nearest_line
PARAMS ((bfd *, asymbol **, asection *, bfd_vma, boolean *, const char **,
const char **, unsigned int *, PTR *));
+/* Find the nearest line using DWARF 2 debugging information. */
+extern boolean _bfd_dwarf2_find_nearest_line
+ PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
+ const char **, unsigned int *));
+
/* A routine to create entries for a bfd_link_hash_table. */
extern struct bfd_hash_entry *_bfd_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *entry,
@@ -626,10 +635,16 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_SPARC_PC_LM22",
"BFD_RELOC_SPARC_WDISP16",
"BFD_RELOC_SPARC_WDISP19",
- "BFD_RELOC_SPARC_GLOB_JMP",
"BFD_RELOC_SPARC_7",
"BFD_RELOC_SPARC_6",
"BFD_RELOC_SPARC_5",
+ "BFD_RELOC_SPARC_PLT64",
+ "BFD_RELOC_SPARC_HIX22",
+ "BFD_RELOC_SPARC_LOX10",
+ "BFD_RELOC_SPARC_H44",
+ "BFD_RELOC_SPARC_M44",
+ "BFD_RELOC_SPARC_L44",
+ "BFD_RELOC_SPARC_REGISTER",
"BFD_RELOC_ALPHA_GPDISP_HI16",
"BFD_RELOC_ALPHA_GPDISP_LO16",
"BFD_RELOC_ALPHA_GPDISP",
@@ -654,6 +669,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MIPS_GOT_LO16",
"BFD_RELOC_MIPS_CALL_HI16",
"BFD_RELOC_MIPS_CALL_LO16",
+
"BFD_RELOC_386_GOT32",
"BFD_RELOC_386_PLT32",
"BFD_RELOC_386_COPY",
@@ -740,7 +756,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_SH_CODE",
"BFD_RELOC_SH_DATA",
"BFD_RELOC_SH_LABEL",
-
+ "BFD_RELOC_THUMB_PCREL_BRANCH9",
+ "BFD_RELOC_THUMB_PCREL_BRANCH12",
+ "BFD_RELOC_THUMB_PCREL_BRANCH23",
+ "BFD_RELOC_ARC_B22_PCREL",
+ "BFD_RELOC_ARC_B26",
"BFD_RELOC_D10V_10_PCREL_R",
"BFD_RELOC_D10V_10_PCREL_L",
"BFD_RELOC_D10V_18",
@@ -755,9 +775,20 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_M32R_HI16_SLO",
"BFD_RELOC_M32R_LO16",
"BFD_RELOC_M32R_SDA16",
+ "BFD_RELOC_V850_9_PCREL",
+ "BFD_RELOC_V850_22_PCREL",
+ "BFD_RELOC_V850_SDA_16_16_OFFSET",
+ "BFD_RELOC_V850_SDA_15_16_OFFSET",
+ "BFD_RELOC_V850_ZDA_16_16_OFFSET",
+ "BFD_RELOC_V850_ZDA_15_16_OFFSET",
+ "BFD_RELOC_V850_TDA_6_8_OFFSET",
+ "BFD_RELOC_V850_TDA_7_8_OFFSET",
+ "BFD_RELOC_V850_TDA_7_7_OFFSET",
+ "BFD_RELOC_V850_TDA_16_16_OFFSET",
"BFD_RELOC_MN10300_32_PCREL",
"BFD_RELOC_MN10300_16_PCREL",
+ "BFD_RELOC_TIC30_LDP",
"@@overflow: BFD_RELOC_UNUSED@@",
};
#endif
diff --git a/contrib/binutils/bfd/libcoff-in.h b/contrib/binutils/bfd/libcoff-in.h
index 7cd047e..0dc2121 100644
--- a/contrib/binutils/bfd/libcoff-in.h
+++ b/contrib/binutils/bfd/libcoff-in.h
@@ -1,5 +1,5 @@
/* BFD COFF object file private structure.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -96,6 +96,11 @@ typedef struct coff_tdata
/* Used by coff_find_nearest_line. */
PTR line_info;
+
+ /* Copy of some of the f_flags bits in the COFF filehdr structure,
+ used by ARM code. */
+ flagword flags;
+
} coff_data_type;
/* Tdata for pe image files. */
@@ -417,6 +422,10 @@ struct coff_final_link_info
bfd *output_bfd;
/* Used to indicate failure in traversal routine. */
boolean failed;
+ /* If doing "task linking" set only during the time when we want the
+ global symbol writer to convert the storage class of defined global
+ symbols from global to static. */
+ boolean global_to_static;
/* Hash table for long symbol names. */
struct bfd_strtab_hash *strtab;
/* When doing a relocateable link, an array of information kept for
@@ -479,6 +488,8 @@ extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
extern boolean _bfd_coff_write_global_sym
PARAMS ((struct coff_link_hash_entry *, PTR));
+extern boolean _bfd_coff_write_task_globals
+ PARAMS ((struct coff_link_hash_entry *, PTR));
extern boolean _bfd_coff_link_input_bfd
PARAMS ((struct coff_final_link_info *, bfd *));
extern boolean _bfd_coff_reloc_link_order
diff --git a/contrib/binutils/bfd/libcoff.h b/contrib/binutils/bfd/libcoff.h
index d525cfd..4d83bd4 100644
--- a/contrib/binutils/bfd/libcoff.h
+++ b/contrib/binutils/bfd/libcoff.h
@@ -1,5 +1,5 @@
/* BFD COFF object file private structure.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -96,6 +96,11 @@ typedef struct coff_tdata
/* Used by coff_find_nearest_line. */
PTR line_info;
+
+ /* Copy of some of the f_flags bits in the COFF filehdr structure,
+ used by ARM code. */
+ flagword flags;
+
} coff_data_type;
/* Tdata for pe image files. */
@@ -417,6 +422,10 @@ struct coff_final_link_info
bfd *output_bfd;
/* Used to indicate failure in traversal routine. */
boolean failed;
+ /* If doing "task linking" set only during the time when we want the
+ global symbol writer to convert the storage class of defined global
+ symbols from global to static. */
+ boolean global_to_static;
/* Hash table for long symbol names. */
struct bfd_strtab_hash *strtab;
/* When doing a relocateable link, an array of information kept for
@@ -479,6 +488,8 @@ extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
extern boolean _bfd_coff_write_global_sym
PARAMS ((struct coff_link_hash_entry *, PTR));
+extern boolean _bfd_coff_write_task_globals
+ PARAMS ((struct coff_link_hash_entry *, PTR));
extern boolean _bfd_coff_link_input_bfd
PARAMS ((struct coff_final_link_info *, bfd *));
extern boolean _bfd_coff_reloc_link_order
@@ -592,43 +603,43 @@ typedef struct
PTR in));
unsigned int (*_bfd_coff_swap_aux_out) PARAMS ((
- bfd *abfd,
- PTR in,
- int type,
- int class,
+ bfd *abfd,
+ PTR in,
+ int type,
+ int class,
int indaux,
int numaux,
- PTR ext));
+ PTR ext));
unsigned int (*_bfd_coff_swap_sym_out) PARAMS ((
bfd *abfd,
- PTR in,
- PTR ext));
+ PTR in,
+ PTR ext));
unsigned int (*_bfd_coff_swap_lineno_out) PARAMS ((
- bfd *abfd,
- PTR in,
- PTR ext));
+ bfd *abfd,
+ PTR in,
+ PTR ext));
unsigned int (*_bfd_coff_swap_reloc_out) PARAMS ((
- bfd *abfd,
- PTR src,
- PTR dst));
+ bfd *abfd,
+ PTR src,
+ PTR dst));
unsigned int (*_bfd_coff_swap_filehdr_out) PARAMS ((
- bfd *abfd,
- PTR in,
- PTR out));
+ bfd *abfd,
+ PTR in,
+ PTR out));
unsigned int (*_bfd_coff_swap_aouthdr_out) PARAMS ((
- bfd *abfd,
- PTR in,
- PTR out));
+ bfd *abfd,
+ PTR in,
+ PTR out));
unsigned int (*_bfd_coff_swap_scnhdr_out) PARAMS ((
- bfd *abfd,
- PTR in,
- PTR out));
+ bfd *abfd,
+ PTR in,
+ PTR out));
unsigned int _bfd_filhsz;
unsigned int _bfd_aoutsz;
@@ -749,6 +760,12 @@ typedef struct
boolean collect,
struct bfd_link_hash_entry **hashp));
+ boolean (*_bfd_coff_link_output_has_begun) PARAMS ((
+ bfd * abfd ));
+ boolean (*_bfd_coff_final_link_postscript) PARAMS ((
+ bfd * abfd,
+ struct coff_final_link_info * pfinfo));
+
} bfd_coff_backend_data;
#define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
@@ -794,7 +811,7 @@ typedef struct
#define bfd_coff_long_section_names(abfd) \
(coff_backend_info (abfd)->_bfd_coff_long_section_names)
#define bfd_coff_default_section_alignment_power(abfd) \
- (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
+ (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
#define bfd_coff_swap_filehdr_in(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
@@ -863,3 +880,8 @@ typedef struct
((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
(info, abfd, name, flags, section, value, string, cp, coll, hashp))
+#define bfd_coff_link_output_has_begun(a) \
+ ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a))
+#define bfd_coff_final_link_postscript(a,p) \
+ ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p))
+
diff --git a/contrib/binutils/bfd/linker.c b/contrib/binutils/bfd/linker.c
index d508bb2..1c3c9a2 100644
--- a/contrib/binutils/bfd/linker.c
+++ b/contrib/binutils/bfd/linker.c
@@ -1319,14 +1319,14 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect)
if (bfd_is_com_section (bfd_get_section (p)))
p->flags |= BSF_OLD_COMMON;
}
-
- /* Store a back pointer from the symbol to the hash
- table entry for the benefit of relaxation code until
- it gets rewritten to not use asymbol structures.
- Setting this is also used to check whether these
- symbols were set up by the generic linker. */
- p->udata.p = (PTR) h;
}
+
+ /* Store a back pointer from the symbol to the hash
+ table entry for the benefit of relaxation code until
+ it gets rewritten to not use asymbol structures.
+ Setting this is also used to check whether these
+ symbols were set up by the generic linker. */
+ p->udata.p = (PTR) h;
}
}
@@ -1394,7 +1394,7 @@ static const enum link_action link_action[8][8] =
/* UNDEFW_ROW */ {WEAK, NOACT, NOACT, REF, REF, NOACT, REFC, WARNC },
/* DEF_ROW */ {DEF, DEF, DEF, MDEF, DEF, CDEF, MDEF, CYCLE },
/* DEFW_ROW */ {DEFW, DEFW, DEFW, NOACT, NOACT, NOACT, NOACT, CYCLE },
- /* COMMON_ROW */ {COM, COM, COM, CREF, CREF, BIG, CREF, WARNC },
+ /* COMMON_ROW */ {COM, COM, COM, CREF, CREF, BIG, REFC, WARNC },
/* INDR_ROW */ {IND, IND, IND, MDEF, IND, CIND, MIND, CYCLE },
/* WARN_ROW */ {MWARN, WARN, WARN, CWARN, CWARN, WARN, CWARN, MWARN },
/* SET_ROW */ {SET, SET, SET, SET, SET, SET, CYCLE, CYCLE }
diff --git a/contrib/binutils/bfd/netbsd-core.c b/contrib/binutils/bfd/netbsd-core.c
index 40500e8..41fab99 100644
--- a/contrib/binutils/bfd/netbsd-core.c
+++ b/contrib/binutils/bfd/netbsd-core.c
@@ -1,5 +1,5 @@
/* BFD back end for NetBSD style core files
- Copyright 1988, 1989, 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
+ Copyright 1988, 89, 91, 92, 93, 96, 1998 Free Software Foundation, Inc.
Written by Paul Kranenburg, EUR
This file is part of BFD, the Binary File Descriptor library.
@@ -41,10 +41,10 @@ struct netbsd_core_struct {
/* forward declarations */
-static const bfd_target * netbsd_core_core_file_p PARAMS ((bfd *abfd));
-static char * netbsd_core_core_file_failing_command PARAMS ((bfd *abfd));
-static int netbsd_core_core_file_failing_signal PARAMS ((bfd *abfd));
-static boolean netbsd_core_core_file_matches_executable_p
+static const bfd_target * netbsd_core_file_p PARAMS ((bfd *abfd));
+static char * netbsd_core_file_failing_command PARAMS ((bfd *abfd));
+static int netbsd_core_file_failing_signal PARAMS ((bfd *abfd));
+static boolean netbsd_core_file_matches_executable_p
PARAMS ((bfd *core_bfd, bfd *exec_bfd));
static void swap_abort PARAMS ((void));
@@ -52,7 +52,7 @@ static void swap_abort PARAMS ((void));
/* ARGSUSED */
static const bfd_target *
-netbsd_core_core_file_p (abfd)
+netbsd_core_file_p (abfd)
bfd *abfd;
{
@@ -104,6 +104,7 @@ netbsd_core_core_file_p (abfd)
asect = (asection *) bfd_zalloc (abfd, sizeof(asection));
if (asect == NULL) {
bfd_set_error(bfd_error_no_memory);
+ goto punt;
}
asect->_raw_size = coreseg.c_size;
@@ -169,7 +170,7 @@ punt: {
}
static char*
-netbsd_core_core_file_failing_command (abfd)
+netbsd_core_file_failing_command (abfd)
bfd *abfd;
{
/*return core_command (abfd);*/
@@ -178,7 +179,7 @@ netbsd_core_core_file_failing_command (abfd)
/* ARGSUSED */
static int
-netbsd_core_core_file_failing_signal (abfd)
+netbsd_core_file_failing_signal (abfd)
bfd *abfd;
{
/*return core_signal (abfd);*/
@@ -187,69 +188,12 @@ netbsd_core_core_file_failing_signal (abfd)
/* ARGSUSED */
static boolean
-netbsd_core_core_file_matches_executable_p (core_bfd, exec_bfd)
+netbsd_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd, *exec_bfd;
{
- return true; /* FIXME, We have no way of telling at this point */
+ return true; /* FIXME, We have no way of telling at this point */
}
-/* No archive file support via this BFD */
-#define netbsd_openr_next_archived_file bfd_generic_openr_next_archived_file
-#define netbsd_generic_stat_arch_elt bfd_generic_stat_arch_elt
-#define netbsd_slurp_armap bfd_false
-#define netbsd_slurp_extended_name_table bfd_true
-#define netbsd_write_armap (boolean (*) PARAMS \
- ((bfd *arch, unsigned int elength, struct orl *map, \
- unsigned int orl_count, int stridx))) bfd_false
-#define netbsd_truncate_arname bfd_dont_truncate_arname
-#define aout_32_openr_next_archived_file bfd_generic_openr_next_archived_file
-
-#define netbsd_close_and_cleanup bfd_generic_close_and_cleanup
-#define netbsd_set_section_contents (boolean (*) PARAMS \
- ((bfd *abfd, asection *section, PTR data, file_ptr offset, \
- bfd_size_type count))) bfd_false
-#define netbsd_get_section_contents bfd_generic_get_section_contents
-#define netbsd_new_section_hook (boolean (*) PARAMS \
- ((bfd *, sec_ptr))) bfd_true
-#define netbsd_get_symtab_upper_bound bfd_0u
-#define netbsd_get_symtab (unsigned int (*) PARAMS \
- ((bfd *, struct symbol_cache_entry **))) bfd_0u
-#define netbsd_get_reloc_upper_bound (unsigned int (*) PARAMS \
- ((bfd *, sec_ptr))) bfd_0u
-#define netbsd_canonicalize_reloc (unsigned int (*) PARAMS \
- ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0u
-#define netbsd_make_empty_symbol (struct symbol_cache_entry * \
- (*) PARAMS ((bfd *))) bfd_false
-#define netbsd_print_symbol (void (*) PARAMS \
- ((bfd *, PTR, struct symbol_cache_entry *, \
- bfd_print_symbol_type))) bfd_false
-#define netbsd_get_symbol_info (void (*) PARAMS \
- ((bfd *, struct symbol_cache_entry *, \
- symbol_info *))) bfd_false
-#define netbsd_get_lineno (alent * (*) PARAMS \
- ((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr
-#define netbsd_set_arch_mach (boolean (*) PARAMS \
- ((bfd *, enum bfd_architecture, unsigned long))) bfd_false
-#define netbsd_find_nearest_line (boolean (*) PARAMS \
- ((bfd *abfd, struct sec *section, \
- struct symbol_cache_entry **symbols,bfd_vma offset, \
- CONST char **file, CONST char **func, unsigned int *line))) bfd_false
-#define netbsd_sizeof_headers (int (*) PARAMS \
- ((bfd *, boolean))) bfd_0
-
-#define netbsd_bfd_debug_info_start bfd_void
-#define netbsd_bfd_debug_info_end bfd_void
-#define netbsd_bfd_debug_info_accumulate (void (*) PARAMS \
- ((bfd *, struct sec *))) bfd_void
-#define netbsd_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define netbsd_bfd_relax_section bfd_generic_relax_section
-#define netbsd_bfd_seclet_link \
- ((boolean (*) PARAMS ((bfd *, PTR, boolean))) bfd_false)
-#define netbsd_bfd_reloc_type_lookup \
- ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr)
-#define netbsd_bfd_make_debug_symbol \
- ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
-
/* If somebody calls any byte-swapping routines, shoot them. */
static void
swap_abort()
@@ -259,17 +203,17 @@ swap_abort()
#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
#define NO_SIGNED_GET \
- ((bfd_signed_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
+ ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
const bfd_target netbsd_core_vec =
{
"netbsd-core",
bfd_target_unknown_flavour,
- true, /* target byte order */
- true, /* target headers byte order */
+ BFD_ENDIAN_UNKNOWN, /* target byte order */
+ BFD_ENDIAN_UNKNOWN, /* target headers byte order */
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
- HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
0, /* symbol prefix */
' ', /* ar_pad_char */
@@ -285,7 +229,7 @@ const bfd_target netbsd_core_vec =
_bfd_dummy_target, /* unknown format */
_bfd_dummy_target, /* object file */
_bfd_dummy_target, /* archive */
- netbsd_core_core_file_p /* a core file */
+ netbsd_core_file_p /* a core file */
},
{ /* bfd_set_format */
bfd_false, bfd_false,
@@ -298,7 +242,7 @@ const bfd_target netbsd_core_vec =
BFD_JUMP_TABLE_GENERIC (_bfd_generic),
BFD_JUMP_TABLE_COPY (_bfd_generic),
- BFD_JUMP_TABLE_CORE (netbsd_core),
+ BFD_JUMP_TABLE_CORE (netbsd),
BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols),
BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
diff --git a/contrib/binutils/bfd/netbsd.h b/contrib/binutils/bfd/netbsd.h
index ad3ec9c..ba0ce5a 100644
--- a/contrib/binutils/bfd/netbsd.h
+++ b/contrib/binutils/bfd/netbsd.h
@@ -1,5 +1,6 @@
/* BFD back-end definitions used by all NetBSD targets.
- Copyright (C) 1990, 91, 92, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 94, 95, 96, 97 1998
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -15,8 +16,13 @@ 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.
-*/
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA. */
+
+/* Check for our machine type (part of magic number). */
+#ifndef MACHTYPE_OK
+#define MACHTYPE_OK(m) ((m) == DEFAULT_MID || (m) == M_UNKNOWN)
+#endif
/* This is the normal load address for executables. */
#define TEXT_START_ADDR TARGET_PAGE_SIZE
@@ -93,20 +99,8 @@ MY(write_object_contents) (abfd)
/* Magic number, maestro, please! */
switch (bfd_get_arch(abfd)) {
- case bfd_arch_m68k:
- if (strcmp (abfd->xvec->name, "a.out-m68k4k-netbsd") == 0)
- N_SET_MACHTYPE(*execp, M_68K4K_NETBSD);
- else
- N_SET_MACHTYPE(*execp, M_68K_NETBSD);
- break;
- case bfd_arch_sparc:
- N_SET_MACHTYPE(*execp, M_SPARC_NETBSD);
- break;
- case bfd_arch_i386:
- N_SET_MACHTYPE(*execp, M_386_NETBSD);
- break;
- case bfd_arch_ns32k:
- N_SET_MACHTYPE(*execp, M_532_NETBSD);
+ case DEFAULT_ARCH:
+ N_SET_MACHTYPE(*execp, DEFAULT_MID);
break;
default:
N_SET_MACHTYPE(*execp, M_UNKNOWN);
diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c
index 142a32a..c58173c 100644
--- a/contrib/binutils/bfd/opncls.c
+++ b/contrib/binutils/bfd/opncls.c
@@ -220,16 +220,17 @@ bfd_fdopenr (filename, target, fd)
return NULL;
}
-#if defined(VMS) || defined(__GO32__)
- nbfd->iostream = (PTR)fopen(filename, FOPEN_RB);
+#ifndef HAVE_FDOPEN
+ nbfd->iostream = (PTR) fopen (filename, FOPEN_RB);
#else
/* (O_ACCMODE) parens are to avoid Ultrix header file bug */
- switch (fdflags & (O_ACCMODE)) {
- case O_RDONLY: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RB); break;
- case O_WRONLY: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RUB); break;
- case O_RDWR: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RUB); break;
- default: abort ();
- }
+ switch (fdflags & (O_ACCMODE))
+ {
+ case O_RDONLY: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RB); break;
+ case O_WRONLY: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RUB); break;
+ case O_RDWR: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RUB); break;
+ default: abort ();
+ }
#endif
if (nbfd->iostream == NULL)
diff --git a/contrib/binutils/bfd/reloc.c b/contrib/binutils/bfd/reloc.c
index c2a94ed..dda7624 100644
--- a/contrib/binutils/bfd/reloc.c
+++ b/contrib/binutils/bfd/reloc.c
@@ -1,5 +1,5 @@
/* BFD support for handling relocation entries.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -411,14 +411,14 @@ FUNCTION
bfd_get_reloc_size
SYNOPSIS
- int bfd_get_reloc_size (reloc_howto_type *);
+ unsigned int bfd_get_reloc_size (reloc_howto_type *);
DESCRIPTION
For a reloc_howto_type that operates on a fixed number of bytes,
this returns the number of bytes operated on.
*/
-int
+unsigned int
bfd_get_reloc_size (howto)
reloc_howto_type *howto;
{
@@ -451,6 +451,110 @@ DESCRIPTION
*/
+/*
+FUNCTION
+ bfd_check_overflow
+
+SYNOPSIS
+ bfd_reloc_status_type
+ bfd_check_overflow
+ (enum complain_overflow how,
+ unsigned int bitsize,
+ unsigned int rightshift,
+ bfd_vma relocation);
+
+DESCRIPTION
+ Perform overflow checking on @var{relocation} which has @var{bitsize}
+ significant bits and will be shifted right by @var{rightshift} bits.
+ The result is either of @code{bfd_reloc_ok} or
+ @code{bfd_reloc_overflow}.
+
+*/
+
+bfd_reloc_status_type
+bfd_check_overflow (how, bitsize, rightshift, relocation)
+ enum complain_overflow how;
+ unsigned int bitsize, rightshift;
+ bfd_vma relocation;
+{
+ bfd_vma check;
+ bfd_reloc_status_type flag = bfd_reloc_ok;
+
+ /* Get the value that will be used for the relocation, but
+ starting at bit position zero. */
+ check = relocation >> rightshift;
+
+ switch (how)
+ {
+ case complain_overflow_dont:
+ break;
+
+ case complain_overflow_signed:
+ {
+ /* Assumes two's complement. */
+ bfd_signed_vma reloc_signed_max = (1 << (bitsize - 1)) - 1;
+ bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
+
+ /* The above right shift is incorrect for a signed value.
+ Fix it up by forcing on the upper bits. */
+ if (rightshift > 0
+ && (bfd_signed_vma) relocation < 0)
+ check |= ((bfd_vma) - 1
+ & ~((bfd_vma) - 1
+ >> rightshift));
+ if ((bfd_signed_vma) check > reloc_signed_max
+ || (bfd_signed_vma) check < reloc_signed_min)
+ flag = bfd_reloc_overflow;
+ }
+ break;
+
+ case complain_overflow_unsigned:
+ {
+ /* Assumes two's complement. This expression avoids
+ overflow if `bitsize' is the number of bits in
+ bfd_vma. */
+ bfd_vma reloc_unsigned_max = (((1 << (bitsize - 1)) - 1) << 1) | 1;
+
+ if ((bfd_vma) check > reloc_unsigned_max)
+ flag = bfd_reloc_overflow;
+ }
+ break;
+
+ case complain_overflow_bitfield:
+ {
+ /* Assumes two's complement. This expression avoids
+ overflow if `bitsize' is the number of bits in
+ bfd_vma. */
+ bfd_vma reloc_bits = (((1 << (bitsize - 1)) - 1) << 1) | 1;
+
+ if (((bfd_vma) check & ~reloc_bits) != 0
+ && ((bfd_vma) check & ~reloc_bits) != (-1 & ~reloc_bits))
+ {
+ /* The above right shift is incorrect for a signed
+ value. See if turning on the upper bits fixes the
+ overflow. */
+ if (rightshift > 0
+ && (bfd_signed_vma) relocation < 0)
+ {
+ check |= ((bfd_vma) - 1
+ & ~((bfd_vma) - 1
+ >> rightshift));
+ if (((bfd_vma) check & ~reloc_bits) != (-1 & ~reloc_bits))
+ flag = bfd_reloc_overflow;
+ }
+ else
+ flag = bfd_reloc_overflow;
+ }
+ }
+ break;
+
+ default:
+ abort ();
+ }
+
+ return flag;
+}
+
/*
FUNCTION
@@ -721,75 +825,8 @@ space consuming. For each target:
adding in the value contained in the object file. */
if (howto->complain_on_overflow != complain_overflow_dont
&& flag == bfd_reloc_ok)
- {
- bfd_vma check;
-
- /* Get the value that will be used for the relocation, but
- starting at bit position zero. */
- check = relocation >> howto->rightshift;
- switch (howto->complain_on_overflow)
- {
- case complain_overflow_signed:
- {
- /* Assumes two's complement. */
- bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
- bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
-
- /* The above right shift is incorrect for a signed value.
- Fix it up by forcing on the upper bits. */
- if (howto->rightshift > 0
- && (bfd_signed_vma) relocation < 0)
- check |= ((bfd_vma) - 1
- & ~((bfd_vma) - 1
- >> howto->rightshift));
- if ((bfd_signed_vma) check > reloc_signed_max
- || (bfd_signed_vma) check < reloc_signed_min)
- flag = bfd_reloc_overflow;
- }
- break;
- case complain_overflow_unsigned:
- {
- /* Assumes two's complement. This expression avoids
- overflow if howto->bitsize is the number of bits in
- bfd_vma. */
- bfd_vma reloc_unsigned_max =
- (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
-
- if ((bfd_vma) check > reloc_unsigned_max)
- flag = bfd_reloc_overflow;
- }
- break;
- case complain_overflow_bitfield:
- {
- /* Assumes two's complement. This expression avoids
- overflow if howto->bitsize is the number of bits in
- bfd_vma. */
- bfd_vma reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
-
- if (((bfd_vma) check & ~reloc_bits) != 0
- && ((bfd_vma) check & ~reloc_bits) != (-1 & ~reloc_bits))
- {
- /* The above right shift is incorrect for a signed
- value. See if turning on the upper bits fixes the
- overflow. */
- if (howto->rightshift > 0
- && (bfd_signed_vma) relocation < 0)
- {
- check |= ((bfd_vma) - 1
- & ~((bfd_vma) - 1
- >> howto->rightshift));
- if (((bfd_vma) check & ~reloc_bits) != (-1 & ~reloc_bits))
- flag = bfd_reloc_overflow;
- }
- else
- flag = bfd_reloc_overflow;
- }
- }
- break;
- default:
- abort ();
- }
- }
+ flag = bfd_check_overflow (howto->complain_on_overflow, howto->bitsize,
+ howto->rightshift, relocation);
/*
Either we are relocating all the way, or we don't want to apply
@@ -983,6 +1020,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
if (howto->special_function)
{
bfd_reloc_status_type cont;
+
/* XXX - The special_function calls haven't been fixed up to deal
with creating new relocations and section contents. */
cont = howto->special_function (abfd, reloc_entry, symbol,
@@ -1007,7 +1045,6 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
else
relocation = symbol->value;
-
reloc_target_output_section = symbol->section->output_section;
/* Convert input-section-relative symbol value to absolute. */
@@ -1172,79 +1209,11 @@ space consuming. For each target:
need to compute the value in a size larger than bitsize, but we
can't reasonably do that for a reloc the same size as a host
machine word.
-
FIXME: We should also do overflow checking on the result after
adding in the value contained in the object file. */
if (howto->complain_on_overflow != complain_overflow_dont)
- {
- bfd_vma check;
-
- /* Get the value that will be used for the relocation, but
- starting at bit position zero. */
- check = relocation >> howto->rightshift;
- switch (howto->complain_on_overflow)
- {
- case complain_overflow_signed:
- {
- /* Assumes two's complement. */
- bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
- bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
-
- /* The above right shift is incorrect for a signed value.
- Fix it up by forcing on the upper bits. */
- if (howto->rightshift > 0
- && (bfd_signed_vma) relocation < 0)
- check |= ((bfd_vma) - 1
- & ~((bfd_vma) - 1
- >> howto->rightshift));
- if ((bfd_signed_vma) check > reloc_signed_max
- || (bfd_signed_vma) check < reloc_signed_min)
- flag = bfd_reloc_overflow;
- }
- break;
- case complain_overflow_unsigned:
- {
- /* Assumes two's complement. This expression avoids
- overflow if howto->bitsize is the number of bits in
- bfd_vma. */
- bfd_vma reloc_unsigned_max =
- (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
-
- if ((bfd_vma) check > reloc_unsigned_max)
- flag = bfd_reloc_overflow;
- }
- break;
- case complain_overflow_bitfield:
- {
- /* Assumes two's complement. This expression avoids
- overflow if howto->bitsize is the number of bits in
- bfd_vma. */
- bfd_vma reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
-
- if (((bfd_vma) check & ~reloc_bits) != 0
- && ((bfd_vma) check & ~reloc_bits) != (-1 & ~reloc_bits))
- {
- /* The above right shift is incorrect for a signed
- value. See if turning on the upper bits fixes the
- overflow. */
- if (howto->rightshift > 0
- && (bfd_signed_vma) relocation < 0)
- {
- check |= ((bfd_vma) - 1
- & ~((bfd_vma) - 1
- >> howto->rightshift));
- if (((bfd_vma) check & ~reloc_bits) != (-1 & ~reloc_bits))
- flag = bfd_reloc_overflow;
- }
- else
- flag = bfd_reloc_overflow;
- }
- }
- break;
- default:
- abort ();
- }
- }
+ flag = bfd_check_overflow (howto->complain_on_overflow, howto->bitsize,
+ howto->rightshift, relocation);
/*
Either we are relocating all the way, or we don't want to apply
@@ -1376,8 +1345,9 @@ space consuming. For each target:
bfd_perform_relocation is so hacked up it is easier to write a new
function than to try to deal with it.
- This routine does a final relocation. It should not be used when
- generating relocateable output.
+ This routine does a final relocation. Whether it is useful for a
+ relocateable link depends upon how the object format defines
+ relocations.
FIXME: This routine ignores any special_function in the HOWTO,
since the existing special_function values have been written for
@@ -1870,15 +1840,30 @@ ENUMX
ENUMX
BFD_RELOC_SPARC_WDISP19
ENUMX
- BFD_RELOC_SPARC_GLOB_JMP
-ENUMX
BFD_RELOC_SPARC_7
ENUMX
BFD_RELOC_SPARC_6
ENUMX
BFD_RELOC_SPARC_5
+ENUMEQX
+ BFD_RELOC_SPARC_DISP64
+ BFD_RELOC_64_PCREL
+ENUMX
+ BFD_RELOC_SPARC_PLT64
+ENUMX
+ BFD_RELOC_SPARC_HIX22
+ENUMX
+ BFD_RELOC_SPARC_LOX10
+ENUMX
+ BFD_RELOC_SPARC_H44
+ENUMX
+ BFD_RELOC_SPARC_M44
+ENUMX
+ BFD_RELOC_SPARC_L44
+ENUMX
+ BFD_RELOC_SPARC_REGISTER
ENUMDOC
- Some relocations we're using for SPARC V9 -- subject to change.
+ SPARC64 relocations
ENUM
BFD_RELOC_ALPHA_GPDISP_HI16
@@ -2022,9 +2007,12 @@ ENUMX
BFD_RELOC_MIPS_CALL_HI16
ENUMX
BFD_RELOC_MIPS_CALL_LO16
+COMMENT
ENUMDOC
MIPS ELF relocations.
+COMMENT
+
ENUM
BFD_RELOC_386_GOT32
ENUMX
@@ -2221,7 +2209,29 @@ ENUMX
ENUMDOC
Hitachi SH relocs. Not all of these appear in object files.
-COMMENT
+ENUM
+ BFD_RELOC_THUMB_PCREL_BRANCH9
+ENUMX
+ BFD_RELOC_THUMB_PCREL_BRANCH12
+ENUMX
+ BFD_RELOC_THUMB_PCREL_BRANCH23
+ENUMDOC
+ Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
+ be zero and is not stored in the instruction.
+
+ENUM
+ BFD_RELOC_ARC_B22_PCREL
+ENUMDOC
+ Argonaut RISC Core (ARC) relocs.
+ ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
+ not stored in the instruction. The high 20 bits are installed in bits 26
+ through 7 of the instruction.
+ENUM
+ BFD_RELOC_ARC_B26
+ENUMDOC
+ ARC 26 bit absolute branch. The lowest two bits must be zero and are not
+ stored in the instruction. The high 24 bits are installed in bits 23
+ through 0.
COMMENT
ENUM
@@ -2289,6 +2299,51 @@ ENUMDOC
This is a 16-bit reloc containing the small data area offset for use in
add3, load, and store instructions.
+ENUM
+ BFD_RELOC_V850_9_PCREL
+ENUMDOC
+ This is a 9-bit reloc
+ENUM
+ BFD_RELOC_V850_22_PCREL
+ENUMDOC
+ This is a 22-bit reloc
+
+ENUM
+ BFD_RELOC_V850_SDA_16_16_OFFSET
+ENUMDOC
+ This is a 16 bit offset from the short data area pointer.
+ENUM
+ BFD_RELOC_V850_SDA_15_16_OFFSET
+ENUMDOC
+ This is a 16 bit offset (of which only 15 bits are used) from the
+ short data area pointer.
+ENUM
+ BFD_RELOC_V850_ZDA_16_16_OFFSET
+ENUMDOC
+ This is a 16 bit offset from the zero data area pointer.
+ENUM
+ BFD_RELOC_V850_ZDA_15_16_OFFSET
+ENUMDOC
+ This is a 16 bit offset (of which only 15 bits are used) from the
+ zero data area pointer.
+ENUM
+ BFD_RELOC_V850_TDA_6_8_OFFSET
+ENUMDOC
+ This is an 8 bit offset (of which only 6 bits are used) from the
+ tiny data area pointer.
+ENUM
+ BFD_RELOC_V850_TDA_7_8_OFFSET
+ENUMDOC
+ This is an 8bit offset (of which only 7 bits are used) from the tiny
+ data area pointer.
+ENUM
+ BFD_RELOC_V850_TDA_7_7_OFFSET
+ENUMDOC
+ This is a 7 bit offset from the tiny data area pointer.
+ENUM
+ BFD_RELOC_V850_TDA_16_16_OFFSET
+ENUMDOC
+ This is a 16 bit offset from the tiny data area pointer.
COMMENT
ENUM
@@ -2301,6 +2356,14 @@ ENUM
ENUMDOC
This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
instruction.
+
+ENUM
+ BFD_RELOC_TIC30_LDP
+ENUMDOC
+ This is a 8bit DP reloc for the tms320c30, where the most
+ significant 8 bits of a 24 bit word are placed into the least
+ significant 8 bits of the opcode.
+
ENDSENUM
BFD_RELOC_UNUSED
CODE_FRAGMENT
diff --git a/contrib/binutils/bfd/reloc16.c b/contrib/binutils/bfd/reloc16.c
index 999d7f4..7e7952e 100644
--- a/contrib/binutils/bfd/reloc16.c
+++ b/contrib/binutils/bfd/reloc16.c
@@ -1,5 +1,6 @@
/* 8 and 16 bit COFF relocation functions, for BFD.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -147,7 +148,7 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again)
/* Get enough memory to hold the stuff */
bfd *input_bfd = i->owner;
asection *input_section = i;
- unsigned *shrinks;
+ int *shrinks;
int shrink = 0;
long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
arelent **reloc_vector = NULL;
@@ -194,13 +195,14 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again)
int another_pass = 0;
/* Allocate and initialize the shrinks array for this section. */
- shrinks = (unsigned *)bfd_malloc (reloc_count * sizeof (unsigned));
- memset (shrinks, 0, reloc_count * sizeof (unsigned));
+ shrinks = (int *) bfd_malloc (reloc_count * sizeof (int));
+ memset (shrinks, 0, reloc_count * sizeof (int));
/* Loop until nothing changes in this section. */
do {
arelent **parent;
- unsigned int i, j;
+ unsigned int i;
+ long j;
another_pass = 0;
diff --git a/contrib/binutils/bfd/srec.c b/contrib/binutils/bfd/srec.c
index 3e45b3b..1386ebd 100644
--- a/contrib/binutils/bfd/srec.c
+++ b/contrib/binutils/bfd/srec.c
@@ -1,5 +1,6 @@
/* BFD back-end for s-record objects.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -406,7 +407,7 @@ srec_scan (abfd)
while ((c = srec_get_byte (abfd, &error)) != EOF
&& ! isspace (c))
{
- if (p - symbuf >= alc)
+ if ((unsigned int) (p - symbuf) >= alc)
{
char *n;
diff --git a/contrib/binutils/bfd/stabs.c b/contrib/binutils/bfd/stabs.c
index 783fcfb..77c7352 100644
--- a/contrib/binutils/bfd/stabs.c
+++ b/contrib/binutils/bfd/stabs.c
@@ -1,5 +1,5 @@
/* Stabs in sections linking support.
- Copyright 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -566,7 +566,7 @@ _bfd_write_section_stabs (output_bfd, psinfo, stabsec, psecinfo, contents)
}
}
- BFD_ASSERT (tosym - contents == stabsec->_cooked_size);
+ BFD_ASSERT ((bfd_size_type) (tosym - contents) == stabsec->_cooked_size);
return bfd_set_section_contents (output_bfd, stabsec->output_section,
contents, stabsec->output_offset,
diff --git a/contrib/binutils/bfd/stamp-h.in b/contrib/binutils/bfd/stamp-h.in
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/contrib/binutils/bfd/stamp-h.in
@@ -0,0 +1 @@
+timestamp
diff --git a/contrib/binutils/bfd/syms.c b/contrib/binutils/bfd/syms.c
index fbff74a..d39e7d87 100644
--- a/contrib/binutils/bfd/syms.c
+++ b/contrib/binutils/bfd/syms.c
@@ -1,5 +1,5 @@
/* Generic symbol-table support for the BFD library.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -715,6 +715,42 @@ _bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym)
placed in *pinfo should be saved with the BFD, and passed back each
time this function is called. */
+/* We use a cache by default. */
+
+#define ENABLE_CACHING
+
+/* We keep an array of indexentry structures to record where in the
+ stabs section we should look to find line number information for a
+ particular address. */
+
+struct indexentry
+{
+ bfd_vma val;
+ bfd_byte *stab;
+ bfd_byte *str;
+ char *directory_name;
+ char *file_name;
+ char *function_name;
+};
+
+/* Compare two indexentry structures. This is called via qsort. */
+
+static int
+cmpindexentry (a, b)
+ const PTR *a;
+ const PTR *b;
+{
+ const struct indexentry *contestantA = (const struct indexentry *) a;
+ const struct indexentry *contestantB = (const struct indexentry *) b;
+
+ if (contestantA->val < contestantB->val)
+ return -1;
+ else if (contestantA->val > contestantB->val)
+ return 1;
+ else
+ return 0;
+}
+
/* A pointer to this structure is stored in *pinfo. */
struct stab_find_info
@@ -727,13 +763,22 @@ struct stab_find_info
bfd_byte *stabs;
/* The contents of the .stabstr section. */
bfd_byte *strs;
- /* An malloc buffer to hold the file name. */
- char *filename;
+
+ /* A table that indexes stabs by memory address. */
+ struct indexentry *indextable;
+ /* The number of entries in indextable. */
+ int indextablesize;
+
+#ifdef ENABLE_CACHING
/* Cached values to restart quickly. */
+ struct indexentry *cached_indexentry;
bfd_vma cached_offset;
bfd_byte *cached_stab;
- bfd_byte *cached_str;
- bfd_size_type cached_stroff;
+ char *cached_file_name;
+#endif
+
+ /* Saved ptr to malloc'ed filename. */
+ char *filename;
};
boolean
@@ -751,18 +796,36 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
{
struct stab_find_info *info;
bfd_size_type stabsize, strsize;
- bfd_byte *stab, *stabend, *str;
+ bfd_byte *stab, *str;
bfd_size_type stroff;
- bfd_vma fnaddr;
- char *directory_name, *main_file_name, *current_file_name, *line_file_name;
- char *fnname;
- bfd_vma low_func_vma, low_line_vma;
+ struct indexentry *indexentry;
+ char *directory_name, *file_name;
*pfound = false;
*pfilename = bfd_get_filename (abfd);
*pfnname = NULL;
*pline = 0;
+ /* Stabs entries use a 12 byte format:
+ 4 byte string table index
+ 1 byte stab type
+ 1 byte stab other field
+ 2 byte stab desc field
+ 4 byte stab value
+ FIXME: This will have to change for a 64 bit object format.
+
+ The stabs symbols are divided into compilation units. For the
+ first entry in each unit, the type of 0, the value is the length
+ of the string table for this unit, and the desc field is the
+ number of stabs symbols for this unit. */
+
+#define STRDXOFF (0)
+#define TYPEOFF (4)
+#define OTHEROFF (5)
+#define DESCOFF (6)
+#define VALOFF (8)
+#define STABSIZE (12)
+
info = (struct stab_find_info *) *pinfo;
if (info != NULL)
{
@@ -779,6 +842,12 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
{
long reloc_size, reloc_count;
arelent **reloc_vector;
+ bfd_vma val;
+ int i;
+ char *name;
+ char *file_name;
+ char *directory_name;
+ char *function_name;
info = (struct stab_find_info *) bfd_zalloc (abfd, sizeof *info);
if (info == NULL)
@@ -868,140 +937,189 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
if (reloc_vector != NULL)
free (reloc_vector);
- *pinfo = (PTR) info;
- }
+ /* First time through this function, build a table matching
+ function VM addresses to stabs, then sort based on starting
+ VM address. Do this in two passes: once to count how many
+ table entries we'll need, and a second to actually build the
+ table. */
- /* We are passed a section relative offset. The offsets in the
- stabs information are absolute. */
- offset += bfd_get_section_vma (abfd, section);
+ info->indextablesize = 0;
+ for (stab = info->stabs; stab < info->stabs + stabsize; stab += STABSIZE)
+ {
+ if (stab[TYPEOFF] == N_FUN)
+ ++info->indextablesize;
+ }
- /* Stabs entries use a 12 byte format:
- 4 byte string table index
- 1 byte stab type
- 1 byte stab other field
- 2 byte stab desc field
- 4 byte stab value
- FIXME: This will have to change for a 64 bit object format.
+ if (info->indextablesize == 0)
+ return true;
+ ++info->indextablesize;
- The stabs symbols are divided into compilation units. For the
- first entry in each unit, the type of 0, the value is the length
- of the string table for this unit, and the desc field is the
- number of stabs symbols for this unit. */
+ info->indextable = ((struct indexentry *)
+ bfd_alloc (abfd,
+ (sizeof (struct indexentry)
+ * info->indextablesize)));
+ if (info->indextable == NULL)
+ return false;
-#define STRDXOFF (0)
-#define TYPEOFF (4)
-#define OTHEROFF (5)
-#define DESCOFF (6)
-#define VALOFF (8)
-#define STABSIZE (12)
+ file_name = NULL;
+ directory_name = NULL;
- /* It would be nice if we could skip ahead to the stabs symbols for
- the next compilation unit to quickly scan through the compilation
- units. Unfortunately, since each line number gets a separate
- stabs entry, it is entirely plausible that a large source file
- will overflow the 16 bit count of stabs entries. */
- fnaddr = 0;
- directory_name = NULL;
- main_file_name = NULL;
- current_file_name = NULL;
- line_file_name = NULL;
- fnname = NULL;
- low_func_vma = 0;
- low_line_vma = 0;
-
- stabend = info->stabs + stabsize;
-
- if (info->cached_stab == NULL || offset < info->cached_offset)
- {
- stab = info->stabs;
- str = info->strs;
- stroff = 0;
- }
- else
- {
- stab = info->cached_stab;
- str = info->cached_str;
- stroff = info->cached_stroff;
- }
+ for (i = 0, stroff = 0, stab = info->stabs, str = info->strs;
+ i < info->indextablesize && stab < info->stabs + stabsize;
+ stab += STABSIZE)
+ {
+ switch (stab[TYPEOFF])
+ {
+ case 0:
+ /* This is the first entry in a compilation unit. */
+ if ((bfd_size_type) ((info->strs + strsize) - str) < stroff)
+ break;
+ str += stroff;
+ stroff = bfd_get_32 (abfd, stab + VALOFF);
+ break;
- info->cached_offset = offset;
+ case N_SO:
+ /* The main file name. */
- for (; stab < stabend; stab += STABSIZE)
- {
- boolean done;
- bfd_vma val;
- char *name;
+ file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
- done = false;
+ if (*file_name == '\0')
+ {
+ directory_name = NULL;
+ file_name = NULL;
+ }
+ else if (stab + STABSIZE >= info->stabs + stabsize
+ || *(stab + STABSIZE + TYPEOFF) != N_SO)
+ {
+ directory_name = NULL;
+ }
+ else
+ {
+ /* Two consecutive N_SOs are a directory and a file
+ name. */
+ stab += STABSIZE;
+ directory_name = file_name;
+ file_name = ((char *) str
+ + bfd_get_32 (abfd, stab + STRDXOFF));
+ }
+ break;
- switch (stab[TYPEOFF])
- {
- case 0:
- /* This is the first entry in a compilation unit. */
- if ((bfd_size_type) ((info->strs + strsize) - str) < stroff)
- {
- done = true;
+ case N_SOL:
+ /* The name of an include file. */
+ file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
break;
- }
- str += stroff;
- stroff = bfd_get_32 (abfd, stab + VALOFF);
- break;
- case N_SO:
- /* The main file name. */
+ case N_FUN:
+ /* A function name. */
- val = bfd_get_32 (abfd, stab + VALOFF);
- if (val > offset)
- {
- done = true;
+ name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
+
+ if (*name == '\0')
+ name = NULL;
+
+ function_name = name;
+
+ if (name == NULL)
+ continue;
+
+ val = bfd_get_32 (abfd, stab + VALOFF);
+
+ info->indextable[i].val = val;
+ info->indextable[i].stab = stab;
+ info->indextable[i].str = str;
+ info->indextable[i].directory_name = directory_name;
+ info->indextable[i].file_name = file_name;
+ info->indextable[i].function_name = function_name;
+
+ ++i;
break;
}
+ }
+
+ info->indextable[i].val = (bfd_vma) -1;
+ info->indextable[i].stab = info->stabs + stabsize;
+ info->indextable[i].str = str;
+ info->indextable[i].directory_name = NULL;
+ info->indextable[i].file_name = NULL;
+ info->indextable[i].function_name = NULL;
+ ++i;
- name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
+ info->indextablesize = i;
- /* An empty string indicates the end of the compilation
- unit. */
- if (*name == '\0')
+ qsort (info->indextable, i, sizeof (struct indexentry), cmpindexentry);
+
+ *pinfo = (PTR) info;
+ }
+
+ /* We are passed a section relative offset. The offsets in the
+ stabs information are absolute. */
+ offset += bfd_get_section_vma (abfd, section);
+
+#ifdef ENABLE_CACHING
+ if (info->cached_indexentry != NULL
+ && offset >= info->cached_offset
+ && offset < (info->cached_indexentry + 1)->val)
+ {
+ stab = info->cached_stab;
+ indexentry = info->cached_indexentry;
+ file_name = info->cached_file_name;
+ }
+ else
+#endif
+ {
+ /* Cache non-existant or invalid. Do binary search on
+ indextable. */
+
+ long low, high;
+ long mid = -1;
+
+ indexentry = NULL;
+
+ low = 0;
+ high = info->indextablesize - 1;
+ while (low != high)
+ {
+ mid = (high + low) / 2;
+ if (offset >= info->indextable[mid].val
+ && offset < info->indextable[mid + 1].val)
{
- /* If there are functions in different sections, they
- may have addresses larger than val, but we don't want
- to forget the file name. When there are functions in
- different cases, there is supposed to be an N_FUN at
- the end of the function indicating where it ends. */
- if (low_func_vma < val || fnname == NULL)
- main_file_name = NULL;
+ indexentry = &info->indextable[mid];
break;
}
- /* We know that we have to get to at least this point in the
- stabs entries for this offset. */
- info->cached_stab = stab;
- info->cached_str = str;
- info->cached_stroff = stroff;
+ if (info->indextable[mid].val > offset)
+ high = mid;
+ else
+ low = mid + 1;
+ }
- current_file_name = name;
+ if (indexentry == NULL)
+ return true;
- /* Look ahead to the next symbol. Two consecutive N_SO
- symbols are a directory and a file name. */
- if (stab + STABSIZE >= stabend
- || *(stab + STABSIZE + TYPEOFF) != N_SO)
- directory_name = NULL;
- else
- {
- stab += STABSIZE;
- directory_name = current_file_name;
- current_file_name = ((char *) str
- + bfd_get_32 (abfd, stab + STRDXOFF));
- }
+ stab = indexentry->stab + STABSIZE;
+ file_name = indexentry->file_name;
+ }
- main_file_name = current_file_name;
+ directory_name = indexentry->directory_name;
+ str = indexentry->str;
- break;
+ for (; stab < (indexentry+1)->stab; stab += STABSIZE)
+ {
+ boolean done;
+ bfd_vma val;
+
+ done = false;
+ switch (stab[TYPEOFF])
+ {
case N_SOL:
/* The name of an include file. */
- current_file_name = ((char *) str
- + bfd_get_32 (abfd, stab + STRDXOFF));
+ val = bfd_get_32 (abfd, stab + VALOFF);
+ if (val <= offset)
+ {
+ file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
+ *pline = 0;
+ }
break;
case N_SLINE:
@@ -1009,40 +1127,25 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
case N_BSLINE:
/* A line number. The value is relative to the start of the
current function. */
- val = fnaddr + bfd_get_32 (abfd, stab + VALOFF);
- if (val >= low_line_vma && val <= offset)
+ val = indexentry->val + bfd_get_32 (abfd, stab + VALOFF);
+ if (val <= offset)
{
*pline = bfd_get_16 (abfd, stab + DESCOFF);
- low_line_vma = val;
- line_file_name = current_file_name;
+
+#ifdef ENABLE_CACHING
+ info->cached_stab = stab;
+ info->cached_offset = val;
+ info->cached_file_name = file_name;
+ info->cached_indexentry = indexentry;
+#endif
}
+ if (val > offset)
+ done = true;
break;
case N_FUN:
- /* A function name. */
- val = bfd_get_32 (abfd, stab + VALOFF);
- name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
-
- /* An empty string here indicates the end of a function, and
- the value is relative to fnaddr. */
-
- if (*name == '\0')
- {
- val += fnaddr;
- if (val >= low_func_vma && val < offset)
- fnname = NULL;
- }
- else
- {
- if (val >= low_func_vma && val <= offset)
- {
- fnname = name;
- low_func_vma = val;
- }
-
- fnaddr = val;
- }
-
+ case N_SO:
+ done = true;
break;
}
@@ -1050,46 +1153,34 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
break;
}
- if (main_file_name == NULL)
- {
- /* No information found. */
- return true;
- }
-
*pfound = true;
- if (*pline != 0)
- main_file_name = line_file_name;
-
- if (main_file_name != NULL)
+ if (file_name[0] == '/' || directory_name == NULL)
+ *pfilename = file_name;
+ else
{
- if (main_file_name[0] == '/' || directory_name == NULL)
- *pfilename = main_file_name;
- else
- {
- size_t dirlen;
+ size_t dirlen;
- dirlen = strlen (directory_name);
- if (info->filename == NULL
- || strncmp (info->filename, directory_name, dirlen) != 0
- || strcmp (info->filename + dirlen, main_file_name) != 0)
- {
- if (info->filename != NULL)
- free (info->filename);
- info->filename = (char *) bfd_malloc (dirlen +
- strlen (main_file_name)
- + 1);
- if (info->filename == NULL)
- return false;
- strcpy (info->filename, directory_name);
- strcpy (info->filename + dirlen, main_file_name);
- }
-
- *pfilename = info->filename;
+ dirlen = strlen (directory_name);
+ if (info->filename == NULL
+ || strncmp (info->filename, directory_name, dirlen) != 0
+ || strcmp (info->filename + dirlen, file_name) != 0)
+ {
+ if (info->filename != NULL)
+ free (info->filename);
+ info->filename = (char *) bfd_malloc (dirlen +
+ strlen (file_name)
+ + 1);
+ if (info->filename == NULL)
+ return false;
+ strcpy (info->filename, directory_name);
+ strcpy (info->filename + dirlen, file_name);
}
+
+ *pfilename = info->filename;
}
- if (fnname != NULL)
+ if (indexentry->function_name != NULL)
{
char *s;
@@ -1097,11 +1188,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
to clobber the colon. It's OK to change the name, since the
string is in our own local storage anyhow. */
- s = strchr (fnname, ':');
+ s = strchr (indexentry->function_name, ':');
if (s != NULL)
*s = '\0';
- *pfnname = fnname;
+ *pfnname = indexentry->function_name;
}
return true;
diff --git a/contrib/binutils/bfd/targets.c b/contrib/binutils/bfd/targets.c
index de0e0f2..a6c61bb 100644
--- a/contrib/binutils/bfd/targets.c
+++ b/contrib/binutils/bfd/targets.c
@@ -1,5 +1,6 @@
/* Generic target-file-type support for the BFD library.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -483,6 +484,8 @@ extern const bfd_target armpei_big_vec;
extern const bfd_target b_out_vec_big_host;
extern const bfd_target b_out_vec_little_host;
extern const bfd_target bfd_elf64_alpha_vec;
+extern const bfd_target bfd_elf32_bigarc_vec;
+extern const bfd_target bfd_elf32_littlearc_vec;
extern const bfd_target bfd_elf32_big_generic_vec;
extern const bfd_target bfd_elf32_bigmips_vec;
extern const bfd_target bfd_elf64_bigmips_vec;
@@ -503,6 +506,7 @@ extern const bfd_target bfd_elf32_powerpcle_vec;
extern const bfd_target bfd_elf32_sh_vec;
extern const bfd_target bfd_elf32_shl_vec;
extern const bfd_target bfd_elf32_sparc_vec;
+extern const bfd_target bfd_elf32_v850_vec;
extern const bfd_target bfd_elf64_big_generic_vec;
extern const bfd_target bfd_elf64_little_generic_vec;
extern const bfd_target bfd_elf64_sparc_vec;
@@ -531,6 +535,7 @@ extern const bfd_target bfd_powerpcle_pei_vec;
extern const bfd_target i386pe_vec;
extern const bfd_target i386pei_vec;
extern const bfd_target go32coff_vec;
+extern const bfd_target go32stubbedcoff_vec;
extern const bfd_target i386linux_vec;
extern const bfd_target i386lynx_aout_vec;
extern const bfd_target i386lynx_coff_vec;
@@ -566,6 +571,8 @@ extern const bfd_target pmac_xcoff_vec;
extern const bfd_target rs6000coff_vec;
extern const bfd_target shcoff_vec;
extern const bfd_target shlcoff_vec;
+extern const bfd_target shcoff_small_vec;
+extern const bfd_target shlcoff_small_vec;
extern const bfd_target sparcle_aout_vec;
extern const bfd_target sparclinux_vec;
extern const bfd_target sparclynx_aout_vec;
@@ -574,6 +581,9 @@ extern const bfd_target sparcnetbsd_vec;
extern const bfd_target sparccoff_vec;
extern const bfd_target sunos_big_vec;
extern const bfd_target tekhex_vec;
+extern const bfd_target tic30_aout_vec;
+extern const bfd_target tic30_coff_vec;
+extern const bfd_target vaxnetbsd_vec;
extern const bfd_target versados_vec;
extern const bfd_target we32kcoff_vec;
extern const bfd_target w65_vec;
@@ -635,6 +645,7 @@ const bfd_target * const bfd_target_vector[] = {
#ifdef BFD64
&bfd_elf64_alpha_vec,
#endif
+ &bfd_elf32_bigarc_vec,
&bfd_elf32_bigmips_vec,
#ifdef BFD64
&bfd_elf64_bigmips_vec,
@@ -644,6 +655,7 @@ const bfd_target * const bfd_target_vector[] = {
&bfd_elf32_i386_vec,
&bfd_elf32_i860_vec,
&bfd_elf32_little_generic_vec,
+ &bfd_elf32_littlearc_vec,
&bfd_elf32_littlemips_vec,
#ifdef BFD64
&bfd_elf64_littlemips_vec,
@@ -655,6 +667,8 @@ const bfd_target * const bfd_target_vector[] = {
&bfd_elf32_m88k_vec,
&bfd_elf32_sparc_vec,
&bfd_elf32_powerpc_vec,
+ &bfd_elf32_powerpcle_vec,
+ &bfd_elf32_v850_vec,
#ifdef BFD64 /* No one seems to use this. */
&bfd_elf64_big_generic_vec,
&bfd_elf64_little_generic_vec,
@@ -699,6 +713,7 @@ const bfd_target * const bfd_target_vector[] = {
&bfd_powerpc_pei_vec,
&bfd_powerpcle_pei_vec,
&go32coff_vec,
+ &go32stubbedcoff_vec,
#if 0
/* Since a.out files lack decent magic numbers, no way to recognize
which kind of a.out file it is. */
@@ -767,6 +782,8 @@ const bfd_target * const bfd_target_vector[] = {
&ppcboot_vec,
&shcoff_vec,
&shlcoff_vec,
+ &shcoff_small_vec,
+ &shlcoff_small_vec,
&sparcle_aout_vec,
&sparclinux_vec,
&sparclynx_aout_vec,
@@ -775,8 +792,11 @@ const bfd_target * const bfd_target_vector[] = {
&sunos_big_vec,
&aout0_big_vec,
&tekhex_vec,
- &we32kcoff_vec,
+ &tic30_aout_vec,
+ &tic30_coff_vec,
+ &vaxnetbsd_vec,
&versados_vec,
+ &we32kcoff_vec,
&z8kcoff_vec,
#endif /* not SELECT_VECS */
@@ -805,6 +825,9 @@ const bfd_target * const bfd_target_vector[] = {
#ifdef IRIX_CORE
&irix_core_vec,
#endif
+#ifdef NETBSD_CORE
+ &netbsd_core_vec,
+#endif
#ifdef OSF_CORE
&osf_core_vec,
#endif
diff --git a/contrib/binutils/bfd/tekhex.c b/contrib/binutils/bfd/tekhex.c
index 238ccca..76f49d9 100644
--- a/contrib/binutils/bfd/tekhex.c
+++ b/contrib/binutils/bfd/tekhex.c
@@ -817,6 +817,8 @@ tekhex_write_object_contents (abfd)
asection *s;
struct data_struct *d;
+ tekhex_init ();
+
bytes_written = 0;
/* And the raw data */
@@ -868,50 +870,53 @@ tekhex_write_object_contents (abfd)
}
/* And the symbols */
- for (p = abfd->outsymbols; *p; p++)
+ if (abfd->outsymbols)
{
- int section_code = bfd_decode_symclass (*p);
+ for (p = abfd->outsymbols; *p; p++)
+ {
+ int section_code = bfd_decode_symclass (*p);
- if (section_code != '?')
- { /* do not include debug symbols */
- asymbol *s = *p;
- char *dst = buffer;
+ if (section_code != '?')
+ { /* do not include debug symbols */
+ asymbol *s = *p;
+ char *dst = buffer;
- writesym (&dst, s->section->name);
+ writesym (&dst, s->section->name);
- switch (section_code)
- {
- case 'A':
- *dst++ = '2';
- break;
- case 'a':
- *dst++ = '6';
- break;
- case 'D':
- case 'B':
- case 'O':
- *dst++ = '4';
- break;
- case 'd':
- case 'b':
- case 'o':
- *dst++ = '8';
- break;
- case 'T':
- *dst++ = '3';
- break;
- case 't':
- *dst++ = '7';
- break;
- case 'C':
- case 'U':
- bfd_set_error (bfd_error_wrong_format);
- return false;
- }
+ switch (section_code)
+ {
+ case 'A':
+ *dst++ = '2';
+ break;
+ case 'a':
+ *dst++ = '6';
+ break;
+ case 'D':
+ case 'B':
+ case 'O':
+ *dst++ = '4';
+ break;
+ case 'd':
+ case 'b':
+ case 'o':
+ *dst++ = '8';
+ break;
+ case 'T':
+ *dst++ = '3';
+ break;
+ case 't':
+ *dst++ = '7';
+ break;
+ case 'C':
+ case 'U':
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
- writesym (&dst, s->name);
- writevalue (&dst, s->value + s->section->vma);
- out (abfd, '3', buffer, dst);
+ writesym (&dst, s->name);
+ writevalue (&dst, s->value + s->section->vma);
+ out (abfd, '3', buffer, dst);
+ }
}
}
diff --git a/contrib/binutils/binutils/ChangeLog b/contrib/binutils/binutils/ChangeLog
index 3f22cc4..8c27a77 100644
--- a/contrib/binutils/binutils/ChangeLog
+++ b/contrib/binutils/binutils/ChangeLog
@@ -1,6 +1,566 @@
-Tue May 13 10:42:58 1997 Ian Lance Taylor <ian@cygnus.com>
+Mon Apr 27 13:45:26 1998 Ian Lance Taylor <ian@cygnus.com>
- * Makefile.in (VERSION): Set to 2.8.1.
+ * configure.in: Set version number to 2.9.1.
+ * configure: Rebuild.
+
+Tue Apr 7 15:41:15 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (DISTSTUFF): Add defparse.h, defparse.c, rclex.c,
+ rcparse.h, and rcparse.c
+ * Makefile.in: Rebuild.
+
+Mon Apr 6 16:24:35 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (PROGS): Move $(ADDR2LINE_PROG) to end, so that
+ Makefile.in doesn't have an empty continuation line.
+ (bin_PROGRAMS): Likewise.
+ * Makefile.in: Rebuild.
+
+Fri Apr 3 13:41:05 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (mostlyclean-local): New target.
+ (MOSTLYCLEANFILES): Add binutils.log, binutils.sum, and abcdefg*.
+ (DISTCLEANFILES): Add site.exp and site.bak
+ * Makefile.in: Rebuild.
+
+Wed Apr 1 15:54:16 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ From Zack Weinberg <zack@rabi.phys.columbia.edu> and H.J. Lu
+ <hjl@gnu.org>:
+ * ar.c (usage): Mention S modifier.
+ (main): Add S modifier.
+ * ar.1, binutils.texi: Document S modifier.
+
+Wed Apr 1 13:11:23 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * binutils.texi: Use @itemx for a secondary item in a table.
+
+Tue Mar 31 18:44:13 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * dep-in.sed: Add rule to remove @OBJDIR@.
+ * Makefile.am (dep.sed): Substitute for @OBJDIR@.
+ * Makefile.in: Rebuild.
+
+Mon Mar 30 16:13:07 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (DISTCLEANFILES): Remove defparse.h, arparse.h,
+ rcparse.h, and nlmheader.h.
+ * Makefile.in: Rebuild.
+
+ * configure.in: Set version number to 2.9.
+ * configure: Rebuild.
+
+Sat Mar 28 17:39:27 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (MOSTLYCLEANFILES): Define.
+ * Makefile.in: Rebuild.
+
+ Fix some gcc -Wall warnings:
+ * nlmconv.c (main): Add casts to avoid warnings.
+ (alpha_mangle_relocs): Likewise.
+ * objdump.c (dump_section_stabs): Likewise.
+ * size.c (print_sysv_format): Likewise.
+ * srcconv.c (wr_ob): Likewise.
+ * wrstabs.c (stab_modify_type): Likewise.
+ (stab_variable): Likewise.
+ * nlmconv.c (main): Initialize variables to avoid warnings.
+ * nm.c (sort_symbols_by_size): Likewise.
+ * objdump.c (disassemble_bytes): Likewise.
+ * wrstabs.c (stab_end_class_type): Likewise.
+ * coffgrok.c (do_sections_p2): Change j to unsigned int.
+ (do_lines): Change l to unsigned int.
+ * nlmheader.y (yylex): Change i to unsigned int.
+ * nm.c (print_symbol): Change j to long.
+ * size.c (lprint_number): Comment out.
+ * srconv.c (wr_ob): Change i to bfd_size_type.
+ * sysdump.c (unit_info_list): Comment out.
+ (object_body_list, program_structure, debug_list): Likewise.
+ * sysinfo.y (yyerror): Return value.
+
+Thu Mar 26 17:06:51 1998 Richard Henderson <rth@cygnus.com>
+
+ * defparse.y (explist): Allow epsilon.
+ Suggestion from Jonathan-Harris@psion.com.
+
+Thu Mar 26 16:59:09 1998 Richard Henderson <rth@cygnus.com>
+
+ * coffgrok.c (do_sections_p1): Use the section's lma instead of vma
+ for the benefit of prom loaders.
+
+Wed Mar 25 13:05:39 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Based on patch from H.J. Lu <hjl@gnu.org>:
+ * Makefile.am (DISTSTUFF): New variable.
+ (diststuff): New target.
+ (DISTCLEANFILES): New variable.
+ * Makefile.in: Rebuild.
+
+Tue Mar 24 19:33:08 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * rclex.l: Accept { and } as synonyms for BEGIN and END.
+
+Fri Mar 20 19:18:08 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4, configure: Rebuild with libtool 1.2.
+
+Tue Feb 24 13:07:50 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * objdump.c (disassemble_data): Delete "++place" after call to
+ find_symbol_for_address. Set disasm_info.symbols to array of
+ symbols at the current address.
+
+Wed Feb 18 23:39:46 1998 Richard Henderson <rth@cygnus.com>
+
+ * Makefile.am (install-exec-local): Install properly when ln
+ fails or tooldir == prefix.
+
+Tue Feb 17 18:40:55 1998 Richard Henderson <rth@cygnus.com>
+
+ * objcopy.c (compare_section_lma): Rename from _vma.
+ (copy_object): Gap fill based on LMA not VMA.
+ * binutils.texi: Update and clarify.
+ * objcopy.1: Likewise.
+
+Tue Feb 17 20:34:11 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * dlltool.c (make_one_lib_file): Don't add 1 to hint.
+
+Fri Feb 13 16:37:44 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Define.
+ * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e.
+
+Thu Feb 12 14:13:46 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * deflex.l: Accept '?' in symbol names, for VC++ mangled names.
+ From Mikey <jeffdb@netzone.com>.
+
+ * addr2line.c (usage): Update bug-gnu-utils address.
+ * ar.c (usage): Likewise.
+ * nlmconv.c (show_usage): Likewise.
+ * nm.c (usage): Likewise.
+ * objcopy.c (copy_usage): Likewise.
+ (strip_usage): Likewise.
+ * objdump.c (usage): Likewise.
+ * size.c (usage): Likewise.
+ * strings.c (usage): Likewise.
+ * windres.c (usage): Likewise.
+ * binutils.texi (Bug Reporting): Likewise.
+
+Sat Feb 7 15:36:24 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure, aclocal.m4: Rebuild with new libtool.
+
+Thu Feb 5 12:21:13 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure, Makefile.in, aclocal.m4: Rebuild with new libtool.
+
+Fri Jan 30 19:16:28 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * Makefile.am (CC_FOR_TARGET,nlmcomv.o): Change program_transform_name
+ to transform.
+ * Makefile.in: Regenerate.
+
+Thu Jan 29 16:24:04 1998 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * dlltool.c: Define exit status macros for _WIN32 but not
+ __CYGWIN32__.
+ (gen_lib_file): Check for exit status of unlink.
+ * resrc.c: Define popen and pclose if _WIN32 but not
+ __CYGWIN32__.
+
+Wed Jan 28 17:45:46 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Remove vfork check.
+ * nlmconv.c: Never include vfork.h.
+ * aclocal.m4, configure, Makefile.in, config.in: Rebuild.
+
+Wed Jan 28 17:43:02 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
+
+ * objcopy.c (copy_archive): Only pass one argument to mkdir if
+ _WIN32 but not __CYGWIN32__.
+ (smart_rename): Add code for _WIN32 (not __CYGWIN32__), to cope
+ with different rename behaviour and lack of chown.
+
+ * configure.in: Check for mingw32 when deciding whether to build
+ dlltool.
+ * dlltool.c: Never include vfork.h.
+ (run): Use pexecute rather than vfork.
+ (gen_lib_file): Check for errors from bfd_set_archive_head and
+ bfd_close. Close all the BFDs in the archive before deleting the
+ temporary files.
+
+Thu Jan 22 16:22:55 1998 Fred Fish <fnf@cygnus.com>
+
+ * objdump.c (disassemble_bytes): Add flag INSN_HAS_RELOC to tell
+ disassembly function there is a reloc on this line.
+
+Wed Jan 14 15:29:43 1998 Richard Henderson <rth@cygnus.com>
+
+ * srconv.c (sh, h8300): Delete variables.
+ (addrsize, toolname, rnames): New variables.
+ (writeINT): Use addrsize.
+ (wr_un): Use toolname.
+ (wr_hd): Set up addrsize et al properly for h8300[hs].
+ (walk_tree_symbol): Zero dsy. Use rnames.
+ (wr_un, wr_hd, wr_ob, wr_du): Use proper bfd access macros.
+ * sysdump.c (sh, h8300): Delete variables.
+ (addrsize): New variable.
+ (getINT): Use it.
+ (getone): Initialize it.
+ (getBITS): Range check on MAX.
+
+Mon Dec 29 16:58:05 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Matthew Bellantoni <matthew@chrysalis.com>:
+ * ar.c (get_pos_bfd): Add default_posname parameter. Change all
+ callers.
+ (replace_members): Default to replacing in the same position.
+
+Mon Dec 22 11:27:22 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * rclex.l: Don't permit a comma in a STRING.
+ * rcparse.y (acc_entry): Warn if an inappropriate modifier is used
+ with a non VIRTKEY.
+ (acc_event): For a control character, set VIRTKEY, and force the
+ character to uppercase.
+ (acc_options): Don't require a comma separator.
+
+Tue Dec 9 13:25:42 1997 Michael Meissner <meissner@cygnus.com>
+
+ * size.c (size_number): New function to provide size of field.
+ ({l,r}print_number): For octal and hex fields, print field using
+ '0' and '0x' suffixes. Do not include following tab.
+ (sysv_internal_sizer): Size section name, section size, and vma
+ address fields.
+ (sysv_internal_printer): Use calculated sizes for the columns.
+ (print_sysv_format): Size columns before printing.
+ (print_berkeley_format): Print tabs between numbers now that
+ {l,r}print_number doesn't. Print fields right justified.
+
+Mon Dec 8 11:22:04 1997 Nick Clifton <nickc@cygnus.com>
+
+ * objdump.c (objdump_print_addr_with_sym): Remove call to
+ disasm_symaddr() as this function no longer exists.
+
+Tue Dec 2 10:23:50 1997 Nick Clifton <nickc@cygnus.com>
+
+ * objdump.c (objdump_print_addr_with_sym): Call disasm_symaddr()
+ to allow backend to know which symbol has just been displayed.
+
+Tue Dec 2 13:06:46 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * windres.h (ESCAPE_*): Define standard escape sequences.
+ * rclex.l (handle_quotes): Handle standard escape sequences. Warn
+ about an unrecognized escape character.
+ * windres.c (unicode_print): Print standard escape sequences.
+ * rcparse.y (acc_event): Initialize $$.next.
+ * resbin.c (bin_to_res_menuitems): Don't set MENUITEM_POPUP or
+ MENUITEM_ENDMENU in the menu item flags.
+ (bin_to_res_accelerators): Allocate a structure (the old code
+ never worked).
+ (res_to_bin_accelerator): Correct the test for setting ACC_LAST.
+ (res_to_bin_dialog): Save the extended style rather than saving
+ the style twice. Remove useless shadowing length variable. Set
+ the length of control data correctly.
+ * resrc.c (write_rc_dialog): Don't print the class or menu if the
+ string length is zero.
+
+Mon Nov 24 18:52:43 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * stabs.c (parse_stab_argtypes): Don't try to parse the name of a
+ destructor as mangled argument types.
+
+Mon Nov 10 17:51:41 1997 Gavin Koch <gavin@cygnus.com>
+
+ * addr2line.c (translate_addresses): Use bfd_scan_vma rather
+ than strtol to scan addresses.
+
+Sun Nov 9 11:01:31 1997 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.am (bin_PROGRAMS): Don't use line continuations here.
+
+Tue Nov 4 11:56:14 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * objcopy.c (copy_section): Don't crash if there is no particular
+ information for a section.
+
+Mon Nov 3 12:36:19 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * objcopy.c (parse_flags): Make flag check case insensitive.
+ Check for `contents' flag. Give an error for unrecognized flags.
+ (copy_section): If the contents flag was set for a section that
+ had no contents, zero out the new contents.
+ * binutils.texi (objcopy): Document contents section flag.
+
+Sun Nov 2 14:49:56 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * objcopy.c: Move new struct and variable definitions to top of
+ file. Remove obsolete add_strip_symbol and is_strip_symbol
+ declarations. Add prototype declarations for add_specific_symbol
+ and is_specified_symbol.
+
+Mon Oct 20 15:31:43 1997 Klaus K"ampf <kkaempf@progis.de>
+
+ * configure.com (HAVE_SBRK): Undefine.
+
+Tue Oct 14 16:14:35 1997 Nick Clifton <nickc@cygnus.com>
+
+ * objdump.c (objdump_symbol_at_address): New function. Returns
+ true if a symbol can be found at the address passed in.
+ (disassemble_data): Set the symbol_at_address_func field to point
+ to objdump_symbol_at_address.
+
+Fri Oct 10 14:13:09 1997 Richard Henderson <rth@cygnus.com>
+
+ * objcopy.c, objcopy.1, binutils.texi: "localize" is a better name
+ than "privatize". Update all references.
+
+Thu Oct 9 15:57:29 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * binutils.texi (strip): Remove duplicate --target. From Marty
+ Leisner <leisner@sdsp.mc.xerox.com>.
+
+ * nm.c (lineno_cache_bfd): New file static variable.
+ (lineno_cache_rel_bfd): New file static variable.
+ (display_archive): Clear lineno_cache_bfd and lineno_cache_rel_bfd
+ when closing a BFD.
+ (display_file): Likewise.
+ (print_symbol): Use lineno_cache_bfd and lineno_cache_rel_bfd
+ instead of cache_bfd and cache_rel_bfd. Make seccount static, and
+ only set it when setting relocs.
+
+Wed Oct 8 21:19:11 1997 Richard Henderson <rth@cygnus.com>
+
+ * objcopy.c (keep_specific_list, privatize_specific_list,
+ weaken_specific_list): New variables.
+ (keep_symbols): Removed.
+ (add_specific_symbol): New function from the carcas of
+ add_strip_symbol. Takes a list as an argument.
+ (is_specified_symbol): Likewise from is_strip_symbol.
+ (filter_symbols): Honor the new privatize and weaken lists.
+ Optimize bfd_asymbol_name handling.
+ (copy_object, copy_options, copy_usage): Add privatize-symbol &
+ weaken-symbol options.
+
+ * objcopy.1, binutils.texi: Update docs.
+
+Sun Oct 5 09:05:44 1997 Frank Ch. Eigler <fche@cygnus.com>
+
+ * objdump.c (disassemble_data): Make "--prefix-addresses"
+ disassembly adjust to mixed-length instructions.
+ (objdump_print_addr_with_sym): Add "0x" prefix for hexadecimal
+ symbol-offsets in disassembly.
+
+Fri Oct 3 12:04:25 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * objcopy.c (set_times): New static function, replacing
+ make_same_dates.
+ (strip_main): If preserve_dates, stat the input file before
+ copying it, and call set_times afterward.
+ (copy_main): Likewise.
+
+ * wrstabs.c (write_stabs_in_sections_debugging_info): Cast p to
+ char * when calling strcpy and strlen.
+
+Wed Sep 24 11:34:05 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * binutils.texi (ar cmdline): Document that q now works like r.
+ From Marty Leisner <leisner@sdsp.mc.xerox.com>.
+
+ * binutils.texi (size): The object file argument is optional.
+ From Marty Leisner <leisner@sdsp.mc.xerox.com>.
+
+ * aclocal.m4: Rebuild with new libtool.
+ * configure: Rebuild.
+
+Tue Aug 26 17:48:34 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (EXEEXT_FOR_BUILD): New variable. Use it in all
+ references to the sysinfo program.
+ * configure.in: Rebuild with new bfd/acinclude.m4.
+ * Makefile.in: Rebuild.
+
+Fri Aug 8 15:32:49 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * windres.c: Include <time.h>.
+ (define_resource): Set a timestamp for the resource.
+
+Wed Aug 6 13:37:58 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Define TARGET in header file.
+ * acconfig.h (TARGET): Add #undef.
+ * Makefile.am (version.o, bucomm.o): Remove special targets.
+ * bucomm.c (target): Remove.
+ * nm.c (program_name): Don't declare.
+ (target): Make static.
+ * size.c (target): Make static.
+ * configure, config.in, Makefile.in: Rebuild.
+
+Tue Aug 5 00:01:41 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (check-DEJAGNU): Export r.
+ (.dep1): Use $(INCLUDES) rather than $(ALL_CFLAGS).
+ * Makefile.in: Rebuild.
+
+ * nlmheader.y: Use VERSIONK rather than VERSION.
+
+ * Makefile.am (STRIP_PROG): Change from strip.new to strip-new.
+ (NM_PROG): Change from nm.new to nm-new.
+ (TOOL_PROGS, install-exec-local): Adjust accordingly.
+ * Makefile.in: Rebuild.
+
+Mon Aug 4 11:47:31 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Remove AC_ARG_PROGRAM; it's invoked by
+ AM_INIT_AUTOMAKE.
+ * configure: Rebuild.
+
+ * Makefile.am (install-exec-local): Create $(tooldir)/bin before
+ trying to install anything into it.
+ * Makefile.in: Rebuild.
+
+ * Makefile.am (TOOL_PROGS): Use an explicit $(EXEEXT).
+ (install-exec-local): When handling $(noinst_PROGRAMS), only use
+ $(EXEEXT) on the installed file. When handling $(TOOL_PROGS),
+ handle $(EXEEXT) correctly.
+ * configure.in: Add an explicit $(EXEEXT) when substituting for
+ the name of a program to build.
+ * Makefile.in, configure: Rebuild.
+
+ * aclocal.m4, configure, Makefile.in: Rebuild with new automake
+ patches.
+
+ * deflex.l, defparse.y: Use VERSIONK rather than VERSION.
+ * rclex.l, rcparse.y: Likewise.
+ * Makefile.am (windres_SOURCES): Add $(BULIBS).
+ * Makefile.in: Rebuild.
+
+Fri Aug 1 13:08:39 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * acinclude.m4: Include bfd/acinclude.m4, not bfd/acmacros.m4.
+ * aclocal.m4, configure: Rebuild with new libtool.
+
+Thu Jul 31 11:51:35 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: New file, based on old Makefile.in.
+ * acinclude.m4: New file, from old aclocal.m4.
+ * configure.in: Call AM_INIT_AUTOMAKE and AM_PROG_LIBTOOL. Remove
+ shared library handling; now handled by libtool. Replace
+ AC_CONFIG_HEADER with AM_CONFIG_HEADER. Call AC_PROG_YACC,
+ AC_PROG_LEX, AC_DECL_YYTEST, AM_MAINTAINER_MODE, AM_CYGWIN32, and
+ AM_EXEEXT. Replace AC_PROG_INSTALL with AM_PROG_INSTALL. Remove
+ stamp-h handling in AC_OUTPUT.
+ * acconfig.h: Mention PACKAGE and VERSION.
+ * stamp-h.in: New file.
+ * Makefile.in: Now built with automake.
+ * aclocal.m4: Now built with aclocal.
+ * config.in, configure: Rebuild.
+
+ From Ton van Overbeek <tvoverbe@wk.estec.esa.nl>:
+ * rcparse.y (dialog): Default menu and class to be named.
+ (styles): If FONT is seen, set DS_SETFONT in dialog style.
+ * resbin.c (res_to_bin_dialog): Correct computation of font
+ information length.
+
+Wed Jul 30 11:21:06 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Ton van Overbeek <tvoverbe@wk.estec.esa.nl>:
+ * resbin.c (res_to_bin_menu): Correct computation of menu
+ vs. menuex length.
+ * resrc.c (define_stringtable): Add 1 to resource ID.
+
+Tue Jul 29 11:06:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * resbin.c (bin_to_res_string): Correct adjustment of data and
+ length. From Ton van Overbeek <tvoverbe@wk.estec.esa.nl>.
+
+Tue Jul 22 18:01:23 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * nlmconv.c (link_inputs): Call libiberty pexecute function.
+ (pexecute) [multiple versions]: Remove.
+
+Tue Jul 22 16:19:34 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * bucomm.c (make_tempname): If we might be using a DOS filesystem,
+ check for a backslash as well as a slash.
+
+Thu Jun 26 13:53:17 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * windres.c (main): Quit if we didn't get any resources.
+ (usage): Fix --yydebug usage message.
+ * rescoff.c (write_coff_file): Don't free the relocation array
+ until after we've closed the BFD.
+ (read_coff_rsrc): Quit rather than try to read standard input.
+ (write_coff_file): Quit rather than try to write to standard
+ output.
+ * rcparse.y: Add a couple of missing semicolons (accepted by bison
+ but not byacc).
+ * binutils.texi: Document windres.
+
+Wed Jun 25 20:57:06 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * resbin.c: New file.
+ * rclex.l, rcparse.y, rescoff.c, resrc.c, windres.c, windres.h:
+ Numerous fixes and improvements.
+ * Makefile.in: Rebuild dependencies.
+ (CFILES): Add resbin.c.
+ (WINDRES_OBJS): Add resbin.o.
+
+Sun Jun 22 17:29:41 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ First stab at Windows resource compiler:
+ * windres.h: New file.
+ * windres.c: New file.
+ * resrc.c: New file.
+ * rcparse.y: New file.
+ * rclex.l: New file.
+ * rescoff.c: New file.
+ * configure.in: Define and substitute BUILD_WINDRES.
+ * configure: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (WINDRES_PROG): New variable.
+ (PROGS): Add @BUILD_WINDRES@.
+ (HFILES): Add dlltool.h and windres.h.
+ (CFILES): Add windres.c and resrc.c.
+ (GENERATED_CFILES): Add rcparse.c and rclex.c.
+ (WINDRES_OBJS): New variable.
+ $(WINDRES_PROG): New target.
+ (rcparse.c, rcparse.h, rclex.c): New targets.
+
+Thu Jun 12 12:27:51 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * dlltool.c (export_type): Add data field.
+ (def_exports): Add data parameter. Change all callers.
+ (dump_def_info): Print data field.
+ (gen_def_file): Likewise.
+ (make_one_lib_file): Handle data field by not emitting simple
+ label and not emitting anything in SEC_TEXT.
+ (dtab): Print data field.
+ (process_duplicates): Merge data field.
+ * dlltool.h (def_exports): Update declaration.
+ * defparse.y (expline): Accept opt_DATA. Pass it to def_exports.
+ (opt_DATA): New non-terminal.
+
+Wed Jun 11 17:15:47 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * dlltool.h: New file.
+ * deflex.l: Include dlltool.h and libiberty.h. Don't declare
+ strdup. Use xstrdup rather than strdup.
+ * defparse.y: Include bfd.h, bucomm.h, and dlltool.h.
+ * dlltool.c: Include dlltool.h and time.h. Make a lot of
+ variables and functions static. Make a lot of char * variables
+ and parameters const. Add declarations for static functions. Do
+ some reindenting. Hide more PowerPC stuff inside DLLTOOL_PPC.
+
+Wed Jun 11 12:05:52 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * ar.c (bfd_special_undocumented_glue): Add const.
+
+Mon May 12 22:09:35 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * Makefile.in (check): Pass CC_FOR_TARGET and CFLAGS_FOR_TARGET
+ to runtest.
Mon May 12 13:14:22 1997 Ian Lance Taylor <ian@cygnus.com>
@@ -13,8 +573,20 @@ Fri Apr 25 14:22:08 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
* Makefile.in (maintainer-clean realclean): Change *.info*
to binutils.info* to save sysroff.info.
+Tue Apr 15 13:42:22 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (INSTALL): Set to @INSTALL@.
+ (INSTALL_XFORM, INSTALL_XFORM1): Remove.
+ (install): Depend upon installdirs. Use $(program_transform_name)
+ directly, rather than using $(INSTALL_XFORM) and
+ $(INSTALL_XFORM1).
+ (installdirs): New target.
+ (install-info): Run mkinstalldirs.
+
Mon Apr 14 11:52:39 1997 Ian Lance Taylor <ian@cygnus.com>
+ * Makefile.in (INSTALL): Change install.sh to install-sh.
+
From Thomas Graichen <graichen@rzpd.de>:
* Makefile.in: Always use $(SHELL) when running move-if-change.
* configure.in: Use ${CONFIG_SHELL} when running $ac_config_sub.
@@ -31,9 +603,11 @@ Fri Apr 4 13:28:02 1997 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (distclean): Remove site.exp and site.bak. Remove
everything that clean removes.
-Thu Apr 3 18:53:31 1997 Ian Lance Taylor <ian@cygnus.com>
+Thu Apr 3 13:18:39 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (VERSION): Set to 2.8.1.
- * Makefile.in (VERSION): Set to 2.8.
+ * Branched binutils 2.8.
Tue Apr 1 16:21:44 1997 Klaus Kaempf <kkaempf@progis.de>
diff --git a/contrib/binutils/binutils/Makefile.am b/contrib/binutils/binutils/Makefile.am
new file mode 100644
index 0000000..169146d
--- /dev/null
+++ b/contrib/binutils/binutils/Makefile.am
@@ -0,0 +1,449 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus dejagnu
+
+tooldir = $(exec_prefix)/$(target_alias)
+
+## These aren't set by automake, because they appear in
+## bfd/acinclude.m4, which is included by binutils/acinclude.m4, and
+## thus is not seen by automake.
+CC_FOR_BUILD = @CC_FOR_BUILD@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+
+YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
+YFLAGS = -d
+LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
+
+# these two are almost the same program
+AR_PROG=ar
+RANLIB_PROG=ranlib
+
+# objcopy and strip should be the same program
+OBJCOPY_PROG=objcopy
+STRIP_PROG=strip-new
+
+STRINGS_PROG=strings
+
+# These should all be the same program too.
+SIZE_PROG=size
+NM_PROG=nm-new
+OBJDUMP_PROG=objdump
+
+# This is the demangler, as a standalone program.
+# Note: This one is used as the installed name too, unlike the above.
+DEMANGLER_PROG=c++filt
+
+ADDR2LINE_PROG=addr2line
+
+NLMCONV_PROG=nlmconv
+DLLTOOL_PROG=dlltool
+WINDRES_PROG=windres
+
+SRCONV_PROG=srconv sysdump coffdump
+
+man_MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 \
+ addr2line.1 nlmconv.1 $(DEMANGLER_PROG).1
+
+PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG)
+
+bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG)
+
+## We need a special rule to install the programs which are built with -new
+noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG)
+
+EXTRA_PROGRAMS = $(NLMCONV_PROG) $(SRCONV_PROG) $(DLLTOOL_PROG) $(WINDRES_PROG)
+
+# Stuff that goes in tooldir/ if appropriate
+TOOL_PROGS = nm-new strip-new ar ranlib dlltool
+
+BASEDIR = $(srcdir)/..
+BFDDIR = $(BASEDIR)/bfd
+INCDIR = $(BASEDIR)/include
+
+DEP = mkdep
+
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@
+
+HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \
+ windres.h
+
+GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h
+
+CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c \
+ dlltool.c filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c \
+ maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c \
+ objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \
+ stabs.c strings.c sysdump.c version.c wrstabs.c \
+ windres.c resrc.c rescoff.c resbin.c
+
+GENERATED_CFILES = \
+ underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
+ defparse.c deflex.c nlmheader.c rcparse.c rclex.c
+
+DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
+WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
+
+# Code shared by all the binutils.
+BULIBS = bucomm.c version.c filemode.c
+
+BFDLIB = ../bfd/libbfd.la
+
+OPCODES = ../opcodes/libopcodes.la
+
+LIBIBERTY = ../libiberty/libiberty.a
+
+EXPECT = `if [ -f $$r/../expect/expect ] ; then \
+ echo $$r/../expect/expect ; \
+ else echo expect ; fi`
+RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \
+ echo ${srcdir}/../dejagnu/runtest ; \
+ else echo runtest ; fi`
+
+CC_FOR_TARGET = ` \
+ if [ -f $$r/../gcc/xgcc ] ; then \
+ if [ -f $$r/../newlib/Makefile ] ; then \
+ echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
+ else \
+ echo $$r/../gcc/xgcc -B$$r/../gcc/; \
+ fi; \
+ else \
+ if [ "@host@" = "@target@" ] ; then \
+ echo $(CC); \
+ else \
+ echo gcc | sed '$(transform)'; \
+ fi; \
+ fi`
+
+check-DEJAGNU: site.exp
+ srcdir=`cd $(srcdir) && pwd`; export srcdir; \
+ r=`pwd`; export r; \
+ EXPECT=$(EXPECT); export EXPECT; \
+ if [ -f $(top_builddir)/../expect/expect ]; then \
+ TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
+ export TCL_LIBRARY; \
+ fi; \
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
+ CC_FOR_TARGET="$(CC_FOR_TARGET)" \
+ CFLAGS_FOR_TARGET="$(CFLAGS)" $(RUNTESTFLAGS); \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi
+
+installcheck:
+ /bin/sh $(srcdir)/sanity.sh $(bindir)
+
+info_TEXINFOS = binutils.texi
+
+LDADD = $(BFDLIB) $(LIBIBERTY)
+
+size_SOURCES = size.c $(BULIBS)
+
+objcopy_SOURCES = objcopy.c not-strip.c $(WRITE_DEBUG_SRCS) $(BULIBS)
+
+strings_SOURCES = strings.c $(BULIBS)
+
+strip_new_SOURCES = objcopy.c is-strip.c $(WRITE_DEBUG_SRCS) $(BULIBS)
+
+nm_new_SOURCES = nm.c $(BULIBS)
+
+objdump_SOURCES = objdump.c prdbg.c $(DEBUG_SRCS) $(BULIBS)
+objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY)
+
+underscore.c: stamp-under ; @true
+
+stamp-under: Makefile
+ echo '/*WARNING: This file is automatically generated!*/' >underscore.t
+ echo "int prepends_underscore = @UNDERSCORE@;" >>underscore.t
+ $(SHELL) $(srcdir)/../move-if-change underscore.t underscore.c
+ touch stamp-under
+
+cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h
+ $(COMPILE) -c -DMAIN -DVERSION='"$(VERSION)"' $(BASEDIR)/libiberty/cplus-dem.c
+
+c__filt_SOURCES =
+c__filt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY)
+
+ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c $(BULIBS)
+ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
+
+ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c $(BULIBS)
+ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
+
+addr2line_SOURCES = addr2line.c $(BULIBS)
+
+# The following is commented out for the convertion to automake.
+# This rule creates a single binary that switches between ar and ranlib
+# by looking at argv[0]. Use this kludge to save some disk space.
+# However, you have to install things by hand.
+# (That is after 'make install', replace the installed ranlib by a link to ar.)
+# Alternatively, you can install ranlib.sh as ranlib.
+# ar_with_ranlib: $(ADDL_DEPS) ar.o maybe-ranlib.o
+# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
+# -rm -f $(RANLIB_PROG)
+# -ln $(AR_PROG) $(RANLIB_PROG)
+#
+# objcopy and strip in one binary that uses argv[0] to decide its action.
+#
+#objcopy_with_strip: $(ADDL_DEPS) objcopy.o maybe-strip.o
+# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS)
+# -rm -f $(STRIP_PROG)
+# -ln $(OBJCOPY_PROG) $(STRIP_PROG)
+
+sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info
+ ./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c
+ ./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c
+ ./sysinfo$(EXEEXT_FOR_BUILD) -g <$(srcdir)/sysroff.info >>sysroff.c
+
+sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info
+ ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
+
+sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
+ $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
+
+syslex.o: syslex.c sysinfo.h
+ if [ -r syslex.c ]; then \
+ $(CC_FOR_BUILD) -c -I. $(CFLAGS) syslex.c ; \
+ else \
+ $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS) $(srcdir)/syslex.c ;\
+ fi
+
+sysinfo.o: sysinfo.c
+ if [ -r sysinfo.c ]; then \
+ $(CC_FOR_BUILD) -c -I. $(CFLAGS) sysinfo.c ; \
+ else \
+ $(CC_FOR_BUILD) -c -I. $(CFLAGS) $(srcdir)/sysinfo.c ; \
+ fi
+
+srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
+
+dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
+dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
+
+dlltool.o:dlltool.c
+ $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
+
+coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
+
+sysdump_SOURCES = sysdump.c $(BULIBS)
+
+# coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
+# scripts, since they are only included conditionally.
+nlmconv.o: nlmconv.c $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
+ ldname=`echo ld | sed '$(transform)'`; \
+ $(COMPILE) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c
+
+nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS)
+
+windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \
+ $(BULIBS)
+windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
+
+DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
+ syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c
+
+diststuff: $(DISTSTUFF) info
+
+DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \
+ site.exp site.bak
+
+# Targets to rebuild dependencies in this Makefile.
+# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
+.dep: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
+ rm -f .dep1
+ $(MAKE) DEP=$(DEP) .dep1
+ sed -f dep.sed <.dep1 >.dep
+
+# This rule really wants a mkdep that runs "gcc -MM".
+.dep1: $(CFILES) $(GENERATED_CFILES)
+ rm -f .dep2
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
+ $(DEP) -f .dep2 $(INCLUDES) $?
+ $(SHELL) $(srcdir)/../move-if-change .dep2 .dep1
+
+dep.sed: dep-in.sed config.status
+ objdir=`pwd`; \
+ sed <$(srcdir)/dep-in.sed >dep.sed \
+ -e 's!@INCDIR@!$(INCDIR)!' \
+ -e 's!@BFDDIR@!$(BFDDIR)!' \
+ -e 's!@SRCDIR@!$(srcdir)!' \
+ -e "s!@OBJDIR@!$${objdir}!"
+
+dep: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
+ cat .dep >> tmp-Makefile
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
+
+dep-in: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
+ cat .dep >> tmp-Makefile.in
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
+
+dep-am: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
+ cat .dep >> tmp-Makefile.am
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
+
+.PHONY: dep dep-in dep-am
+
+###
+# DOCUMENTATION TARGETS
+config.texi: Makefile
+ rm -f config.texi
+ echo '@set VERSION $(VERSION)' > config.texi
+
+binutils.dvi: $(srcdir)/binutils.texi config.texi
+
+binutils.info: $(srcdir)/binutils.texi config.texi
+
+$(DEMANGLER_PROG).1: cxxfilt.man Makefile
+ sed -e 's/@PROGRAM@/$(DEMANGLER_PROG)/' < $(srcdir)/cxxfilt.man \
+ > $(DEMANGLER_PROG).1
+
+MOSTLYCLEANFILES = sysinfo $(DEMANGLER_PROG).1 binutils.log binutils.sum \
+ abcdefgh*
+mostlyclean-local:
+ -rm -rf tmpdir
+
+CLEANFILES = dep.sed .dep .dep1
+
+.PHONY: install-exec-local
+
+install-exec-local: $(bin_PROGRAMS) $(noinst_PROGRAMS)
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`"; \
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`; \
+ else :; fi; \
+ done
+ $(mkinstalldirs) $(tooldir)/bin
+ for i in $(TOOL_PROGS); do \
+ if [ -f $$i$(EXEEXT) ]; then \
+ j=`echo $$i | sed -e 's/-new//'`; \
+ rm -f $(tooldir)/bin/$$j$(EXEEXT); \
+ k=`echo $$j | sed '$(transform)'`; \
+ if [ "$(bindir)/$$k$(EXEEXT)" != "$(tooldir)/bin/$$j$(EXEEXT)" ]; then \
+ ln $(bindir)/$$k$(EXEEXT) $(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \
+ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(tooldir)/bin/$$j$(EXEEXT); \
+ fi; \
+ else true; \
+ fi; \
+ done
+
+# What appears below is generated by a hacked mkdep using gcc -MM.
+
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+
+addr2line.o: addr2line.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/getopt.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h
+ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h arsup.h
+arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ arsup.h $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/fopen-same.h
+bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/fopen-same.h
+coffdump.o: coffdump.c coffgrok.h bucomm.h config.h \
+ $(INCDIR)/fopen-same.h
+coffgrok.o: coffgrok.c bucomm.h config.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ coffgrok.h
+debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ debug.h
+dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/getopt.h $(INCDIR)/demangle.h dlltool.h
+filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h
+ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/ieee.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ debug.h budbg.h
+is-ranlib.o: is-ranlib.c
+is-strip.o: is-strip.c
+maybe-ranlib.o: maybe-ranlib.c
+maybe-strip.o: maybe-strip.c
+nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/fopen-same.h \
+ $(BFDDIR)/libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
+ $(INCDIR)/nlm/external.h nlmconv.h
+nm.o: nm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/progress.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h \
+ $(INCDIR)/demangle.h $(INCDIR)/libiberty.h
+not-ranlib.o: not-ranlib.c
+not-strip.o: not-strip.c
+objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/getopt.h $(INCDIR)/libiberty.h budbg.h
+objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/getopt.h $(INCDIR)/progress.h bucomm.h config.h \
+ $(INCDIR)/fopen-same.h $(INCDIR)/dis-asm.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/aout/aout64.h
+prdbg.o: prdbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ debug.h budbg.h
+rdcoff.o: rdcoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/coff/internal.h bucomm.h config.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/libiberty.h $(INCDIR)/demangle.h debug.h \
+ budbg.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+rddbg.o: rddbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ debug.h budbg.h
+size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h
+srconv.o: srconv.c bucomm.h config.h $(INCDIR)/fopen-same.h \
+ sysroff.h coffgrok.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h sysroff.c
+stabs.o: stabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
+strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h
+sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h sysroff.h \
+ sysroff.c
+version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h
+wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def
+windres.o: windres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/getopt.h bucomm.h config.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/libiberty.h $(INCDIR)/obstack.h windres.h
+resrc.o: resrc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h
+rescoff.o: rescoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+resbin.o: resbin.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h
+underscore.o: underscore.c
+arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h arsup.h
+arlex.o: arlex.c $(INCDIR)/libiberty.h arparse.h
+sysroff.o: sysroff.c
+sysinfo.o: sysinfo.c
+syslex.o: syslex.c sysinfo.h
+defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h dlltool.h
+deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
+ defparse.h dlltool.h
+nlmheader.o: nlmheader.c ../bfd/bfd.h bucomm.h config.h \
+ $(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
+ nlmconv.h
+rcparse.o: rcparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h
+rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h rcparse.h
+
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/contrib/binutils/binutils/Makefile.in b/contrib/binutils/binutils/Makefile.in
index 20d1a36..34475def 100644
--- a/contrib/binutils/binutils/Makefile.in
+++ b/contrib/binutils/binutils/Makefile.in
@@ -1,86 +1,97 @@
-# Makefile for GNU binary-file utilities
-# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+# Makefile.in generated automatically by automake 1.2e from Makefile.am
-# This file is part of GNU binutils.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
-# 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.
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-VPATH = @srcdir@
-srcdir = @srcdir@
-target_alias = @target_alias@
-prefix = @prefix@
+SHELL = @SHELL@
-program_transform_name = @program_transform_name@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-tooldir = $(exec_prefix)/$(target_alias)
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
datadir = @datadir@
-mandir = @mandir@
-man1dir = $(mandir)/man1
-man2dir = $(mandir)/man2
-man3dir = $(mandir)/man3
-man4dir = $(mandir)/man4
-man5dir = $(mandir)/man5
-man6dir = $(mandir)/man6
-man7dir = $(mandir)/man7
-man8dir = $(mandir)/man8
-man9dir = $(mandir)/man9
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
infodir = @infodir@
+mandir = @mandir@
includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
-SHELL = /bin/sh
+top_builddir = .
-INSTALL = `cd $(srcdir)/..;pwd`/install.sh -c
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
-INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 -m 644
-
-AR = ar
-AR_FLAGS = rc
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AR = @AR@
+BUILD_DLLTOOL = @BUILD_DLLTOOL@
+BUILD_NLMCONV = @BUILD_NLMCONV@
+BUILD_SRCONV = @BUILD_SRCONV@
+BUILD_WINDRES = @BUILD_WINDRES@
CC = @CC@
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-HLDFLAGS = @HLDFLAGS@
-HLDENV = @HLDENV@
-RPATH_ENVVAR = @RPATH_ENVVAR@
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-RANLIB = ranlib
-BISONFLAGS = -d
-TEXI2ROFF=texi2roff
-MAKEOVERRIDES=
-CC_FOR_BUILD = @CC_FOR_BUILD@
-NM_FOR_TARGET = nm
-NM = $(NM_FOR_TARGET)
-SYMLINK = ln -s
+DLLTOOL_DEFS = @DLLTOOL_DEFS@
+EXEEXT = @EXEEXT@
+HDEFINES = @HDEFINES@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NLMCONV_DEFS = @NLMCONV_DEFS@
+NM = @NM@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+UNDERSCORE = @UNDERSCORE@
+VERSION = @VERSION@
+
+AUTOMAKE_OPTIONS = cygnus dejagnu
-BISON = bison -y
-LEX_OPTIONS =
-LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
+tooldir = $(exec_prefix)/$(target_alias)
-# Distribution version
-VERSION=2.8.1
-# Distribution name
-DIST_NAME=binutils-${VERSION}
+CC_FOR_BUILD = @CC_FOR_BUILD@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
-# Where to find texinfo.tex to format docn with TeX
-TEXIDIR = $(srcdir)/../texinfo
+YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
+YFLAGS = -d
+LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
# these two are almost the same program
AR_PROG=ar
@@ -88,13 +99,13 @@ RANLIB_PROG=ranlib
# objcopy and strip should be the same program
OBJCOPY_PROG=objcopy
-STRIP_PROG=strip.new
+STRIP_PROG=strip-new
STRINGS_PROG=strings
# These should all be the same program too.
SIZE_PROG=size
-NM_PROG=nm.new
+NM_PROG=nm-new
OBJDUMP_PROG=objdump
# This is the demangler, as a standalone program.
@@ -105,31 +116,34 @@ ADDR2LINE_PROG=addr2line
NLMCONV_PROG=nlmconv
DLLTOOL_PROG=dlltool
+WINDRES_PROG=windres
SRCONV_PROG=srconv sysdump coffdump
-MANPAGES= ar nm objdump ranlib size strings strip objcopy addr2line nlmconv
+man_MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 \
+ addr2line.1 nlmconv.1 $(DEMANGLER_PROG).1
+
+PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG)
-PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(ADDR2LINE_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@
-STAGESTUFF = $(PROGS) *.o
-# Files that can be generated, but should be in the distribution.
-# Don't build $(DEMANGLER_PROG).1, since its name may vary with the
-# configuration.
-DISTSTUFF=arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
- syslex.c deflex.c
+bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG)
+
+noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG)
+
+EXTRA_PROGRAMS = $(NLMCONV_PROG) $(SRCONV_PROG) $(DLLTOOL_PROG) $(WINDRES_PROG)
# Stuff that goes in tooldir/ if appropriate
-TOOL_PROGS = nm.new strip.new ar ranlib $(DLLTOOL_PROG)
+TOOL_PROGS = nm-new strip-new ar ranlib dlltool
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include
-INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR)
+
DEP = mkdep
-ALL_CFLAGS = -D_GNU_SOURCE $(INCLUDES) @HDEFINES@ $(CFLAGS)
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@
-HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h
+HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \
+ windres.h
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h
@@ -137,31 +151,24 @@ CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c \
dlltool.c filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c \
maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c \
objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \
- stabs.c strings.c sysdump.c version.c wrstabs.c
+ stabs.c strings.c sysdump.c version.c wrstabs.c \
+ windres.c resrc.c rescoff.c resbin.c
GENERATED_CFILES = \
underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
- defparse.c deflex.c nlmheader.c
+ defparse.c deflex.c nlmheader.c rcparse.c rclex.c
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $<
-
-DEBUG_OBJS = rddbg.o debug.o stabs.o ieee.o rdcoff.o
-WRITE_DEBUG_OBJS = $(DEBUG_OBJS) wrstabs.o
-
-LIBIBERTY = ../libiberty/libiberty.a
+DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
+WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
# Code shared by all the binutils.
-BULIBS = bucomm.o version.o filemode.o
+BULIBS = bucomm.c version.c filemode.c
-BFDLIB_DEP = ../bfd/libbfd.a
-BFDLIB = @BFDLIB@
+BFDLIB = ../bfd/libbfd.la
-OPCODES_DEP = ../opcodes/libopcodes.a
-OPCODES = @OPCODES@
+OPCODES = ../opcodes/libopcodes.la
-ADDL_DEPS = $(BULIBS) $(BFDLIB_DEP) $(LIBIBERTY)
-ADDL_LIBS = $(BULIBS) $(BFDLIB) $(LIBIBERTY)
+LIBIBERTY = ../libiberty/libiberty.a
EXPECT = `if [ -f $$r/../expect/expect ] ; then \
echo $$r/../expect/expect ; \
@@ -169,7 +176,6 @@ EXPECT = `if [ -f $$r/../expect/expect ] ; then \
RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \
echo ${srcdir}/../dejagnu/runtest ; \
else echo runtest ; fi`
-RUNTESTFLAGS =
CC_FOR_TARGET = ` \
if [ -f $$r/../gcc/xgcc ] ; then \
@@ -182,174 +188,781 @@ CC_FOR_TARGET = ` \
if [ "@host@" = "@target@" ] ; then \
echo $(CC); \
else \
- echo gcc | sed '$(program_transform_name)'; \
+ echo gcc | sed '$(transform)'; \
fi; \
fi`
-FLAGS_TO_PASS = \
- "CC=$(CC)" \
- "CFLAGS=$(CFLAGS)" \
- "RUNTEST=$(RUNTEST)" \
- "RUNTESTFLAGS=$(RUNTESTFLAGS)"
-#
-## The rules
-
-all: $(ADDL_DEPS) $(PROGS)
-
-# These targets are for the dejagnu testsuites. The file site.exp
-# contains global variables that all the testsuites will use.
-
-site.exp: ./config.status Makefile
- @echo "Making a new config file..."
- @rm -f ./tmp?
- @touch site.exp
- @mv site.exp site.bak
- @echo "## variables are automatically generated by make ##" > ./tmp0
- @echo "# Do not edit here. If you wish to override these" >> ./tmp0
- @echo "# values, add them to the last section" >> ./tmp0
- @echo "# HOST AND TARGET INFO" >> ./tmp0
- @echo "set host_os @host_os@" >> ./tmp0
- @echo "set host_alias @host_alias@" >> ./tmp0
- @echo "set host_cpu @host_cpu@" >> ./tmp0
- @echo "set host_vendor @host_vendor@" >> ./tmp0
- @echo "set target_os @target_os@" >> ./tmp0
- @echo "set target_alias @target_alias@" >> ./tmp0
- @echo "set target_cpu @target_cpu@" >> ./tmp0
- @echo "set target_vendor @target_vendor@" >> ./tmp0
- @echo "set host_triplet @host@" >> ./tmp0
- @echo "set target_triplet @target@" >> ./tmp0
- @echo "# DIRECTORY INFO" >> ./tmp0
- @echo "set objdir `pwd`" >> ./tmp0
- @echo "" >> ./tmp0
- @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
- @cat ./tmp0 > site.exp
- @cat site.bak | sed \
- -e '1,/^## Variables generated by.*##/ d' >> site.exp
- -@rm -f ./tmp?
-
-check: site.exp
- r=`pwd`; export r ; \
- srcroot=`cd ${srcdir}; pwd` ; export srcroot ; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- $(RPATH_ENVVAR)=$$r/../bfd:$$r/../opcodes:$$$(RPATH_ENVVAR); \
- export $(RPATH_ENVVAR); \
- if [ -f $$r/../expect/expect ] ; then \
- TCL_LIBRARY=$${srcroot}/../tcl/library ; \
- export TCL_LIBRARY ; else true; fi ; \
- $(RUNTEST) --tool binutils --srcdir $(srcdir)/testsuite \
- $(RUNTESTFLAGS) CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)"
+info_TEXINFOS = binutils.texi
-installcheck:
- /bin/sh $(srcdir)/sanity.sh $(bindir)
+LDADD = $(BFDLIB) $(LIBIBERTY)
-info: binutils.info
+size_SOURCES = size.c $(BULIBS)
-dvi: binutils.dvi
+objcopy_SOURCES = objcopy.c not-strip.c $(WRITE_DEBUG_SRCS) $(BULIBS)
-$(SIZE_PROG): $(ADDL_DEPS) size.o
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(EXTRALIBS)
+strings_SOURCES = strings.c $(BULIBS)
-$(OBJCOPY_PROG): $(ADDL_DEPS) objcopy.o not-strip.o $(WRITE_DEBUG_OBJS)
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o not-strip.o $(WRITE_DEBUG_OBJS) $(ADDL_LIBS) $(EXTRALIBS)
+strip_new_SOURCES = objcopy.c is-strip.c $(WRITE_DEBUG_SRCS) $(BULIBS)
-$(STRINGS_PROG): $(ADDL_DEPS) strings.o
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(STRINGS_PROG) strings.o $(ADDL_LIBS) $(EXTRALIBS)
+nm_new_SOURCES = nm.c $(BULIBS)
-$(STRIP_PROG): $(ADDL_DEPS) objcopy.o is-strip.o $(WRITE_DEBUG_OBJS)
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(STRIP_PROG) objcopy.o is-strip.o $(WRITE_DEBUG_OBJS) $(ADDL_LIBS) $(EXTRALIBS)
+objdump_SOURCES = objdump.c prdbg.c $(DEBUG_SRCS) $(BULIBS)
+objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY)
-$(NM_PROG): $(ADDL_DEPS) nm.o
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(EXTRALIBS)
+c__filt_SOURCES =
+c__filt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY)
-$(OBJDUMP_PROG): $(ADDL_DEPS) objdump.o prdbg.o $(DEBUG_OBJS) $(OPCODES_DEP)
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJDUMP_PROG) objdump.o prdbg.o $(DEBUG_OBJS) $(OPCODES) $(ADDL_LIBS) $(EXTRALIBS)
+ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c $(BULIBS)
+ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
-underscore.c: stamp-under ; @true
+ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c $(BULIBS)
+ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
-stamp-under: Makefile
- echo '/*WARNING: This file is automatically generated!*/' >underscore.t
- echo "int prepends_underscore = @UNDERSCORE@;" >>underscore.t
- $(SHELL) $(srcdir)/../move-if-change underscore.t underscore.c
- touch stamp-under
+addr2line_SOURCES = addr2line.c $(BULIBS)
-version.o: version.c Makefile
- $(CC) -DVERSION='"$(VERSION)"' $(ALL_CFLAGS) -c $(srcdir)/version.c
+srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
-bucomm.o: bucomm.c Makefile
- $(CC) -DTARGET='"@target@"' $(ALL_CFLAGS) -c $(srcdir)/bucomm.c
+dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
+dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
-cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h
- $(CC) -c -DMAIN -DVERSION='"$(VERSION)"' $(ALL_CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c
+coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
+
+sysdump_SOURCES = sysdump.c $(BULIBS)
+
+nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS)
+
+windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \
+ $(BULIBS)
+windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
+
+DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
+ syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c
+
+DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \
+ site.exp site.bak
+
+MOSTLYCLEANFILES = sysinfo $(DEMANGLER_PROG).1 binutils.log binutils.sum \
+ abcdefgh*
+
+CLEANFILES = dep.sed .dep .dep1
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+bin_PROGRAMS = size$(EXEEXT) objdump$(EXEEXT) ar$(EXEEXT) \
+strings$(EXEEXT) ranlib$(EXEEXT) c++filt$(EXEEXT) objcopy$(EXEEXT) \
+@BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ \
+addr2line$(EXEEXT)
+noinst_PROGRAMS = nm-new$(EXEEXT) strip-new$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I.
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+nlmconv_OBJECTS = nlmconv.o nlmheader.o bucomm.o version.o filemode.o
+nlmconv_LDADD = $(LDADD)
+nlmconv_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+nlmconv_LDFLAGS =
+srconv_OBJECTS = srconv.o coffgrok.o bucomm.o version.o filemode.o
+srconv_LDADD = $(LDADD)
+srconv_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+srconv_LDFLAGS =
+sysdump_OBJECTS = sysdump.o bucomm.o version.o filemode.o
+sysdump_LDADD = $(LDADD)
+sysdump_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+sysdump_LDFLAGS =
+coffdump_OBJECTS = coffdump.o coffgrok.o bucomm.o version.o filemode.o
+coffdump_LDADD = $(LDADD)
+coffdump_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+coffdump_LDFLAGS =
+dlltool_OBJECTS = dlltool.o defparse.o deflex.o bucomm.o version.o \
+filemode.o
+dlltool_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+dlltool_LDFLAGS =
+windres_OBJECTS = windres.o resrc.o rescoff.o resbin.o rcparse.o \
+rclex.o bucomm.o version.o filemode.o
+windres_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+windres_LDFLAGS =
+size_OBJECTS = size.o bucomm.o version.o filemode.o
+size_LDADD = $(LDADD)
+size_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+size_LDFLAGS =
+objdump_OBJECTS = objdump.o prdbg.o rddbg.o debug.o stabs.o ieee.o \
+rdcoff.o bucomm.o version.o filemode.o
+objdump_DEPENDENCIES = ../opcodes/libopcodes.la ../bfd/libbfd.la \
+../libiberty/libiberty.a
+objdump_LDFLAGS =
+ar_OBJECTS = arparse.o arlex.o ar.o not-ranlib.o arsup.o bucomm.o \
+version.o filemode.o
+ar_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+ar_LDFLAGS =
+strings_OBJECTS = strings.o bucomm.o version.o filemode.o
+strings_LDADD = $(LDADD)
+strings_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+strings_LDFLAGS =
+ranlib_OBJECTS = ar.o is-ranlib.o arparse.o arlex.o arsup.o bucomm.o \
+version.o filemode.o
+ranlib_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+ranlib_LDFLAGS =
+c__filt_OBJECTS =
+c__filt_DEPENDENCIES = cplus-dem.o underscore.o \
+../libiberty/libiberty.a
+c__filt_LDFLAGS =
+objcopy_OBJECTS = objcopy.o not-strip.o rddbg.o debug.o stabs.o ieee.o \
+rdcoff.o wrstabs.o bucomm.o version.o filemode.o
+objcopy_LDADD = $(LDADD)
+objcopy_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+objcopy_LDFLAGS =
+addr2line_OBJECTS = addr2line.o bucomm.o version.o filemode.o
+addr2line_LDADD = $(LDADD)
+addr2line_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+addr2line_LDFLAGS =
+nm_new_OBJECTS = nm.o bucomm.o version.o filemode.o
+nm_new_LDADD = $(LDADD)
+nm_new_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+nm_new_LDFLAGS =
+strip_new_OBJECTS = objcopy.o is-strip.o rddbg.o debug.o stabs.o ieee.o \
+rdcoff.o wrstabs.o bucomm.o version.o filemode.o
+strip_new_LDADD = $(LDADD)
+strip_new_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+strip_new_LDFLAGS =
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LEXLIB = @LEXLIB@
+YLWRAP = $(top_srcdir)/../ylwrap
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
+TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
+INFO_DEPS = binutils.info
+DVIS = binutils.dvi
+TEXINFOS = binutils.texi
+MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 addr2line.1 nlmconv.1 $(DEMANGLER_PROG).1
+
+
+NROFF = nroff
+DIST_COMMON = README ChangeLog Makefile.am Makefile.in NEWS acconfig.h \
+acinclude.m4 aclocal.m4 arlex.c arparse.c config.in configure \
+configure.in deflex.c defparse.c nlmheader.c rclex.c rcparse.c \
+stamp-h.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP = --best
+SOURCES = $(nlmconv_SOURCES) $(srconv_SOURCES) $(sysdump_SOURCES) $(coffdump_SOURCES) $(dlltool_SOURCES) $(windres_SOURCES) $(size_SOURCES) $(objdump_SOURCES) $(ar_SOURCES) $(strings_SOURCES) $(ranlib_SOURCES) $(c__filt_SOURCES) $(objcopy_SOURCES) $(addr2line_SOURCES) $(nm_new_SOURCES) $(strip_new_SOURCES)
+OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJECTS) $(dlltool_OBJECTS) $(windres_OBJECTS) $(size_OBJECTS) $(objdump_OBJECTS) $(ar_OBJECTS) $(strings_OBJECTS) $(ranlib_OBJECTS) $(c__filt_OBJECTS) $(objcopy_OBJECTS) $(addr2line_OBJECTS) $(nm_new_OBJECTS) $(strip_new_OBJECTS)
+
+default: all
+
+.SUFFIXES:
+.SUFFIXES: .S .c .dvi .info .l .lo .o .ps .s .texi .texinfo .y
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINT@ configure.in acinclude.m4
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+ @:
+stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h
+$(srcdir)/config.in: @MAINT@$(srcdir)/stamp-h.in
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f config.h
+
+maintainer-clean-hdr:
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ $(NORMAL_UNINSTALL)
+ list='$(bin_PROGRAMS)'; for p in $$list; do \
+ rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+ done
+
+mostlyclean-noinstPROGRAMS:
+
+clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+
+distclean-noinstPROGRAMS:
+
+maintainer-clean-noinstPROGRAMS:
+
+.c.o:
+ $(COMPILE) -c $<
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.c.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+nlmconv$(EXEEXT): $(nlmconv_OBJECTS) $(nlmconv_DEPENDENCIES)
+ @rm -f nlmconv$(EXEEXT)
+ $(LINK) $(nlmconv_LDFLAGS) $(nlmconv_OBJECTS) $(nlmconv_LDADD) $(LIBS)
+
+srconv$(EXEEXT): $(srconv_OBJECTS) $(srconv_DEPENDENCIES)
+ @rm -f srconv$(EXEEXT)
+ $(LINK) $(srconv_LDFLAGS) $(srconv_OBJECTS) $(srconv_LDADD) $(LIBS)
+
+sysdump$(EXEEXT): $(sysdump_OBJECTS) $(sysdump_DEPENDENCIES)
+ @rm -f sysdump$(EXEEXT)
+ $(LINK) $(sysdump_LDFLAGS) $(sysdump_OBJECTS) $(sysdump_LDADD) $(LIBS)
+
+coffdump$(EXEEXT): $(coffdump_OBJECTS) $(coffdump_DEPENDENCIES)
+ @rm -f coffdump$(EXEEXT)
+ $(LINK) $(coffdump_LDFLAGS) $(coffdump_OBJECTS) $(coffdump_LDADD) $(LIBS)
+
+dlltool$(EXEEXT): $(dlltool_OBJECTS) $(dlltool_DEPENDENCIES)
+ @rm -f dlltool$(EXEEXT)
+ $(LINK) $(dlltool_LDFLAGS) $(dlltool_OBJECTS) $(dlltool_LDADD) $(LIBS)
+
+windres$(EXEEXT): $(windres_OBJECTS) $(windres_DEPENDENCIES)
+ @rm -f windres$(EXEEXT)
+ $(LINK) $(windres_LDFLAGS) $(windres_OBJECTS) $(windres_LDADD) $(LIBS)
-$(DEMANGLER_PROG): cplus-dem.o $(LIBIBERTY) underscore.o $(DEMANGLER_PROG).1
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(DEMANGLER_PROG) cplus-dem.o $(LIBIBERTY) $(EXTRALIBS) underscore.o
+size$(EXEEXT): $(size_OBJECTS) $(size_DEPENDENCIES)
+ @rm -f size$(EXEEXT)
+ $(LINK) $(size_LDFLAGS) $(size_OBJECTS) $(size_LDADD) $(LIBS)
-arparse.c: arparse.y
- $(BISON) $(BISONFLAGS) $(srcdir)/arparse.y
- mv -f y.tab.c arparse.c
- mv -f y.tab.h arparse.h
+objdump$(EXEEXT): $(objdump_OBJECTS) $(objdump_DEPENDENCIES)
+ @rm -f objdump$(EXEEXT)
+ $(LINK) $(objdump_LDFLAGS) $(objdump_OBJECTS) $(objdump_LDADD) $(LIBS)
-# Separate from arparse.c so that a parallel make doesn't try to build
-# both arparse.c and arparse.h simultaneously.
+ar$(EXEEXT): $(ar_OBJECTS) $(ar_DEPENDENCIES)
+ @rm -f ar$(EXEEXT)
+ $(LINK) $(ar_LDFLAGS) $(ar_OBJECTS) $(ar_LDADD) $(LIBS)
+
+strings$(EXEEXT): $(strings_OBJECTS) $(strings_DEPENDENCIES)
+ @rm -f strings$(EXEEXT)
+ $(LINK) $(strings_LDFLAGS) $(strings_OBJECTS) $(strings_LDADD) $(LIBS)
+
+ranlib$(EXEEXT): $(ranlib_OBJECTS) $(ranlib_DEPENDENCIES)
+ @rm -f ranlib$(EXEEXT)
+ $(LINK) $(ranlib_LDFLAGS) $(ranlib_OBJECTS) $(ranlib_LDADD) $(LIBS)
+
+c++filt$(EXEEXT): $(c__filt_OBJECTS) $(c__filt_DEPENDENCIES)
+ @rm -f c++filt$(EXEEXT)
+ $(LINK) $(c__filt_LDFLAGS) $(c__filt_OBJECTS) $(c__filt_LDADD) $(LIBS)
+
+objcopy$(EXEEXT): $(objcopy_OBJECTS) $(objcopy_DEPENDENCIES)
+ @rm -f objcopy$(EXEEXT)
+ $(LINK) $(objcopy_LDFLAGS) $(objcopy_OBJECTS) $(objcopy_LDADD) $(LIBS)
+
+addr2line$(EXEEXT): $(addr2line_OBJECTS) $(addr2line_DEPENDENCIES)
+ @rm -f addr2line$(EXEEXT)
+ $(LINK) $(addr2line_LDFLAGS) $(addr2line_OBJECTS) $(addr2line_LDADD) $(LIBS)
+
+nm-new$(EXEEXT): $(nm_new_OBJECTS) $(nm_new_DEPENDENCIES)
+ @rm -f nm-new$(EXEEXT)
+ $(LINK) $(nm_new_LDFLAGS) $(nm_new_OBJECTS) $(nm_new_LDADD) $(LIBS)
+
+strip-new$(EXEEXT): $(strip_new_OBJECTS) $(strip_new_DEPENDENCIES)
+ @rm -f strip-new$(EXEEXT)
+ $(LINK) $(strip_new_LDFLAGS) $(strip_new_OBJECTS) $(strip_new_LDADD) $(LIBS)
+.y.c:
+ $(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
+defparse.h: defparse.c
arparse.h: arparse.c
+rcparse.h: rcparse.c
+nlmheader.h: nlmheader.c
+
+.l.c:
+ $(SHELL) $(YLWRAP) "$(LEX)" $< $(LEX_OUTPUT_ROOT).c $@ -- $(LFLAGS)
+
+binutils.info: binutils.texi
+binutils.dvi: binutils.texi
+
+
+DVIPS = dvips
+
+.texi.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texi.dvi:
+ TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.texi:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo.dvi:
+ TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+.dvi.ps:
+ $(DVIPS) $< -o $@
+
+install-info-am: $(INFO_DEPS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(infodir)
+ @for file in $(INFO_DEPS); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+ if test -f $$d/$$ifile; then \
+ echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
+ $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+ else : ; fi; \
+ done; \
+ done
+ @$(POST_INSTALL)
+ @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ for file in $(INFO_DEPS); do \
+ echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
+ install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+ done; \
+ else : ; fi
+
+uninstall-info:
+ $(PRE_UNINSTALL)
+ @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ ii=yes; \
+ else ii=; fi; \
+ for file in $(INFO_DEPS); do \
+ test -z "$ii" \
+ || install-info --info-dir=$(infodir) --remove $$file; \
+ done
+ $(NORMAL_UNINSTALL)
+ for file in $(INFO_DEPS); do \
+ (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+ done
-arlex.c: arlex.l
- $(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l
- mv lex.yy.c arlex.c
+dist-info: $(INFO_DEPS)
+ for base in $(INFO_DEPS); do \
+ if test -f $$base; then d=.; else d=$(srcdir); fi; \
+ for file in `cd $$d && eval echo $$base*`; do \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done; \
+ done
-$(AR_PROG): $(ADDL_DEPS) ar.o arparse.o arlex.o not-ranlib.o arsup.o
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
+mostlyclean-aminfo:
+ -rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
+ binutils.fns binutils.ky binutils.kys binutils.ps \
+ binutils.log binutils.pg binutils.toc binutils.tp \
+ binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
+ binutils.cv binutils.cn
-$(RANLIB_PROG): $(ADDL_DEPS) ar.o is-ranlib.o arparse.o arlex.o arsup.o
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
+clean-aminfo:
-$(ADDR2LINE_PROG): $(ADDL_DEPS) addr2line.o
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(ADDR2LINE_PROG) addr2line.o $(ADDL_LIBS) $(EXTRALIBS)
+distclean-aminfo:
-# This rule creates a single binary that switches between ar and ranlib
-# by looking at argv[0]. Use this kludge to save some disk space.
-# However, you have to install things by hand.
-# (That is after 'make install', replace the installed ranlib by a link to ar.)
+maintainer-clean-aminfo:
+ for i in $(INFO_DEPS); do \
+ rm -f $$i; \
+ if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
+ rm -f $$i-[0-9]*; \
+ fi; \
+ done
+clean-info: mostlyclean-aminfo
+install-man: $(MANS)
+ $(NORMAL_INSTALL)
+ $(mkinstalldirs) $(mandir)/man1
+ @sect=1; \
+ inst=`echo "ar" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/ar.1; then file=$(srcdir)/ar.1; \
+ else file=ar.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "nlmconv" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/nlmconv.1; then file=$(srcdir)/nlmconv.1; \
+ else file=nlmconv.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "$(DEMANGLER_PROG)" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/$(DEMANGLER_PROG).1; then file=$(srcdir)/$(DEMANGLER_PROG).1; \
+ else file=$(DEMANGLER_PROG).1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "nm" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/nm.1; then file=$(srcdir)/nm.1; \
+ else file=nm.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "objdump" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/objdump.1; then file=$(srcdir)/objdump.1; \
+ else file=objdump.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "ranlib" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/ranlib.1; then file=$(srcdir)/ranlib.1; \
+ else file=ranlib.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "size" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/size.1; then file=$(srcdir)/size.1; \
+ else file=size.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "strings" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/strings.1; then file=$(srcdir)/strings.1; \
+ else file=strings.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "strip" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/strip.1; then file=$(srcdir)/strip.1; \
+ else file=strip.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "objcopy" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/objcopy.1; then file=$(srcdir)/objcopy.1; \
+ else file=objcopy.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+ @sect=1; \
+ inst=`echo "addr2line" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/addr2line.1; then file=$(srcdir)/addr2line.1; \
+ else file=addr2line.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+
+uninstall-man:
+ $(NORMAL_UNINSTALL)
+ -inst=`echo "ar" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "nlmconv" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "$(DEMANGLER_PROG)" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "nm" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "objdump" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "ranlib" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "size" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "strings" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "strip" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "objcopy" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+ -inst=`echo "addr2line" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) \
+ && $(MAKE) dvi \
+ && $(MAKE) check \
+ && $(MAKE) install \
+ && $(MAKE) installcheck \
+ && $(MAKE) dist
+ -rm -rf $(distdir)
+ @echo "========================"; \
+ echo "$(distdir).tar.gz is ready for distribution"; \
+ echo "========================"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done
+ $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
-# Alternatively, you can install ranlib.sh as ranlib.
+RUNTESTFLAGS =
-ar_with_ranlib: $(ADDL_DEPS) ar.o maybe-ranlib.o
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
- -rm -f $(RANLIB_PROG)
- -ln $(AR_PROG) $(RANLIB_PROG)
+DEJATOOL = $(PACKAGE)
+
+RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
+site.exp: Makefile
+ @echo 'Making a new site.exp file...'
+ -@rm -f site.bak
+ @echo '## these variables are automatically generated by make ##' > $@-t
+ @echo '# Do not edit here. If you wish to override these values' >> $@-t
+ @echo '# edit the last section' >> $@-t
+ @echo 'set tool $(DEJATOOL)' >> $@-t
+ @echo 'set srcdir $(srcdir)' >> $@-t
+ @echo 'set objdir' `pwd` >> $@-t
+ @echo 'set host_alias $(host_alias)' >> $@-t
+ @echo 'set host_triplet $(host_triplet)' >> $@-t
+ @echo 'set target_alias $(target_alias)' >> $@-t
+ @echo 'set target_triplet $(target_triplet)' >> $@-t
+ @echo 'set build_alias $(build_alias)' >> $@-t
+ @echo 'set build_triplet $(build_triplet)' >> $@-t
+ @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
+ -@sed '1,/^## All variables above are.*##/ d' site.bak >> $@-t
+ -@mv site.exp site.bak
+ @mv $@-t site.exp
+info: $(INFO_DEPS)
+dvi: $(DVIS)
+check:
+ $(MAKE) check-DEJAGNU
+installcheck:
+install-info: install-info-am
+install-exec: install-binPROGRAMS install-exec-local
+ @$(NORMAL_INSTALL)
-# objcopy and strip in one binary that uses argv[0] to decide its action.
+install-data: install-man
+ @$(NORMAL_INSTALL)
+
+install: install-exec install-data all
+ @:
+
+uninstall: uninstall-binPROGRAMS uninstall-man
+
+all: Makefile $(PROGRAMS) $(MANS) config.h
-objcopy_with_strip: $(ADDL_DEPS) objcopy.o maybe-strip.o
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS)
- -rm -f $(STRIP_PROG)
- -ln $(OBJCOPY_PROG) $(STRIP_PROG)
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs:
+ $(mkinstalldirs) $(bindir) $(mandir)/man1
-sysroff.c: sysinfo sysroff.info
- ./sysinfo -c <$(srcdir)/sysroff.info >sysroff.c
- ./sysinfo -i <$(srcdir)/sysroff.info >>sysroff.c
- ./sysinfo -g <$(srcdir)/sysroff.info >>sysroff.c
-sysroff.h: sysinfo sysroff.info
- ./sysinfo -d <$(srcdir)/sysroff.info >sysroff.h
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-# Depend upon arparse.c to avoid building both arparse.c and sysinfo.c
-# simultaneously.
-sysinfo.c: sysinfo.y arparse.c
- $(BISON) -tvd $(srcdir)/sysinfo.y
- rm -f sysinfo.c
- mv -f y.tab.c sysinfo.c
- mv -f y.tab.h sysinfo.h
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-# Separate from sysinfo.c so that a parallel make doesn't try to build
-# both sysinfo.c and sysinfo.h simultaneously.
-sysinfo.h: sysinfo.c
+distclean-generic:
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-syslex.c : syslex.l
- $(LEX) $(LEX_OPTIONS) $(srcdir)/syslex.l
- mv lex.yy.c syslex.c
+maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean: mostlyclean-hdr mostlyclean-binPROGRAMS \
+ mostlyclean-noinstPROGRAMS mostlyclean-compile \
+ mostlyclean-libtool mostlyclean-aminfo mostlyclean-tags \
+ mostlyclean-generic mostlyclean-local
-sysinfo: sysinfo.o syslex.o
+clean: clean-hdr clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \
+ clean-libtool clean-aminfo clean-tags clean-generic \
+ mostlyclean
+
+distclean: distclean-hdr distclean-binPROGRAMS distclean-noinstPROGRAMS \
+ distclean-compile distclean-libtool distclean-aminfo \
+ distclean-tags distclean-generic clean
+ -rm -f config.status
+ -rm -f libtool
+
+maintainer-clean: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
+ maintainer-clean-noinstPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-aminfo maintainer-clean-tags \
+ maintainer-clean-generic distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f config.status
+
+.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
+maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
+clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
+install-binPROGRAMS mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool install-info-am uninstall-info \
+mostlyclean-aminfo distclean-aminfo clean-aminfo \
+maintainer-clean-aminfo install-man uninstall-man tags mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \
+info dvi installcheck install-info install-exec install-data install \
+uninstall all installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
+
+
+check-DEJAGNU: site.exp
+ srcdir=`cd $(srcdir) && pwd`; export srcdir; \
+ r=`pwd`; export r; \
+ EXPECT=$(EXPECT); export EXPECT; \
+ if [ -f $(top_builddir)/../expect/expect ]; then \
+ TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
+ export TCL_LIBRARY; \
+ fi; \
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
+ CC_FOR_TARGET="$(CC_FOR_TARGET)" \
+ CFLAGS_FOR_TARGET="$(CFLAGS)" $(RUNTESTFLAGS); \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi
+
+installcheck:
+ /bin/sh $(srcdir)/sanity.sh $(bindir)
+
+underscore.c: stamp-under ; @true
+
+stamp-under: Makefile
+ echo '/*WARNING: This file is automatically generated!*/' >underscore.t
+ echo "int prepends_underscore = @UNDERSCORE@;" >>underscore.t
+ $(SHELL) $(srcdir)/../move-if-change underscore.t underscore.c
+ touch stamp-under
+
+cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h
+ $(COMPILE) -c -DMAIN -DVERSION='"$(VERSION)"' $(BASEDIR)/libiberty/cplus-dem.c
+
+# The following is commented out for the convertion to automake.
+# This rule creates a single binary that switches between ar and ranlib
+# by looking at argv[0]. Use this kludge to save some disk space.
+# However, you have to install things by hand.
+# (That is after 'make install', replace the installed ranlib by a link to ar.)
+# Alternatively, you can install ranlib.sh as ranlib.
+# ar_with_ranlib: $(ADDL_DEPS) ar.o maybe-ranlib.o
+# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
+# -rm -f $(RANLIB_PROG)
+# -ln $(AR_PROG) $(RANLIB_PROG)
+#
+# objcopy and strip in one binary that uses argv[0] to decide its action.
+#
+#objcopy_with_strip: $(ADDL_DEPS) objcopy.o maybe-strip.o
+# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS)
+# -rm -f $(STRIP_PROG)
+# -ln $(OBJCOPY_PROG) $(STRIP_PROG)
+
+sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info
+ ./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c
+ ./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c
+ ./sysinfo$(EXEEXT_FOR_BUILD) -g <$(srcdir)/sysroff.info >>sysroff.c
+
+sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info
+ ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
+
+sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
syslex.o: syslex.c sysinfo.h
@@ -366,47 +979,16 @@ sysinfo.o: sysinfo.c
$(CC_FOR_BUILD) -c -I. $(CFLAGS) $(srcdir)/sysinfo.c ; \
fi
-srconv: srconv.o coffgrok.o $(ADDL_DEPS)
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ srconv.o coffgrok.o $(ADDL_LIBS) $(EXTRALIBS)
-
-dlltool: dlltool.o defparse.o deflex.o cplus-dem.o $(ADDL_DEPS)
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ dlltool.o defparse.o deflex.o $(ADDL_LIBS) $(EXTRALIBS)
-
-defparse.c:defparse.y
- $(BISON) $(BISONFLAGS) $(srcdir)/defparse.y
- mv -f y.tab.c defparse.c
- mv -f y.tab.h defparse.h
-
-defparse.h: defparse.c
-
-deflex.c:deflex.l
- $(LEX) $(LEX_OPTIONS) $(srcdir)/deflex.l
- mv lex.yy.c deflex.c
-
dlltool.o:dlltool.c
- $(CC) -c @DLLTOOL_DEFS@ $(ALL_CFLAGS) $(srcdir)/dlltool.c
-
-coffdump: coffdump.o coffgrok.o $(ADDL_DEPS)
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ coffdump.o coffgrok.o $(ADDL_LIBS) $(EXTRALIBS)
-
-sysdump: sysdump.o $(ADDL_DEPS)
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ sysdump.o $(ADDL_LIBS) $(EXTRALIBS)
-
-# Depend upon sysinfo.c to avoid building both nlmheader.c and sysinfo.c
-# simultaneously.
-nlmheader.c: nlmheader.y sysinfo.c
- $(BISON) $(srcdir)/nlmheader.y
- rm -f nlmheader.c
- mv -f y.tab.c nlmheader.c
+ $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
# coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
# scripts, since they are only included conditionally.
nlmconv.o: nlmconv.c $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
- ldname=`echo ld | sed '$(program_transform_name)'`; \
- $(CC) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(ALL_CFLAGS) $(srcdir)/nlmconv.c
+ ldname=`echo ld | sed '$(transform)'`; \
+ $(COMPILE) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c
-$(NLMCONV_PROG): nlmconv.o nlmheader.o $(ADDL_DEPS)
- $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ nlmconv.o nlmheader.o $(ADDL_LIBS) $(EXTRALIBS)
+diststuff: $(DISTSTUFF) info
# Targets to rebuild dependencies in this Makefile.
# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
@@ -419,14 +1001,16 @@ $(NLMCONV_PROG): nlmconv.o nlmheader.o $(ADDL_DEPS)
.dep1: $(CFILES) $(GENERATED_CFILES)
rm -f .dep2
echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
- $(DEP) -f .dep2 $(ALL_CFLAGS) $?
+ $(DEP) -f .dep2 $(INCLUDES) $?
$(SHELL) $(srcdir)/../move-if-change .dep2 .dep1
dep.sed: dep-in.sed config.status
+ objdir=`pwd`; \
sed <$(srcdir)/dep-in.sed >dep.sed \
-e 's!@INCDIR@!$(INCDIR)!' \
-e 's!@BFDDIR@!$(BFDDIR)!' \
- -e 's!@SRCDIR@!$(srcdir)!'
+ -e 's!@SRCDIR@!$(srcdir)!' \
+ -e "s!@OBJDIR@!$${objdir}!"
dep: .dep
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
@@ -438,218 +1022,52 @@ dep-in: .dep
cat .dep >> tmp-Makefile.in
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
-.PHONY: dep dep-in
+dep-am: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
+ cat .dep >> tmp-Makefile.am
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
+
+.PHONY: dep dep-in dep-am
###
# DOCUMENTATION TARGETS
config.texi: Makefile
rm -f config.texi
echo '@set VERSION $(VERSION)' > config.texi
-# TeX output
+
binutils.dvi: $(srcdir)/binutils.texi config.texi
- TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/binutils.texi
-# info file for online browsing
binutils.info: $(srcdir)/binutils.texi config.texi
- $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi
$(DEMANGLER_PROG).1: cxxfilt.man Makefile
sed -e 's/@PROGRAM@/$(DEMANGLER_PROG)/' < $(srcdir)/cxxfilt.man \
> $(DEMANGLER_PROG).1
-
-# different targets for -ms, -mm, -me
-# Try to use a recent texi2roff. v2 was put on prep in jan91.
-# If you want an index, see texi2roff doc for postprocessing
-# and add -i to texi2roff invocations below.
-# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
-# corresponding -e lines when later texi2roff's are current)
-# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
-# + @c's deleted explicitly because texi2roff sees texinfo commands in them
-# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
-# + @alphaenumerate is ridiculously new, turned into @enumerate
-
-# roff output (-ms)
-binutils.ms: $(srcdir)/binutils.texi
- sed -e '/\\input texinfo/d' \
- -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
- -e '/^@ifinfo/,/^@end ifinfo/d' \
- -e '/^@c/d' \
- -e 's/{.*,,/{/' \
- -e 's/@ / /g' \
- -e 's/^@alphaenumerate/@enumerate/g' \
- -e 's/^@end alphaenumerate/@end enumerate/g' \
- $(srcdir)/binutils.texi | \
- $(TEXI2ROFF) -ms | \
- sed -e 's/---/\\(em/g' \
- >binutils.ms
-
-# roff output (-mm)
-# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
-# try leaving them in
-binutils.mm: $(srcdir)/binutils.texi
- sed -e '/\\input texinfo/d' \
- -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
- -e '/^@ifinfo/,/^@end ifinfo/d' \
- -e '/^@c/d' \
- -e 's/{.*,,/{/' \
- -e '/@noindent/d' \
- -e 's/@ / /g' \
- -e 's/^@alphaenumerate/@enumerate/g' \
- -e 's/^@end alphaenumerate/@end enumerate/g' \
- $(srcdir)/binutils.texi | \
- $(TEXI2ROFF) -mm | \
- sed -e 's/---/\\(em/g' \
- >binutils.mm
-
-# roff output (-me)
-binutils.me: $(srcdir)/binutils.texi
- sed -e '/\\input texinfo/d' \
- -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
- -e '/^@ifinfo/,/^@end ifinfo/d' \
- -e '/^@c/d' \
- -e 's/{.*,,/{/' \
- -e 's/@ / /g' \
- -e 's/^@alphaenumerate/@enumerate/g' \
- -e 's/^@end alphaenumerate/@end enumerate/g' \
- $(srcdir)/binutils.texi | \
- $(TEXI2ROFF) -me | \
- sed -e 's/---/\\(em/g' \
- >binutils.me
-
-
-###
-
-mostlyclean:
- -rm -f *.o *~ \#* core binutils.?? binutils.??? y.output
- -rm -rf tmpdir
-clean: mostlyclean
- -rm -f $(PROGS) $(DEMANGLER_PROG).1 stamp-under
- -rm -f underscore.c sysroff sysroff.c sysroff.h sysinfo dep.sed
-distclean:
- -rm -f Makefile config.status *.o *~ \#* core y.*
- -rm -f binutils.?? binutils.??? binutils.aux binutils.log binutils.toc
- -rm -f $(PROGS) underscore.c config.h stamp-h config.cache config.log
- -rm -f dep.sed stamp-under $(DEMANGLER_PROG).1 site.bak site.exp
- -rm -f sysroff sysroff.c sysroff.h sysinfo
+mostlyclean-local:
-rm -rf tmpdir
-maintainer-clean realclean: clean distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- -rm -f $(DISTSTUFF) binutils.info* TAGS
-
-etags tags: TAGS
-TAGS: force
- etags $(INCDIR)/*.h $(srcdir)/*.[hc]
+.PHONY: install-exec-local
-install: all
- for i in $(PROGS) ; do \
- $(INSTALL_XFORM) $$i $(bindir)/`echo $$i | sed -e 's/.new//'` ; \
- done
- for i in $(MANPAGES) ; do \
- $(INSTALL_XFORM1) $(srcdir)/$$i.1 $(man1dir)/$$i.1 ; \
+install-exec-local: $(bin_PROGRAMS) $(noinst_PROGRAMS)
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`"; \
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`; \
+ else :; fi; \
done
- if [ x$(DEMANGLER_PROG) != x ]; then \
- $(INSTALL_XFORM1) $(DEMANGLER_PROG).1 $(man1dir)/$(DEMANGLER_PROG).1; \
- fi
- test -d $(tooldir) || mkdir $(tooldir)
- test -d $(tooldir)/bin || mkdir $(tooldir)/bin
- for i in $(TOOL_PROGS) ; do \
- if [ -f $$i ]; then \
- j=`echo $$i | sed -e 's/.new//'`; \
- rm -f $(tooldir)/bin/$$j; \
- k=`echo $$j | sed '$(program_transform_name)'`; \
- ln $(bindir)/$$k $(tooldir)/bin/$$j >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) $$i $(tooldir)/bin/$$j; \
+ $(mkinstalldirs) $(tooldir)/bin
+ for i in $(TOOL_PROGS); do \
+ if [ -f $$i$(EXEEXT) ]; then \
+ j=`echo $$i | sed -e 's/-new//'`; \
+ rm -f $(tooldir)/bin/$$j$(EXEEXT); \
+ k=`echo $$j | sed '$(transform)'`; \
+ if [ "$(bindir)/$$k$(EXEEXT)" != "$(tooldir)/bin/$$j$(EXEEXT)" ]; then \
+ ln $(bindir)/$$k$(EXEEXT) $(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \
+ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(tooldir)/bin/$$j$(EXEEXT); \
+ fi; \
else true; \
fi; \
done
-# This little path search is required because in the FSF net releases,
-# the info files are included in the source tree, and that may not be
-# the same as the build directory.
-install-info: binutils.info
- if [ -r binutils.info ]; then \
- dir=. ; \
- else \
- dir=$(srcdir) ; \
- fi ; \
- for i in `cd $$dir; echo binutils.info*` ; do \
- $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i ; \
- done
-
-clean-info:
- -rm -rf *.info*
-
-# Making a dist:
-# cvs rtag binutils-x-yy ld+utils
-# cvs co -r binutils-x-yy ld+utils
-# cd {HERE}; make dist [-f Makefile.in]
-
-dist: $(DIST_NAME).tar.z
-
-diststuff: $(DISTSTUFF) info
-
-$(DIST_NAME).tar.z:
- cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
- make diststuff -f Makefile.in
- cd ../ld; make diststuff -f Makefile.in
- cd ../gprof; make diststuff -f Makefile.in
- cd ../texinfo; mv texinfo.tex ..; rm -rf *; mv ../texinfo.tex .
- # Take out texinfo from configurable dirs
- mv ../configure.in tmp; \
- sed -e '/^host_tools=/s/texinfo //' <tmp >../configure.in; rm tmp
- cd ..; chmod og=u `find . -print`
- cd ../..; tar chf - $(DIST_NAME) | gzip >$(DIST_NAME).tar.z
- rm -rf ../../$(DIST_NAME)
-
-#-----------------------------------------------------------------------------
-# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
-#
-# 'VERSION' file must be present and contain a string of the form "x.y"
-#-----------------------------------------------------------------------------
-
-ver960.c: FORCE
- rm -f ver960.c
- echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
-
-
-# Dummy target to force execution of dependent targets.
-#
-force:
-
-# Target to uncomment host-specific lines in this makefile. Such lines must
-# have the following string beginning in column 1: #__<hostname>__#
-# Original Makefile is backed up as 'Makefile.old'.
-#
-# Invoke with: make make HOST=xxx
-#
-make:
- -@if test $(HOST)x = x ; then \
- echo 'Specify "make make HOST=???"'; \
- exit 1; \
- fi ; \
- grep -s "^#The next line was generated by 'make make'" Makefile; \
- if test $$? = 0 ; then \
- echo "Makefile has already been processed with 'make make'";\
- exit 1; \
- fi ; \
- mv -f Makefile Makefile.old; \
- echo "#The next line was generated by 'make make'" >Makefile ; \
- echo "HOST=$(HOST)" >>Makefile ; \
- echo >>Makefile ; \
- sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
-
-Makefile: Makefile.in config.status
- CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
-
-config.h: stamp-h ; @true
-stamp-h: config.in config.status
- CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
-
-config.status: configure $(srcdir)/../bfd/configure.host $(srcdir)/../bfd/config.bfd
- $(SHELL) ./config.status --recheck
-
# What appears below is generated by a hacked mkdep using gcc -MM.
# DO NOT DELETE THIS LINE -- mkdep uses it.
@@ -675,7 +1093,7 @@ debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
debug.h
dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/getopt.h $(INCDIR)/demangle.h
+ $(INCDIR)/getopt.h $(INCDIR)/demangle.h dlltool.h
filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
bucomm.h config.h $(INCDIR)/fopen-same.h
ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/ieee.h \
@@ -732,6 +1150,19 @@ wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def
+windres.o: windres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/getopt.h bucomm.h config.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/libiberty.h $(INCDIR)/obstack.h windres.h
+resrc.o: resrc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h
+rescoff.o: rescoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+resbin.o: resbin.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h
underscore.o: underscore.c
arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
bucomm.h config.h $(INCDIR)/fopen-same.h arsup.h
@@ -739,10 +1170,22 @@ arlex.o: arlex.c $(INCDIR)/libiberty.h arparse.h
sysroff.o: sysroff.c
sysinfo.o: sysinfo.c
syslex.o: syslex.c sysinfo.h
-defparse.o: defparse.c
-deflex.o: deflex.c defparse.h
+defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h dlltool.h
+deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
+ defparse.h dlltool.h
nlmheader.o: nlmheader.c ../bfd/bfd.h bucomm.h config.h \
$(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
nlmconv.h
+rcparse.o: rcparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h
+rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ windres.h rcparse.h
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/binutils/binutils/NEWS b/contrib/binutils/binutils/NEWS
index 1caa151..de6f0bd 100644
--- a/contrib/binutils/binutils/NEWS
+++ b/contrib/binutils/binutils/NEWS
@@ -1,5 +1,15 @@
-*- text -*-
+Changes in binutils 2.9:
+
+* Added windres program, which can be used to manipulate resources in WIN32
+ files as used on Windows 95 and Windows NT.
+
+* The objcopy --gap-fill and --pad-to options operate on the LMA rather than
+ the VMA of the sections.
+
+* Added S modifier to ar to not build a symbol table.
+
Changes in binutils 2.8:
* The objdump disassembly format has been changed, and hopefully improved. Use
diff --git a/contrib/binutils/binutils/README b/contrib/binutils/binutils/README
index 4ae93cd..91d7750 100644
--- a/contrib/binutils/binutils/README
+++ b/contrib/binutils/binutils/README
@@ -1,8 +1,8 @@
-This is a beta release of a completely rewritten binutils distribution.
-(Rewritten since binutils 1.x, that is.)
+These are the GNU binutils. These are utilities of use when dealing
+with object files.
-The linker (ld) has been moved into a separate directory, which should be
-../ld. Linker-specific notes are in ../ld/README.
+The linker (ld) is in a separate directory, which should be ../ld.
+Linker-specific notes are in ../ld/README.
As of version 2.5, the assembler (as) is also included in this package, in
../gas. Assembler-specific notes can be found in ../gas/README.
@@ -12,16 +12,16 @@ Recent changes are in ./NEWS, ../ld/NEWS, and ../gas/NEWS.
Unpacking and Installation -- quick overview
============================================
-When you unpack the binutils-2.8.tar.gz file, you'll get a directory
-called something like `binutils-2.8', which contains various files and
+When you unpack the binutils-2.9.tar.gz file, you'll get a directory
+called something like `binutils-2.9', which contains various files and
directories. Most of the files in the top directory are for
information and for configuration. The actual source code is in
subdirectories.
To build binutils, you can just do:
- cd binutils-2.8
- ./configure [ --enable-targets='target1,target2...' ]
+ cd binutils-2.9
+ ./configure [options]
make
make install # copies the programs files into /usr/local/bin
# by default.
@@ -29,11 +29,23 @@ To build binutils, you can just do:
This will configure and build all the libraries as well as the
assembler, the binutils, and the linker.
-The --enable-targets option adds support for more binary file
-formats besides the default. By default, support for only the
-selected target file format is compiled in. To add support for more
-formats, list them as the argument to --enable-targets, separated by
-commas. For example:
+If you have GNU make, we recommend building in a different directory:
+
+ mkdir objdir
+ cd objdir
+ ../binutils-2.9/configure [options]
+ make
+ make install
+
+This relies on the VPATH feature of GNU make.
+
+By default, the binutils will be configured to support the system on
+which they are built. When doing cross development, use the --target
+configure option to specify a different target.
+
+The --enable-targets option adds support for more binary file formats
+besides the default. List them as the argument to --enable-targets,
+separated by commas. For example:
./configure --enable-targets=sun3,rs6000-aix,decstation
@@ -42,16 +54,12 @@ the default in releases before 2.3):
./configure --enable-targets=all
-The binutils can be used in a cross-development environment.
-The file etc/configure.texi contains more information.
-
You can also specify the --enable-shared option when you run
configure. This will build the BFD and opcodes libraries as shared
-libraries. This will only work on certain systems, and currently will
-only work when compiling with gcc. You can use arguments with the
---enable-shared option to indicate that only certain libraries should
-be built shared; for example, --enable-shared=bfd. The only potential
-shared libraries in a binutils release are bfd and opcodes.
+libraries. You can use arguments with the --enable-shared option to
+indicate that only certain libraries should be built shared; for
+example, --enable-shared=bfd. The only potential shared libraries in
+a binutils release are bfd and opcodes.
The binutils will be linked against the shared libraries. The build
step will attempt to place the correct library in the runtime search
@@ -60,11 +68,6 @@ binaries, you may have to set an environment variable, normally
LD_LIBRARY_PATH, so that the system can find the installed libbfd
shared library.
-If you specify --enable-commonbfdlib as well as --enable-shared, then
-a single shared library will be built containing the bfd, opcodes, and
-libiberty libraries. It will be installed as libbfd. This option
-will make the binutils programs as small as possible.
-
To build under openVMS/AXP, see the file makefile.vms in the top level
directory.
@@ -89,7 +92,8 @@ the ranlib program in order to build the distribution.
Porting
=======
-Binutils-2.8 supports many different architectures, but there
+
+Binutils-2.9 supports many different architectures, but there
are many more not supported, including some that were supported
by earlier versions. We are hoping for volunteers to
improve this situation.
@@ -101,7 +105,30 @@ with gdb-4.x) may also be of help.
Reporting bugs
==============
-Send bug reports and patches to bug-gnu-utils@prep.ai.mit.edu. Always
-mention the version number you are running; this is printed by running
-any of the binutils with the --version option. We appreciate reports
-about bugs, but we do not promise to fix them.
+
+Send bug reports and patches to bug-gnu-utils@gnu.org. Always mention
+the version number you are running; this is printed by running any of
+the binutils with the --version option. We appreciate reports about
+bugs, but we do not promise to fix them.
+
+Testing
+=======
+
+Testing this release of the binutils requires an unreleased version of
+dejagnu. There is a dejagnu snapshot available at
+ ftp://ftp.cygnus.com/pub/binutils
+which may be used for testing.
+
+Maintenance
+===========
+
+The configure and Makefile.in files in the subdirectories are
+generated by autoconf and automake, respectively. The libtool package
+is also required. In order to make the generation rules fire
+automatically, you must configure with the --enable-maintainer-mode
+option. This option is not the default in order to avoid problems on
+systems which have out of date versions of autoconf or automake
+installed. The generated files in this release were built with
+unreleased versions of autoconf, automake, and libtool. You can find
+snapshots of the appropriate sources at
+ ftp://ftp.cygnus.com/pub/binutils
diff --git a/contrib/binutils/binutils/acconfig.h b/contrib/binutils/binutils/acconfig.h
index 6ae3d76..c38c529 100644
--- a/contrib/binutils/binutils/acconfig.h
+++ b/contrib/binutils/binutils/acconfig.h
@@ -1,4 +1,13 @@
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
+
+/* Configured target name. */
+#undef TARGET
+
/* Whether strstr must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSTR
diff --git a/contrib/binutils/binutils/acinclude.m4 b/contrib/binutils/binutils/acinclude.m4
new file mode 100644
index 0000000..71b09b9
--- /dev/null
+++ b/contrib/binutils/binutils/acinclude.m4
@@ -0,0 +1 @@
+sinclude(../bfd/acinclude.m4)
diff --git a/contrib/binutils/binutils/aclocal.m4 b/contrib/binutils/binutils/aclocal.m4
index 7adc004..ea7ce9b 100644
--- a/contrib/binutils/binutils/aclocal.m4
+++ b/contrib/binutils/binutils/aclocal.m4
@@ -1 +1,460 @@
-sinclude(../bfd/aclocal.m4)
+dnl aclocal.m4 generated automatically by aclocal 1.2e
+
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+sinclude(../bfd/acinclude.m4)
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AM_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+
+# serial 1
+
+AC_DEFUN(AM_PROG_INSTALL,
+[AC_REQUIRE([AC_PROG_INSTALL])
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+AC_SUBST(INSTALL_SCRIPT)dnl
+])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+
+# serial 24 AM_PROG_LIBTOOL
+AC_DEFUN(AM_PROG_LIBTOOL,
+[AC_REQUIRE([AM_ENABLE_SHARED])dnl
+AC_REQUIRE([AM_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_RANLIB])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AM_PROG_LD])dnl
+AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+dnl
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+])
+
+# AM_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_SHARED,
+[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
+changequote([, ])dnl
+[ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AM_DISABLE_SHARED,
+[AM_ENABLE_SHARED(no)])
+
+# AM_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AM_DISABLE_STATIC,
+[AM_ENABLE_STATIC(no)])
+
+# AM_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_STATIC,
+[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
+changequote([, ])dnl
+[ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+])
+
+
+# AM_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AM_PROG_LD,
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+changequote(,)dnl
+ /* | [A-Za-z]:\\*)
+changequote([,])dnl
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(ac_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_SUBST(LD)
+AM_PROG_LD_GNU
+])
+
+AC_DEFUN(AM_PROG_LD_GNU,
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi])
+])
+
+# AM_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AM_PROG_NM,
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(ac_cv_path_NM,
+[case "$NM" in
+changequote(,)dnl
+/* | [A-Za-z]:\\*)
+changequote([,])dnl
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac])
+NM="$ac_cv_path_NM"
+AC_MSG_RESULT([$NM])
+AC_SUBST(NM)
+])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT($USE_MAINTAINER_MODE)
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+ AC_SUBST(MAINT)dnl
+]
+)
+
+# Check to see if we're running under Cygwin32, without using
+# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_CYGWIN32()
+AC_DEFUN(AM_CYGWIN32,
+[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
+[AC_TRY_COMPILE(,[return __CYGWIN32__;],
+am_cv_cygwin32=yes, am_cv_cygwin32=no)
+rm -f conftest*])
+CYGWIN32=
+test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
+
+# Check to see if we're running under Win32, without using
+# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
+# Otherwise set it to "".
+
+dnl AM_EXEEXT()
+dnl This knows we add .exe if we're building in the Cygwin32
+dnl environment. But if we're not, then it compiles a test program
+dnl to see if there is a suffix for executables.
+AC_DEFUN(AM_EXEEXT,
+[AC_REQUIRE([AM_CYGWIN32])
+AC_REQUIRE([AM_MINGW32])
+AC_MSG_CHECKING([for executable suffix])
+AC_CACHE_VAL(am_cv_exeext,
+[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*])
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+AC_MSG_RESULT(${am_cv_exeext})
+AC_SUBST(EXEEXT)])
+
+# Check to see if we're running under Mingw, without using
+# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_MINGW32()
+AC_DEFUN(AM_MINGW32,
+[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
+[AC_TRY_COMPILE(,[return __MINGW32__;],
+am_cv_mingw32=yes, am_cv_mingw32=no)
+rm -f conftest*])
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes])
+
diff --git a/contrib/binutils/binutils/addr2line.c b/contrib/binutils/binutils/addr2line.c
index 7fbbdd8..b887043 100644
--- a/contrib/binutils/binutils/addr2line.c
+++ b/contrib/binutils/binutils/addr2line.c
@@ -1,5 +1,5 @@
/* addr2line.c -- convert addresses to line number and function name
- Copyright 1997 Free Software Foundation, Inc.
+ Copyright 1997, 1998 Free Software Foundation, Inc.
Contributed by Ulrich Lauther <Ulrich.Lauther@zfe.siemens.de>
This file is part of GNU Binutils.
@@ -80,7 +80,7 @@ Usage: %s [-CfsHV] [-b bfdname] [--target=bfdname]\n\
program_name);
list_supported_targets (program_name, stream);
if (status == 0)
- fprintf (stream, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
exit (status);
}
@@ -158,14 +158,14 @@ translate_addresses (abfd)
if (fgets (addr_hex, sizeof addr_hex, stdin) == NULL)
break;
- pc = strtol (addr_hex, NULL, 16);
+ pc = bfd_scan_vma (addr_hex, NULL, 16);
}
else
{
if (naddr <= 0)
break;
--naddr;
- pc = strtol (*addr++, NULL, 16);
+ pc = bfd_scan_vma (*addr++, NULL, 16);
}
found = false;
diff --git a/contrib/binutils/binutils/ar.1 b/contrib/binutils/binutils/ar.1
index a138e4a..e4e8cff 100644
--- a/contrib/binutils/binutils/ar.1
+++ b/contrib/binutils/binutils/ar.1
@@ -14,7 +14,7 @@ ar \- create, modify, and extract from archives.
.hy 0
.na
.BR ar " [\|" "-" "\|]"\c
-.I {dmpqrtx}[abcilosuvV] \c
+.I {dmpqrtx}[abcilosSuvV] \c
[\|\c
.I membername\c
\&\|] \c
@@ -215,6 +215,15 @@ index is not updated, even if it already existed; you can use `\|\c
.B ranlib\c
\& explicitly to update the symbol table index.
+However, too many different systems assume quick append rebuilds the
+index, so GNU
+.B ar
+implements `\|\c
+.B q\c
+\|' as a synonym for `\|\c
+.B r\c
+\|'.
+
.TP
.B r
Insert \c
@@ -416,6 +425,19 @@ archive is equivalent to running `\|\c
\|' on it.
.TP
+.B S
+Do not generate an archive symbol table. This can speed up building a
+large library in several steps. The resulting archive can not be used
+with the linker. In order to build a symbol table, you must omit the
+`\|\c
+.B S\c
+\|' modifier on the last execution of `\|\c
+.B ar\c
+\|', or you must run `\|\c
+.B ranlib\c
+\|' on the archive.
+
+.TP
.B u
Normally, \c
.B ar r\c
diff --git a/contrib/binutils/binutils/ar.c b/contrib/binutils/binutils/ar.c
index ceed38e..b52a4ce 100644
--- a/contrib/binutils/binutils/ar.c
+++ b/contrib/binutils/binutils/ar.c
@@ -1,5 +1,5 @@
/* ar.c - Archive modify and extract.
- Copyright 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -52,7 +52,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Kludge declaration from BFD! This is ugly! FIXME! XXX */
struct ar_hdr *
- bfd_special_undocumented_glue PARAMS ((bfd * abfd, char *filename));
+ bfd_special_undocumented_glue PARAMS ((bfd * abfd, const char *filename));
/* Static declarations */
@@ -146,7 +146,7 @@ enum pos
} postype = pos_default;
static bfd **
-get_pos_bfd PARAMS ((bfd **, enum pos));
+get_pos_bfd PARAMS ((bfd **, enum pos, const char *));
/* Whether to truncate names of files stored in the archive. */
static boolean ar_truncate = false;
@@ -225,7 +225,7 @@ usage (help)
s = help ? stdout : stderr;
if (! is_ranlib)
fprintf (s, "\
-Usage: %s [-]{dmpqrtx}[abcilosuvV] [member-name] archive-file file...\n\
+Usage: %s [-]{dmpqrtx}[abcilosSuvV] [member-name] archive-file file...\n\
%s -M [<mri-script]\n",
program_name, program_name);
else
@@ -235,7 +235,7 @@ Usage: %s [-vV] archive\n", program_name);
list_supported_targets (program_name, stderr);
if (help)
- fprintf (s, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ fprintf (s, "Report bugs to bug-gnu-utils@gnu.org\n");
xexit (help ? 0 : 1);
}
@@ -448,6 +448,9 @@ main (argc, argv)
case 's':
write_armap = 1;
break;
+ case 'S':
+ write_armap = -1;
+ break;
case 'u':
newer_only = 1;
break;
@@ -1003,12 +1006,25 @@ write_archive (iarch)
and should be a pos value. */
static bfd **
-get_pos_bfd (contents, default_pos)
+get_pos_bfd (contents, default_pos, default_posname)
bfd **contents;
enum pos default_pos;
+ const char *default_posname;
{
bfd **after_bfd = contents;
- enum pos realpos = (postype == pos_default ? default_pos : postype);
+ enum pos realpos;
+ const char *realposname;
+
+ if (postype == pos_default)
+ {
+ realpos = default_pos;
+ realposname = default_posname;
+ }
+ else
+ {
+ realpos = postype;
+ realposname = posname;
+ }
if (realpos == pos_end)
{
@@ -1018,7 +1034,7 @@ get_pos_bfd (contents, default_pos)
else
{
for (; *after_bfd; after_bfd = &(*after_bfd)->next)
- if (!strcmp ((*after_bfd)->filename, posname))
+ if (strcmp ((*after_bfd)->filename, realposname) == 0)
{
if (realpos == pos_after)
after_bfd = &(*after_bfd)->next;
@@ -1111,7 +1127,7 @@ move_members (arch, files_to_move)
*current_ptr_ptr = current_ptr->next;
/* Now glue to end */
- after_bfd = get_pos_bfd (&arch->next, pos_end);
+ after_bfd = get_pos_bfd (&arch->next, pos_end, NULL);
link = *after_bfd;
*after_bfd = current_ptr;
current_ptr->next = link;
@@ -1179,11 +1195,10 @@ replace_members (arch, files_to_move, quick)
goto next_file;
}
- /* snip out this entry from the chain */
- *current_ptr = current->next;
-
- after_bfd = get_pos_bfd (&arch->next, pos_end);
+ after_bfd = get_pos_bfd (&arch->next, pos_after,
+ current->filename);
temp = *after_bfd;
+
*after_bfd = bfd_openr (*files_to_move, NULL);
if (*after_bfd == (bfd *) NULL)
{
@@ -1191,6 +1206,9 @@ replace_members (arch, files_to_move, quick)
}
(*after_bfd)->next = temp;
+ /* snip out this entry from the chain */
+ *current_ptr = (*current_ptr)->next;
+
if (verbose)
{
printf ("r - %s\n", *files_to_move);
@@ -1206,7 +1224,7 @@ replace_members (arch, files_to_move, quick)
/* Add to the end of the archive. */
- after_bfd = get_pos_bfd (&arch->next, pos_end);
+ after_bfd = get_pos_bfd (&arch->next, pos_end, NULL);
temp = *after_bfd;
*after_bfd = bfd_openr (*files_to_move, NULL);
if (*after_bfd == (bfd *) NULL)
diff --git a/contrib/binutils/binutils/binutils.texi b/contrib/binutils/binutils/binutils.texi
index c289119..ff6ecd3 100644
--- a/contrib/binutils/binutils/binutils.texi
+++ b/contrib/binutils/binutils/binutils.texi
@@ -13,7 +13,7 @@ END-INFO-DIR-ENTRY
@end ifinfo
@ifinfo
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -41,7 +41,7 @@ into another language, under the above conditions for modified versions.
@c This file documents the GNU binary utilities "ar", "ld", "objcopy",
@c "objdump", "nm", "size", "strings", "strip", and "ranlib".
@c
-@c Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+@c Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
@c
@c This text may be freely distributed under the terms of the GNU
@c General Public License.
@@ -66,7 +66,7 @@ into another language, under the above conditions for modified versions.
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -122,6 +122,9 @@ Convert addresses into file names and line numbers
@item nlmconv
Convert object code into a Netware Loadable Module
+
+@item windres
+Manipulate Windows resources
@end table
@end iftex
@@ -137,6 +140,7 @@ Convert object code into a Netware Loadable Module
* c++filt:: Filter to demangle encoded C++ symbols
* addr2line:: Convert addresses to file and line
* nlmconv:: Converts object code into an NLM
+* windres:: Manipulate Windows resources
* Selecting The Target System:: How these utilities determine the target.
* Reporting Bugs:: Reporting Bugs
* Index:: Index
@@ -263,7 +267,7 @@ printed.
@item q
@cindex quick append to archive
-@emph{Quick append}; add the files @var{member}@dots{} to the end of
+@emph{Quick append}; Historically, add the files @var{member}@dots{} to the end of
@var{archive}, without checking for replacement.
The modifiers @samp{a}, @samp{b}, and @samp{i} do @emph{not} affect this
@@ -275,6 +279,9 @@ Since the point of this operation is speed, the archive's symbol table
index is not updated, even if it already existed; you can use @samp{ar s} or
@code{ranlib} explicitly to update the symbol table index.
+However, too many different systems assume quick append rebuilds the
+index, so GNU ar implements @code{q} as a synonym for @code{r}.
+
@item r
@cindex replacement in archive
Insert the files @var{member}@dots{} into @var{archive} (with
@@ -381,6 +388,14 @@ even if no other change is made to the archive. You may use this modifier
flag either with any operation, or alone. Running @samp{ar s} on an
archive is equivalent to running @samp{ranlib} on it.
+@item S
+@cindex not writing archive index
+Do not generate an archive symbol table. This can speed up building a
+large library in several steps. The resulting archive can not be used
+with the linker. In order to build a symbol table, you must omit the
+@samp{S} modifier on the last execution of @samp{ar}, or you must run
+@samp{ranlib} on the archive.
+
@item u
@cindex updating an archive
Normally, @samp{ar r}@dots{} inserts all files
@@ -809,6 +824,8 @@ objcopy [ -F @var{bfdname} | --target=@var{bfdname} ]
[ -S | --strip-all ] [ -g | --strip-debug ]
[ -K @var{symbolname} | --keep-symbol=@var{symbolname} ]
[ -N @var{symbolname} | --strip-symbol=@var{symbolname} ]
+ [ -L @var{symbolname} | --localize-symbol=@var{symbolname} ]
+ [ -W @var{symbolname} | --weaken-symbol=@var{symbolname} ]
[ -x | --discard-all ] [ -X | --discard-locals ]
[ -b @var{byte} | --byte=@var{byte} ]
[ -i @var{interleave} | --interleave=@var{interleave} ]
@@ -903,8 +920,16 @@ be given more than once.
@item -N @var{symbolname}
@itemx --strip-symbol=@var{symbolname}
Do not copy symbol @var{symbolname} from the source file. This option
-may be given more than once, and may be combined with strip options
-other than @code{-K}.
+may be given more than once.
+
+@item -L @var{symbolname}
+@itemx --localize-symbol=@var{symbolname}
+Make symbol @var{symbolname} local to the file, so that it is not
+visible externally. This option may be given more than once.
+
+@item -W @var{symbolname}
+@itemx --weaken-symbol=@var{symbolname}
+Make symbol @var{symbolname} weak. This option may be given more than once.
@item -x
@itemx --discard-all
@@ -943,12 +968,13 @@ because only certain debugging formats are supported, and the
conversion process can be time consuming.
@item --gap-fill @var{val}
-Fill gaps between sections with @var{val}. This is done by increasing
+Fill gaps between sections with @var{val}. This operation applies to
+the @emph{load address} (LMA) of the sections. It is done by increasing
the size of the section with the lower address, and filling in the extra
space created with @var{val}.
@item --pad-to @var{address}
-Pad the output file up to the virtual address @var{address}. This is
+Pad the output file up to the load address @var{address}. This is
done by increasing the size of the last section. The extra space is
filled in with the value specified by @samp{--gap-fill} (default zero).
@@ -987,9 +1013,12 @@ the named section does not exist.
@item --set-section-flags @var{section}=@var{flags}
Set the flags for the named section. The @var{flags} argument is a
comma separated string of flag names. The recognized names are
-@samp{alloc}, @samp{load}, @samp{readonly}, @samp{code}, @samp{data},
-and @samp{rom}. Not all flags are meaningful for all object file
-formats.
+@samp{alloc}, @samp{contents}, @samp{load}, @samp{readonly},
+@samp{code}, @samp{data}, and @samp{rom}. You can set the
+@samp{contents} flag for a section which does not have contents, but it
+is not meaningful to clear the @samp{contents} flag of a section which
+does have contents--just remove the section instead. Not all flags are
+meaningful for all object file formats.
@item --add-section @var{sectionname}=@var{filename}
Add a new section named @var{sectionname} while copying the file. The
@@ -1297,7 +1326,7 @@ relocation entries. Using @samp{-x} is equivalent to specifying all of
@samp{-a -f -h -r -t}.
@item -w
-@item --wide
+@itemx --wide
@cindex wide output, printing
Format some lines for output devices that have more than 80 columns.
@end table
@@ -1343,7 +1372,7 @@ Show the version number of @code{ranlib}.
size [ -A | -B | --format=@var{compatibility} ]
[ --help ] [ -d | -o | -x | --radix=@var{number} ]
[ --target=@var{bfdname} ] [ -V | --version ]
- @var{objfile}@dots{}
+ [ @var{objfile}@dots{} ]
@end smallexample
The @sc{gnu} @code{size} utility lists the section sizes---and the total
@@ -1352,6 +1381,7 @@ argument list. By default, one line of output is generated for each
object file or each module in an archive.
@var{objfile}@dots{} are the object files to be examined.
+If none are specified, the file @code{a.out} will be used.
The command line options have the following meanings:
@@ -1466,8 +1496,8 @@ Print the name of the file before each string.
@item --help
Print a summary of the program usage on the standard output and exit.
-@itemx -@var{min-len}
-@item -n @var{min-len}
+@item -@var{min-len}
+@itemx -n @var{min-len}
@itemx --bytes=@var{min-len}
Print sequences of characters that are at least @var{min-len} characters
long, instead of the default 4.
@@ -1502,7 +1532,7 @@ Print the program version number on the standard output and exit.
@cindex symbols, discarding
@smallexample
-strip [ -F @var{bfdname} | --target=@var{bfdname} | --target=@var{bfdname} ]
+strip [ -F @var{bfdname} | --target=@var{bfdname} ]
[ -I @var{bfdname} | --input-target=@var{bfdname} ]
[ -O @var{bfdname} | --output-target=@var{bfdname} ]
[ -s | --strip-all ] [ -S | -g | --strip-debug ]
@@ -1849,6 +1879,131 @@ Prints a usage summary.
Prints the version number for @code{nlmconv}.
@end table
+@node windres
+@chapter windres
+
+@code{windres} may be used to manipulate Windows resources.
+
+@quotation
+@emph{Warning:} @code{windres} is not always built as part of the binary
+utilities, since it is only useful for Windows targets.
+@end quotation
+
+@smallexample
+windres [options] [input-file] [output-file]
+@end smallexample
+
+@code{windres} reads resources from an input file and copies them into
+an output file. Either file may be in one of three formats:
+
+@table @code
+@item rc
+A text format read by the Resource Compiler.
+
+@item res
+A binary format generated by the Resource Compiler.
+
+@item coff
+A COFF object or executable.
+@end table
+
+The exact description of these different formats is available in
+documentation from Microsoft.
+
+When @code{windres} converts from the @code{rc} format to the @code{res}
+format, it is acting like the Windows Resource Compiler. When
+@code{windres} converts from the @code{res} format to the @code{coff}
+format, it is acting like the Windows @code{CVTRES} program.
+
+When @code{windres} generates an @code{rc} file, the output is similar
+but not identical to the format expected for the input. When an input
+@code{rc} file refers to an external filename, an output @code{rc} file
+will instead include the file contents.
+
+If the input or output format is not specified, @code{windres} will
+guess based on the file name, or, for the input file, the file contents.
+A file with an extension of @file{.rc} will be treated as an @code{rc}
+file, a file with an extension of @file{.res} will be treated as a
+@code{res} file, and a file with an extension of @file{.o} or
+@file{.exe} will be treated as a @code{coff} file.
+
+If no output file is specified, @code{windres} will print the resources
+in @code{rc} format to standard output.
+
+The normal use is for you to write an @code{rc} file, use @code{windres}
+to convert it to a COFF object file, and then link the COFF file into
+your application. This will make the resources described in the
+@code{rc} file available to Windows.
+
+@table @code
+@item -i @var{filename}
+@itemx --input @var{filename}
+The name of the input file. If this option is not used, then
+@code{windres} will use the first non-option argument as the input file
+name. If there are no non-option arguments, then @code{windres} will
+read from standard input. @code{windres} can not read a COFF file from
+standard input.
+
+@item -o @var{filename}
+@itemx --output @var{filename}
+The name of the output file. If this option is not used, then
+@code{windres} will use the first non-option argument, after any used
+for the input file name, as the output file name. If there is no
+non-option argument, then @code{windres} will write to standard output.
+@code{windres} can not write a COFF file to standard output.
+
+@item -I @var{format}
+@itemx --input-format @var{format}
+The input format to read. @var{format} may be @samp{res}, @samp{rc}, or
+@samp{coff}. If no input format is specified, @code{windres} will
+guess, as described above.
+
+@item -O @var{format}
+@itemx --output-format @var{format}
+The output format to generate. @var{format} may be @samp{res},
+@samp{rc}, or @samp{coff}. If no output format is specified,
+@code{windres} will guess, as described above.
+
+@item -F @var{target}
+@itemx --target @var{target}
+Specify the BFD format to use for a COFF file as input or output. This
+is a BFD target name; you can use the @code{--help} option to see a list
+of supported targets. Normally @code{windres} will use the default
+format, which is the first one listed by the @code{--help} option.
+@ref{Target Selection}.
+
+@item --preprocessor @var{program}
+When @code{windres} reads an @code{rc} file, it runs it through the C
+preprocessor first. This option may be used to specify the preprocessor
+to use, including any leading arguments. The default preprocessor
+argument is @code{gcc -E -xc-header -DRC_INVOKED}.
+
+@item --include-dir @var{directory}
+Specify an include directory to use when reading an @code{rc} file.
+@code{windres} will pass this to the preprocessor as an @code{-I}
+option. @code{windres} will also search this directory when looking for
+files named in the @code{rc} file.
+
+@item --define @var{sym[=val]}
+Specify a @code{-D} option to pass to the preprocessor when reading an
+@code{rc} file.
+
+@item --language @var{val}
+Specify the default language to use when reading an @code{rc} file.
+@var{val} should be a hexadecimal language code. The low eight bits are
+the language, and the high eight bits are the sublanguage.
+
+@item --help
+Prints a usage summary.
+
+@item --version
+Prints the version number for @code{windres}.
+
+@item --yydebug
+If @code{windres} is compiled with @code{YYDEBUG} defined as @code{1},
+this will turn on parser debugging.
+@end table
+
@node Selecting The Target System
@chapter Selecting the target system
@@ -2162,7 +2317,7 @@ individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
distribution.
In any event, we also recommend that you send bug reports for the binary
-utilities to @samp{bug-gnu-utils@@prep.ai.mit.edu}.
+utilities to @samp{bug-gnu-utils@@gnu.org}.
The fundamental principle of reporting bugs usefully is this:
@strong{report all the facts}. If you are not sure whether to state a
diff --git a/contrib/binutils/binutils/bucomm.c b/contrib/binutils/binutils/bucomm.c
index b23d9e6..d5f2834 100644
--- a/contrib/binutils/binutils/bucomm.c
+++ b/contrib/binutils/binutils/bucomm.c
@@ -39,8 +39,6 @@ typedef long time_t;
#else
#include <varargs.h>
#endif
-
-char *target = NULL; /* default as late as possible */
/* Error reporting */
@@ -197,15 +195,23 @@ make_tempname (filename)
char *tmpname;
char *slash = strrchr (filename, '/');
+#if defined (__DJGPP__) || defined (__GO32__) || defined (_WIN32)
+ if (slash == NULL)
+ slash = strrchr (filename, '\\');
+#endif
+
if (slash != (char *) NULL)
{
+ char c;
+
+ c = *slash;
*slash = 0;
tmpname = xmalloc (strlen (filename) + sizeof (template) + 1);
strcpy (tmpname, filename);
strcat (tmpname, "/");
strcat (tmpname, template);
mktemp (tmpname);
- *slash = '/';
+ *slash = c;
}
else
{
diff --git a/contrib/binutils/binutils/coffgrok.c b/contrib/binutils/binutils/coffgrok.c
index 0725986..8c4e6c9 100644
--- a/contrib/binutils/binutils/coffgrok.c
+++ b/contrib/binutils/binutils/coffgrok.c
@@ -1,5 +1,5 @@
/* coffgrok.c
- Copyright (C) 1994, 95, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -142,7 +142,7 @@ do_sections_p1 (head)
head->sections[i].data = section->flags & SEC_DATA;
if (strcmp (section->name, ".bss") == 0)
head->sections[i].data = 1;
- head->sections[i].address = section->vma;
+ head->sections[i].address = section->lma;
head->sections[i].size = section->_raw_size;
head->sections[i].number = idx;
head->sections[i].nrelocs = section->reloc_count;
@@ -166,7 +166,8 @@ do_sections_p2 (head)
asection *section;
for (section = abfd->sections; section; section = section->next)
{
- int j;
+ unsigned int j;
+
for (j = 0; j < section->reloc_count; j++)
{
int idx;
@@ -248,7 +249,8 @@ do_lines (i, name)
{
struct coff_line *res = (struct coff_line *) xcalloc (sizeof (struct coff_line), 1);
asection *s;
- int l;
+ unsigned int l;
+
/* Find out if this function has any line numbers in the table */
for (s = abfd->sections; s; s = s->next)
{
diff --git a/contrib/binutils/binutils/config.in b/contrib/binutils/binutils/config.in
index 0aa5a64..a9f38eb 100644
--- a/contrib/binutils/binutils/config.in
+++ b/contrib/binutils/binutils/config.in
@@ -1,5 +1,14 @@
/* config.in. Generated automatically from configure.in by autoheader. */
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
+
+/* Configured target name. */
+#undef TARGET
+
/* Whether strstr must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSTR
@@ -28,12 +37,6 @@
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
-/* Define if you have <vfork.h>. */
-#undef HAVE_VFORK_H
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef pid_t
-
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
@@ -43,11 +46,8 @@
*/
#undef STACK_DIRECTION
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define vfork as fork if vfork does not work. */
-#undef vfork
+/* Define if lex declares yytext as a char * by default, not a char[]. */
+#undef YYTEXT_POINTER
/* Is the type time_t defined in <time.h>? */
#undef HAVE_TIME_T_IN_TIME_H
diff --git a/contrib/binutils/binutils/config.texi b/contrib/binutils/binutils/config.texi
index bdcc312..d40699c 100644
--- a/contrib/binutils/binutils/config.texi
+++ b/contrib/binutils/binutils/config.texi
@@ -1 +1 @@
-@set VERSION 2.8.1
+@set VERSION 2.9.1
diff --git a/contrib/binutils/binutils/configure b/contrib/binutils/binutils/configure
index c80280c..740ec6f 100755
--- a/contrib/binutils/binutils/configure
+++ b/contrib/binutils/binutils/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
+# Generated automatically using autoconf version 2.12.1
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -12,11 +12,22 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
- --enable-targets alternative target configurations"
+ --enable-shared build shared libraries [default=yes]
+ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list"
+ac_help="$ac_help
+ --enable-static build static libraries [default=yes]
+ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list"
ac_help="$ac_help
- --enable-shared build shared BFD library"
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
+ac_help="$ac_help
+ --enable-targets alternative target configurations"
ac_help="$ac_help
--enable-commonbfdlib build shared BFD/opcodes/libiberty library"
+ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -55,6 +66,7 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
@@ -338,7 +350,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
+ echo "configure generated by autoconf version 2.12.1"
exit 0 ;;
-with-* | --with-*)
@@ -525,43 +537,8 @@ fi
-# Check whether --enable-targets or --disable-targets was given.
-if test "${enable_targets+set}" = set; then
- enableval="$enable_targets"
- case "${enableval}" in
- yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
- ;;
- no) enable_targets= ;;
- *) enable_targets=$enableval ;;
-esac
-fi
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- case "${enableval}" in
- yes) shared=true shared_bfd=true shared_opcodes=true ;;
- no) shared=false ;;
- *bfd*opcodes*) shared=true shared_bfd=true shared_opcodes=true ;;
- *opcodes*bfd*) shared=true shared_bfd=true shared_opcodes=true ;;
- *bfd*) shared=true shared_bfd=true ;;
- *opcodes*) shared=true shared_opcodes=true ;;
- *) shared=false ;;
-esac
-fi
-# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
-if test "${enable_commonbfdlib+set}" = set; then
- enableval="$enable_commonbfdlib"
- case "${enableval}" in
- yes) commonbfdlib=true ;;
- no) commonbfdlib=false ;;
- *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
-esac
-fi
-
-
-
ac_aux_dir=
-for ac_dir in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`; do
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -573,7 +550,7 @@ for ac_dir in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`; do
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`" 1>&2; exit 1; }
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
@@ -602,33 +579,33 @@ esac
# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:611: checking host system type" >&5
+echo "configure:588: checking host system type" >&5
host_alias=$host
case "$host_alias" in
NONE)
case $nonopt in
NONE)
- if host_alias=`$ac_config_guess`; then :
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
fi ;;
*) host_alias=$nonopt ;;
esac ;;
esac
-host=`$ac_config_sub $host_alias`
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:632: checking target system type" >&5
+echo "configure:609: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -639,14 +616,14 @@ NONE)
esac ;;
esac
-target=`$ac_config_sub $target_alias`
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:650: checking build system type" >&5
+echo "configure:627: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -657,7 +634,7 @@ NONE)
esac ;;
esac
-build=`$ac_config_sub $build_alias`
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -668,12 +645,110 @@ test "$host_alias" != "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
-if test -z "$target" ; then
- { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:662: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
fi
-if test -z "$host" ; then
- { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; }
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:716: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
if test "$program_transform_name" = s,x,x,; then
program_transform_name=
else
@@ -693,18 +768,198 @@ test "$program_suffix" != NONE &&
# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:773: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
-# host-specific stuff:
-HDEFINES=
-HLDFLAGS=
-HLDENV=
-RPATH_ENVVAR=LD_LIBRARY_PATH
+PACKAGE=binutils
+
+VERSION=2.9.1
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:819: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
+else
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:832: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:845: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:858: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
+else
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:871: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=yes
+fi
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:934: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:708: checking for $ac_word" >&5
+echo "configure:963: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -733,7 +988,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:737: checking for $ac_word" >&5
+echo "configure:992: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -781,7 +1036,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:785: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -791,11 +1046,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 795 "configure"
+#line 1050 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -815,12 +1070,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:819: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1074: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:824: checking whether we are using GNU C" >&5
+echo "configure:1079: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -829,7 +1084,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -844,7 +1099,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:848: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1103: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -871,165 +1126,511 @@ else
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
-. ${srcdir}/../bfd/configure.host
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:1143: checking for ld used by GCC" >&5
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+ /* | [A-Za-z]:\\*)
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:1161: checking for GNU ld" >&5
+else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:1164: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ echo "$ac_t""$LD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:1200: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi
+fi
+echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
-AR=${AR-ar}
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:1216: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$NM" in
+/* | [A-Za-z]:\\*)
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac
+fi
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
+NM="$ac_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1253: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 1289 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+
+# Check whether --enable-targets or --disable-targets was given.
+if test "${enable_targets+set}" = set; then
+ enableval="$enable_targets"
+ case "${enableval}" in
+ yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
+ ;;
+ no) enable_targets= ;;
+ *) enable_targets=$enableval ;;
+esac
+fi
+# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
+if test "${enable_commonbfdlib+set}" = set; then
+ enableval="$enable_commonbfdlib"
+ case "${enableval}" in
+ yes) commonbfdlib=true ;;
+ no) commonbfdlib=false ;;
+ *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
+esac
+fi
+
+
+
+
+
+if test -z "$target" ; then
+ { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
+fi
+if test -z "$host" ; then
+ { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; }
+fi
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:887: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+echo "configure:1354: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
+ ac_cv_prog_CC="gcc"
break
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:924: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1383: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
done
- IFS="$ac_save_IFS"
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1431: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 1441 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ ac_cv_prog_cc_cross=yes
fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
fi
-echo "$ac_t""$INSTALL" 1>&6
+rm -fr conftest*
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1465: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1470: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1494: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
-# For most hosts we can use a simple definition to pick up the BFD and
-# opcodes libraries. However, if we are building shared libraries, we
-# need to handle some hosts specially.
-BFDLIB='-L../bfd -lbfd'
-OPCODES='-L../opcodes -lopcodes'
+fi
-case "${host}" in
-*-*-sunos*)
- # On SunOS, we must link against the name we are going to install,
- # not -lbfd, since SunOS does not support SONAME.
- if test "${shared_bfd}" = "true"; then
- BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
- fi
- if test "${shared_opcodes}" = "true"; then
- OPCODES='-L../opcodes -l`echo opcodes | sed '"'"'$(program_transform_name)'"'"'`'
- fi
- ;;
-alpha*-*-osf*)
- # On Alpha OSF/1, the native linker searches all the -L
- # directories for any LIB.so files, and only then searches for any
- # LIB.a files. That means that if there is an installed
- # libbfd.so, but this build is not done with --enable-shared, the
- # link will wind up being against the install libbfd.so rather
- # than the newly built libbfd. To avoid this, we must explicitly
- # link against libbfd.a when --enable-shared is not used.
- if test "${shared_bfd}" != "true"; then
- BFDLIB='../bfd/libbfd.a'
- fi
- if test "${shared_opcodes}" != "true"; then
- OPCODES='../opcodes/libopcodes.a'
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
fi
- ;;
-esac
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
-if test "${commonbfdlib}" = "true"; then
- # when a shared libbfd is built with --enable-commonbfdlib,
- # all of libopcodes is available in libbfd.so. Unfortunately, on
- # HP/UX, when using gcc -g, the linker does a static link, so we
- # need to continue linking against opcodes on that platform.
- case "${host}" in
- *-*-hpux*) ;;
- *) OPCODES= ;;
- esac
+
+for ac_prog in 'bison -y' byacc
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1527: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$YACC"; then
+ ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_YACC="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+YACC="$ac_cv_prog_YACC"
+if test -n "$YACC"; then
+ echo "$ac_t""$YACC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
fi
+test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+# Extract the first word of "flex", so it can be a program name with args.
+set dummy flex; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1559: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$LEX"; then
+ ac_cv_prog_LEX="$LEX" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_LEX="flex"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
+fi
+fi
+LEX="$ac_cv_prog_LEX"
+if test -n "$LEX"; then
+ echo "$ac_t""$LEX" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+if test -z "$LEXLIB"
+then
+ case "$LEX" in
+ flex*) ac_lib=fl ;;
+ *) ac_lib=l ;;
+ esac
+ echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
+echo "configure:1592: checking for yywrap in -l$ac_lib" >&5
+ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-l$ac_lib $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1600 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char yywrap();
-# Put a plausible default for CC_FOR_BUILD in Makefile.
-if test -z "$CC_FOR_BUILD"; then
- if test "x$cross_compiling" = "xno"; then
- CC_FOR_BUILD='$(CC)'
- else
- CC_FOR_BUILD=gcc
- fi
+int main() {
+yywrap()
+; return 0; }
+EOF
+if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LEXLIB="-l$ac_lib"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1033: checking how to run the C preprocessor" >&5
+echo "configure:1634: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1044,13 +1645,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1048 "configure"
+#line 1649 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1061,13 +1662,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1065 "configure"
+#line 1666 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1089,21 +1690,264 @@ else
fi
echo "$ac_t""$CPP" 1>&6
+echo $ac_n "checking lex output file root""... $ac_c" 1>&6
+echo "configure:1695: checking lex output file root" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # The minimal lex program is just a single line: %%. But some broken lexes
+# (Solaris, I think it was) want two %% lines, so accommodate them.
+echo '%%
+%%' | $LEX
+if test -f lex.yy.c; then
+ ac_cv_prog_lex_root=lex.yy
+elif test -f lexyy.c; then
+ ac_cv_prog_lex_root=lexyy
+else
+ { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; }
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
+echo "configure:1716: checking whether yytext is a pointer" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # POSIX says lex can declare yytext either as a pointer or an array; the
+# default is implementation-dependent. Figure out which it is, since
+# not all implementations provide the %pointer and %array declarations.
+ac_cv_prog_lex_yytext_pointer=no
+echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
+ac_save_LIBS="$LIBS"
+LIBS="$LIBS $LEXLIB"
+cat > conftest.$ac_ext <<EOF
+#line 1728 "configure"
+#include "confdefs.h"
+`cat $LEX_OUTPUT_ROOT.c`
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ ac_cv_prog_lex_yytext_pointer=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+rm -f "${LEX_OUTPUT_ROOT}.c"
+
+fi
+
+echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6
+if test $ac_cv_prog_lex_yytext_pointer = yes; then
+ cat >> confdefs.h <<\EOF
+#define YYTEXT_POINTER 1
+EOF
+
+fi
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:1758: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+
+
+echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
+echo "configure:1776: checking for Cygwin32 environment" >&5
+if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1781 "configure"
+#include "confdefs.h"
+
+int main() {
+return __CYGWIN32__;
+; return 0; }
+EOF
+if { (eval echo configure:1788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_cygwin32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_cygwin32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_cygwin32" 1>&6
+CYGWIN32=
+test "$am_cv_cygwin32" = yes && CYGWIN32=yes
+echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
+echo "configure:1805: checking for Mingw32 environment" >&5
+if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1810 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_mingw32" 1>&6
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1836: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*
+fi
+
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+echo "$ac_t""${am_cv_exeext}" 1>&6
+
+
+# host-specific stuff:
+
+HDEFINES=
+
+. ${srcdir}/../bfd/configure.host
+
+
+AR=${AR-ar}
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1872: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+
+# Put a plausible default for CC_FOR_BUILD in Makefile.
+if test -z "$CC_FOR_BUILD"; then
+ if test "x$cross_compiling" = "xno"; then
+ CC_FOR_BUILD='$(CC)'
+ else
+ CC_FOR_BUILD=gcc
+ fi
+fi
+
+# Also set EXEEXT_FOR_BUILD.
+if test "x$cross_compiling" = "xno"; then
+ EXEEXT_FOR_BUILD='$(EXEEXT)'
+else
+ echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
+echo "configure:1916: 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
+ cat > ac_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+ ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
+ bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
+ rm -f ac_c_test*
+ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no
+fi
+
+echo "$ac_t""$bfd_cv_build_exeext" 1>&6
+ EXEEXT_FOR_BUILD=""
+ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
+fi
+
+
for ac_hdr in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1097: checking for $ac_hdr" >&5
+echo "configure:1941: 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 1102 "configure"
+#line 1946 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1130,12 +1974,12 @@ fi
done
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1134: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1978: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1139 "configure"
+#line 1983 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -1151,7 +1995,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:1155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -1174,19 +2018,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1178: checking for working alloca.h" >&5
+echo "configure:2022: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1183 "configure"
+#line 2027 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -1207,12 +2051,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1211: checking for alloca" >&5
+echo "configure:2055: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1216 "configure"
+#line 2060 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1235,7 +2079,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -1267,12 +2111,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1271: checking whether alloca needs Cray hooks" >&5
+echo "configure:2115: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1276 "configure"
+#line 2120 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1297,12 +2141,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1301: checking for $ac_func" >&5
+echo "configure:2145: 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 1306 "configure"
+#line 2150 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1325,7 +2169,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1352,7 +2196,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1356: checking stack direction for C alloca" >&5
+echo "configure:2200: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1360,7 +2204,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1364 "configure"
+#line 2208 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1379,7 +2223,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -1403,12 +2247,12 @@ fi
for ac_func in sbrk utimes
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1407: checking for $ac_func" >&5
+echo "configure:2251: 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 1412 "configure"
+#line 2256 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1431,7 +2275,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1455,422 +2299,21 @@ else
fi
done
-if test "x$cross_compiling" = "xno"; then
- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1461: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1466 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- ac_cv_header_stdc=yes
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1491 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1509 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 1530 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1565: checking for pid_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1570 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_pid_t=yes
-else
- rm -rf conftest*
- ac_cv_type_pid_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_pid_t" 1>&6
-if test $ac_cv_type_pid_t = no; then
- cat >> confdefs.h <<\EOF
-#define pid_t int
-EOF
-
-fi
-
-ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:1599: checking for vfork.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 1604 "configure"
-#include "confdefs.h"
-#include <vfork.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_VFORK_H 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:1634: checking for working vfork" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:1640: checking for vfork" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1645 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char vfork(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char vfork();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_vfork) || defined (__stub___vfork)
-choke me
-#else
-vfork();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_vfork=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_vfork=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-fi
-
-else
- cat > conftest.$ac_ext <<EOF
-#line 1689 "configure"
-#include "confdefs.h"
-/* Thanks to Paul Eggert for this test. */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
-#endif
-/* On some sparc systems, changes by the child to local and incoming
- argument registers are propagated back to the parent.
- The compiler is told about this with #include <vfork.h>,
- but some compilers (e.g. gcc -O) don't grok <vfork.h>.
- Test for this by using a static variable whose address
- is put into a register that is clobbered by the vfork. */
-static
-#ifdef __cplusplus
-sparc_address_test (int arg)
-#else
-sparc_address_test (arg) int arg;
-#endif
-{
- static pid_t child;
- if (!child) {
- child = vfork ();
- if (child < 0) {
- perror ("vfork");
- _exit(2);
- }
- if (!child) {
- arg = getpid();
- write(-1, "", 0);
- _exit (arg);
- }
- }
-}
-main() {
- pid_t parent = getpid ();
- pid_t child;
-
- sparc_address_test ();
-
- child = vfork ();
-
- if (child == 0) {
- /* Here is another test for sparc vfork register problems.
- This test uses lots of local variables, at least
- as many local variables as main has allocated so far
- including compiler temporaries. 4 locals are enough for
- gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
- A buggy compiler should reuse the register of parent
- for one of the local variables, since it will think that
- parent can't possibly be used any more in this routine.
- Assigning to the local variable will thus munge parent
- in the parent process. */
- pid_t
- p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
- p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
- /* Convince the compiler that p..p7 are live; otherwise, it might
- use the same hardware register for all 8 local variables. */
- if (p != p1 || p != p2 || p != p3 || p != p4
- || p != p5 || p != p6 || p != p7)
- _exit(1);
-
- /* On some systems (e.g. IRIX 3.3),
- vfork doesn't separate parent from child file descriptors.
- If the child closes a descriptor before it execs or exits,
- this munges the parent's descriptor as well.
- Test for this by closing stdout in the child. */
- _exit(close(fileno(stdout)) != 0);
- } else {
- int status;
- struct stat st;
-
- while (wait(&status) != child)
- ;
- exit(
- /* Was there some problem with vforking? */
- child < 0
-
- /* Did the child fail? (This shouldn't happen.) */
- || status
-
- /* Did the vfork/compiler bug occur? */
- || parent != getpid()
-
- /* Did the file descriptor bug occur? */
- || fstat(fileno(stdout), &st) != 0
- );
- }
-}
-EOF
-if { (eval echo configure:1784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- ac_cv_func_vfork_works=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_vfork_works=no
-fi
-rm -fr conftest*
-fi
-
-fi
-
-echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
-if test $ac_cv_func_vfork_works = no; then
- cat >> confdefs.h <<\EOF
-#define vfork fork
-EOF
-
-fi
-
-else
- echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:1808: checking for vfork" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1813 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char vfork(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char vfork();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_vfork) || defined (__stub___vfork)
-choke me
-#else
-vfork();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_vfork=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_vfork=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-cat >> confdefs.h <<\EOF
-#define vfork fork
-EOF
-
-fi
-
-fi
echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6
-echo "configure:1862: checking for time_t in time.h" >&5
+echo "configure:2305: checking for time_t in time.h" >&5
if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1867 "configure"
+#line 2310 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
time_t i;
; return 0; }
EOF
-if { (eval echo configure:1874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bu_cv_decl_time_t_time_h=yes
else
@@ -1891,19 +2334,19 @@ EOF
fi
echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:1895: checking for time_t in sys/types.h" >&5
+echo "configure:2338: checking for time_t in sys/types.h" >&5
if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1900 "configure"
+#line 2343 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {
time_t i;
; return 0; }
EOF
-if { (eval echo configure:1907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bu_cv_decl_time_t_types_h=yes
else
@@ -1926,12 +2369,12 @@ fi
# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
# by default.
echo $ac_n "checking for utime.h""... $ac_c" 1>&6
-echo "configure:1930: checking for utime.h" >&5
+echo "configure:2373: checking for utime.h" >&5
if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1935 "configure"
+#line 2378 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_TIME_H
@@ -1942,7 +2385,7 @@ int main() {
struct utimbuf s;
; return 0; }
EOF
-if { (eval echo configure:1946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bu_cv_header_utime_h=yes
else
@@ -1963,12 +2406,12 @@ EOF
fi
echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6
-echo "configure:1967: checking whether fprintf must be declared" >&5
+echo "configure:2410: checking whether fprintf must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1972 "configure"
+#line 2415 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1989,7 +2432,7 @@ int main() {
char *(*pfn) = (char *(*)) fprintf
; return 0; }
EOF
-if { (eval echo configure:1993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_fprintf=no
else
@@ -2011,12 +2454,12 @@ EOF
fi
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:2015: checking whether strstr must be declared" >&5
+echo "configure:2458: 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 2020 "configure"
+#line 2463 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2037,7 +2480,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:2041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -2059,12 +2502,12 @@ EOF
fi
echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:2063: checking whether sbrk must be declared" >&5
+echo "configure:2506: checking whether sbrk must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2068 "configure"
+#line 2511 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2085,7 +2528,7 @@ int main() {
char *(*pfn) = (char *(*)) sbrk
; return 0; }
EOF
-if { (eval echo configure:2089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_sbrk=no
else
@@ -2107,12 +2550,12 @@ EOF
fi
echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:2111: checking whether getenv must be declared" >&5
+echo "configure:2554: 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 2116 "configure"
+#line 2559 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2133,7 +2576,7 @@ int main() {
char *(*pfn) = (char *(*)) getenv
; return 0; }
EOF
-if { (eval echo configure:2137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_getenv=no
else
@@ -2157,7 +2600,7 @@ fi
case "${host}" in
-i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
+i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
cat >> confdefs.h <<\EOF
#define USE_BINARY_FOPEN 1
EOF
@@ -2186,48 +2629,52 @@ NLMCONV_DEFS=
BUILD_SRCONV=
BUILD_DLLTOOL=
DLLTOOL_DEFS=
+BUILD_WINDRES=
for targ in $target $canon_targets
do
if test "x$targ" = "xall"; then
all_targets=true
- BUILD_NLMCONV='$(NLMCONV_PROG)'
- BUILD_SRCONV='$(SRCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
+ BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
else
case $targ in
i[3456]86*-*-netware*)
- BUILD_NLMCONV='$(NLMCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
;;
alpha*-*-netware*)
- BUILD_NLMCONV='$(NLMCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
;;
powerpc*-*-netware*)
- BUILD_NLMCONV='$(NLMCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
;;
sparc*-*-netware*)
- BUILD_NLMCONV='$(NLMCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
;;
esac
case $targ in
- *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
+ *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)' ;;
esac
case $targ in
arm-*pe*)
- BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
- i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
- BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+ i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
powerpc*-*-*pe* | powerpc*-*-cygwin32)
- BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
esac
fi
@@ -2239,6 +2686,12 @@ done
+
+cat >> confdefs.h <<EOF
+#define TARGET "${target}"
+EOF
+
+
targ=$target
. $srcdir/../bfd/config.bfd
if test "x$targ_underscore" = "xyes"; then
@@ -2271,7 +2724,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -2338,7 +2791,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -2358,6 +2811,7 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
@@ -2394,25 +2848,41 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@RANLIB@%$RANLIB%g
s%@CC@%$CC%g
+s%@LD@%$LD%g
+s%@NM@%$NM%g
+s%@LN_S@%$LN_S%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@YACC@%$YACC%g
+s%@LEX@%$LEX%g
+s%@LEXLIB@%$LEXLIB%g
+s%@CPP@%$CPP%g
+s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
+s%@MAINT@%$MAINT%g
+s%@EXEEXT@%$EXEEXT%g
s%@HDEFINES@%$HDEFINES%g
-s%@HLDFLAGS@%$HLDFLAGS%g
-s%@HLDENV@%$HLDENV%g
-s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@BFDLIB@%$BFDLIB%g
-s%@OPCODES@%$OPCODES%g
s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
-s%@CPP@%$CPP%g
+s%@EXEEXT_FOR_BUILD@%$EXEEXT_FOR_BUILD%g
s%@ALLOCA@%$ALLOCA%g
s%@NLMCONV_DEFS@%$NLMCONV_DEFS%g
s%@BUILD_NLMCONV@%$BUILD_NLMCONV%g
s%@BUILD_SRCONV@%$BUILD_SRCONV%g
s%@BUILD_DLLTOOL@%$BUILD_DLLTOOL%g
s%@DLLTOOL_DEFS@%$DLLTOOL_DEFS%g
+s%@BUILD_WINDRES@%$BUILD_WINDRES%g
s%@UNDERSCORE@%$UNDERSCORE%g
CEOF
@@ -2624,9 +3094,11 @@ fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
+
EOF
cat >> $CONFIG_STATUS <<\EOF
-case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
+test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
exit 0
EOF
chmod +x $CONFIG_STATUS
diff --git a/contrib/binutils/binutils/configure.in b/contrib/binutils/binutils/configure.in
index c8d5432..8b6dbfb 100644
--- a/contrib/binutils/binutils/configure.in
+++ b/contrib/binutils/binutils/configure.in
@@ -3,6 +3,12 @@ dnl
AC_PREREQ(2.5)
AC_INIT(ar.c)
+AC_CANONICAL_SYSTEM
+
+AM_INIT_AUTOMAKE(binutils, 2.9.1)
+
+AM_PROG_LIBTOOL
+
AC_ARG_ENABLE(targets,
[ --enable-targets alternative target configurations],
[case "${enableval}" in
@@ -11,17 +17,6 @@ AC_ARG_ENABLE(targets,
no) enable_targets= ;;
*) enable_targets=$enableval ;;
esac])dnl
-AC_ARG_ENABLE(shared,
-[ --enable-shared build shared BFD library],
-[case "${enableval}" in
- yes) shared=true shared_bfd=true shared_opcodes=true ;;
- no) shared=false ;;
- *bfd*opcodes*) shared=true shared_bfd=true shared_opcodes=true ;;
- *opcodes*bfd*) shared=true shared_bfd=true shared_opcodes=true ;;
- *bfd*) shared=true shared_bfd=true ;;
- *opcodes*) shared=true shared_opcodes=true ;;
- *) shared=false ;;
-esac])dnl
AC_ARG_ENABLE(commonbfdlib,
[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
[case "${enableval}" in
@@ -30,85 +25,36 @@ AC_ARG_ENABLE(commonbfdlib,
*) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
esac])dnl
-AC_CONFIG_HEADER(config.h:config.in)
+AM_CONFIG_HEADER(config.h:config.in)
-AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
-AC_CANONICAL_SYSTEM
if test -z "$target" ; then
AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
fi
if test -z "$host" ; then
AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
fi
-AC_ARG_PROGRAM
+
+AC_PROG_CC
+
+AC_PROG_YACC
+AC_PROG_LEX
+AC_DECL_YYTEXT
+
+AM_MAINTAINER_MODE
+AM_CYGWIN32
+AM_EXEEXT
# host-specific stuff:
HDEFINES=
-HLDFLAGS=
-HLDENV=
-RPATH_ENVVAR=LD_LIBRARY_PATH
-
-AC_PROG_CC
. ${srcdir}/../bfd/configure.host
AC_SUBST(HDEFINES)
-AC_SUBST(HLDFLAGS)
-AC_SUBST(HLDENV)
-AC_SUBST(RPATH_ENVVAR)
AR=${AR-ar}
AC_SUBST(AR)
AC_PROG_RANLIB
-AC_PROG_INSTALL
-
-# For most hosts we can use a simple definition to pick up the BFD and
-# opcodes libraries. However, if we are building shared libraries, we
-# need to handle some hosts specially.
-BFDLIB='-L../bfd -lbfd'
-OPCODES='-L../opcodes -lopcodes'
-
-case "${host}" in
-*-*-sunos*)
- # On SunOS, we must link against the name we are going to install,
- # not -lbfd, since SunOS does not support SONAME.
- if test "${shared_bfd}" = "true"; then
- BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
- fi
- if test "${shared_opcodes}" = "true"; then
- OPCODES='-L../opcodes -l`echo opcodes | sed '"'"'$(program_transform_name)'"'"'`'
- fi
- ;;
-alpha*-*-osf*)
- # On Alpha OSF/1, the native linker searches all the -L
- # directories for any LIB.so files, and only then searches for any
- # LIB.a files. That means that if there is an installed
- # libbfd.so, but this build is not done with --enable-shared, the
- # link will wind up being against the install libbfd.so rather
- # than the newly built libbfd. To avoid this, we must explicitly
- # link against libbfd.a when --enable-shared is not used.
- if test "${shared_bfd}" != "true"; then
- BFDLIB='../bfd/libbfd.a'
- fi
- if test "${shared_opcodes}" != "true"; then
- OPCODES='../opcodes/libopcodes.a'
- fi
- ;;
-esac
-
-if test "${commonbfdlib}" = "true"; then
- # when a shared libbfd is built with --enable-commonbfdlib,
- # all of libopcodes is available in libbfd.so. Unfortunately, on
- # HP/UX, when using gcc -g, the linker does a static link, so we
- # need to continue linking against opcodes on that platform.
- case "${host}" in
- *-*-hpux*) ;;
- *) OPCODES= ;;
- esac
-fi
-
-AC_SUBST(BFDLIB)
-AC_SUBST(OPCODES)
+AM_PROG_INSTALL
BFD_CC_FOR_BUILD
@@ -116,13 +62,6 @@ AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
AC_HEADER_SYS_WAIT
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(sbrk utimes)
-dnl Temporary workaround for bug in autoconf 2.12. When the bug is
-dnl fixed, we can just call AC_FUNC_VFORK in all cases.
-if test "x$cross_compiling" = "xno"; then
- AC_FUNC_VFORK
-else
- AC_CHECK_FUNC(vfork, , AC_DEFINE(vfork, fork))
-fi
AC_MSG_CHECKING(for time_t in time.h)
AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
@@ -187,52 +126,56 @@ NLMCONV_DEFS=
BUILD_SRCONV=
BUILD_DLLTOOL=
DLLTOOL_DEFS=
+BUILD_WINDRES=
for targ in $target $canon_targets
do
if test "x$targ" = "xall"; then
all_targets=true
- BUILD_NLMCONV='$(NLMCONV_PROG)'
- BUILD_SRCONV='$(SRCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
+ BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
else
case $targ in
changequote(,)dnl
i[3456]86*-*-netware*)
changequote([,])dnl
- BUILD_NLMCONV='$(NLMCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
;;
alpha*-*-netware*)
- BUILD_NLMCONV='$(NLMCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
;;
powerpc*-*-netware*)
- BUILD_NLMCONV='$(NLMCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
;;
sparc*-*-netware*)
- BUILD_NLMCONV='$(NLMCONV_PROG)'
+ BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
;;
esac
case $targ in
- *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
+ *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)' ;;
esac
case $targ in
arm-*pe*)
- BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
changequote(,)dnl
- i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
+ i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
changequote([,])dnl
- BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
powerpc*-*-*pe* | powerpc*-*-cygwin32)
- BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
esac
fi
@@ -243,6 +186,9 @@ AC_SUBST(BUILD_NLMCONV)
AC_SUBST(BUILD_SRCONV)
AC_SUBST(BUILD_DLLTOOL)
AC_SUBST(DLLTOOL_DEFS)
+AC_SUBST(BUILD_WINDRES)
+
+AC_DEFINE_UNQUOTED(TARGET, "${target}")
targ=$target
. $srcdir/../bfd/config.bfd
@@ -253,5 +199,4 @@ else
fi
AC_SUBST(UNDERSCORE)
-AC_OUTPUT(Makefile,
-[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
+AC_OUTPUT(Makefile)
diff --git a/contrib/binutils/binutils/deflex.l b/contrib/binutils/binutils/deflex.l
index 6ce50ad..e7fa362 100644
--- a/contrib/binutils/binutils/deflex.l
+++ b/contrib/binutils/binutils/deflex.l
@@ -1,7 +1,6 @@
-%{
-/* deflex.l - Lexer for .def files */
+%{/* deflex.l - Lexer for .def files */
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -25,8 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
*/
#define DONTDECLARE_MALLOC
+#include "libiberty.h"
#include "defparse.h"
-extern char *strdup();
+#include "dlltool.h"
+
int linenumber;
%}
@@ -41,7 +42,7 @@ int linenumber;
"SECTIONS" { return SECTIONS;}
"EXPORTS" { return EXPORTS;}
"IMPORTS" { return IMPORTS;}
-"VERSION" { return VERSION;}
+"VERSION" { return VERSIONK;}
"BASE" { return BASE;}
"CONSTANT" { return CONSTANT; }
"NONAME" { return NONAME; }
@@ -53,19 +54,19 @@ int linenumber;
[0-9][x0-9A-Fa-f]* { yylval.number = strtol (yytext,0,0);
return NUMBER; }
-[A-Za-z$:\-\_][A-Za-z0-9/$:\-\_@]+ {
- yylval.id = strdup(yytext);
+[A-Za-z$:\-\_?][A-Za-z0-9/$:\-\_@?]+ {
+ yylval.id = xstrdup (yytext);
return ID;
}
"\""[^\"]*"\"" {
- yylval.id = strdup (yytext+1);
+ yylval.id = xstrdup (yytext+1);
yylval.id[yyleng-2] = 0;
return ID;
}
"\'"[^\']*"\'" {
- yylval.id = strdup (yytext+1);
+ yylval.id = xstrdup (yytext+1);
yylval.id[yyleng-2] = 0;
return ID;
}
diff --git a/contrib/binutils/binutils/defparse.c b/contrib/binutils/binutils/defparse.c
new file mode 100644
index 0000000..1212c6b
--- /dev/null
+++ b/contrib/binutils/binutils/defparse.c
@@ -0,0 +1,1056 @@
+
+/* A Bison parser, made from /5g/ian/binutils/release/copy/binutils/defparse.y
+ by GNU Bison version 1.25
+ */
+
+#define YYBISON 1 /* Identify Bison output. */
+
+#define NAME 258
+#define LIBRARY 259
+#define DESCRIPTION 260
+#define STACKSIZE 261
+#define HEAPSIZE 262
+#define CODE 263
+#define DATA 264
+#define SECTIONS 265
+#define EXPORTS 266
+#define IMPORTS 267
+#define VERSIONK 268
+#define BASE 269
+#define CONSTANT 270
+#define READ 271
+#define WRITE 272
+#define EXECUTE 273
+#define SHARED 274
+#define NONAME 275
+#define ID 276
+#define NUMBER 277
+
+#line 1 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+ /* defparse.y - parser for .def files */
+
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+
+This file is part of GNU Binutils.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "bucomm.h"
+#include "dlltool.h"
+
+#line 26 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+typedef union {
+ char *id;
+ int number;
+} YYSTYPE;
+#include <stdio.h>
+
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
+#endif
+
+
+
+#define YYFINAL 75
+#define YYFLAG -32768
+#define YYNTBASE 27
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 277 ? yytranslate[x] : 46)
+
+static const char yytranslate[] = { 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 25, 2, 23, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 24, 2, 2, 26, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22
+};
+
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 3, 5, 9, 13, 16, 19, 23, 27, 30,
+ 33, 36, 39, 42, 47, 48, 50, 53, 60, 63,
+ 65, 71, 75, 78, 80, 83, 87, 89, 91, 92,
+ 95, 96, 98, 100, 102, 104, 106, 107, 109, 110,
+ 112, 113, 115, 116, 119, 120, 123, 124, 128
+};
+
+static const short yyrhs[] = { 27,
+ 28, 0, 28, 0, 3, 42, 45, 0, 4, 42,
+ 45, 0, 11, 29, 0, 5, 21, 0, 6, 22,
+ 37, 0, 7, 22, 37, 0, 8, 35, 0, 9,
+ 35, 0, 10, 33, 0, 12, 31, 0, 13, 22,
+ 0, 13, 22, 23, 22, 0, 0, 30, 0, 29,
+ 30, 0, 21, 44, 43, 40, 39, 41, 0, 31,
+ 32, 0, 32, 0, 21, 24, 21, 23, 21, 0,
+ 21, 23, 21, 0, 33, 34, 0, 34, 0, 21,
+ 35, 0, 35, 36, 38, 0, 38, 0, 25, 0,
+ 0, 25, 22, 0, 0, 16, 0, 17, 0, 18,
+ 0, 19, 0, 15, 0, 0, 20, 0, 0, 9,
+ 0, 0, 21, 0, 0, 26, 22, 0, 0, 24,
+ 21, 0, 0, 14, 24, 22, 0, 0
+};
+
+#endif
+
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 42, 43, 46, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 62, 64, 65, 68, 72, 74,
+ 77, 79, 81, 83, 86, 90, 92, 95, 97, 99,
+ 100, 103, 105, 106, 107, 110, 112, 115, 117, 120,
+ 122, 125, 126, 129, 131, 134, 136, 139, 140
+};
+#endif
+
+
+#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+
+static const char * const yytname[] = { "$","error","$undefined.","NAME","LIBRARY",
+"DESCRIPTION","STACKSIZE","HEAPSIZE","CODE","DATA","SECTIONS","EXPORTS","IMPORTS",
+"VERSIONK","BASE","CONSTANT","READ","WRITE","EXECUTE","SHARED","NONAME","ID",
+"NUMBER","'.'","'='","','","'@'","start","command","explist","expline","implist",
+"impline","seclist","secline","attr_list","opt_comma","opt_number","attr","opt_CONSTANT",
+"opt_NONAME","opt_DATA","opt_name","opt_ordinal","opt_equal_name","opt_base", NULL
+};
+#endif
+
+static const short yyr1[] = { 0,
+ 27, 27, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 29, 29, 29, 30, 31, 31,
+ 32, 32, 33, 33, 34, 35, 35, 36, 36, 37,
+ 37, 38, 38, 38, 38, 39, 39, 40, 40, 41,
+ 41, 42, 42, 43, 43, 44, 44, 45, 45
+};
+
+static const short yyr2[] = { 0,
+ 2, 1, 3, 3, 2, 2, 3, 3, 2, 2,
+ 2, 2, 2, 4, 0, 1, 2, 6, 2, 1,
+ 5, 3, 2, 1, 2, 3, 1, 1, 0, 2,
+ 0, 1, 1, 1, 1, 1, 0, 1, 0, 1,
+ 0, 1, 0, 2, 0, 2, 0, 3, 0
+};
+
+static const short yydefact[] = { 0,
+ 43, 43, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 2, 42, 49, 49, 6, 31, 31, 32,
+ 33, 34, 35, 9, 27, 10, 0, 11, 24, 47,
+ 5, 16, 0, 12, 20, 13, 1, 0, 3, 4,
+ 0, 7, 8, 28, 0, 25, 23, 0, 45, 17,
+ 0, 0, 19, 0, 0, 30, 26, 46, 0, 39,
+ 22, 0, 14, 48, 44, 38, 37, 0, 36, 41,
+ 21, 40, 18, 0, 0
+};
+
+static const short yydefgoto[] = { 12,
+ 13, 31, 32, 34, 35, 28, 29, 24, 45, 42,
+ 25, 70, 67, 73, 15, 60, 49, 39
+};
+
+static const short yypact[] = { 18,
+ -2, -2, 15, 17, 20, -1, -1, 19, 22, 23,
+ 24, 1,-32768,-32768, 31, 31,-32768, 12, 12,-32768,
+-32768,-32768,-32768, 16,-32768, 16, -1, 19,-32768, 14,
+ 22,-32768, -21, 23,-32768, 25,-32768, 26,-32768,-32768,
+ 27,-32768,-32768,-32768, -1, 16,-32768, 30, 21,-32768,
+ 32, 33,-32768, 34, 35,-32768,-32768,-32768, 36, 39,
+-32768, 29,-32768,-32768,-32768,-32768, 40, 41,-32768, 51,
+-32768,-32768,-32768, 61,-32768
+};
+
+static const short yypgoto[] = {-32768,
+ 52,-32768, 37,-32768, 38,-32768, 42, -7,-32768, 44,
+ 28,-32768,-32768,-32768, 63,-32768,-32768, 50
+};
+
+
+#define YYLAST 73
+
+
+static const short yytable[] = { 26,
+ 74, 51, 52, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 20, 21, 22, 23, 14, 46,
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, -29, -29, -29, -29, 17, 41, 48, 18, 27,
+ 44, 19, 30, 33, 38, 36, 59, 54, 56, 55,
+ 58, 68, 61, 62, 69, 63, 64, 65, 66, 72,
+ 75, 71, 43, 37, 16, 40, 0, 50, 0, 47,
+ 0, 53, 57
+};
+
+static const short yycheck[] = { 7,
+ 0, 23, 24, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 16, 17, 18, 19, 21, 27,
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
+ 13, 16, 17, 18, 19, 21, 25, 24, 22, 21,
+ 25, 22, 21, 21, 14, 22, 26, 23, 22, 24,
+ 21, 23, 21, 21, 15, 22, 22, 22, 20, 9,
+ 0, 21, 19, 12, 2, 16, -1, 31, -1, 28,
+ -1, 34, 45
+};
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/usr/cygnus/progressive-97r2/share/bison.simple"
+
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+#ifndef alloca
+#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
+#include <alloca.h>
+#else /* not sparc */
+#if defined (MSDOS) && !defined (__TURBOC__)
+#include <malloc.h>
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+#include <malloc.h>
+ #pragma alloca
+#else /* not MSDOS, __TURBOC__, or _AIX */
+#ifdef __hpux
+#ifdef __cplusplus
+extern "C" {
+void *alloca (unsigned int);
+};
+#else /* not __cplusplus */
+void *alloca ();
+#endif /* not __cplusplus */
+#endif /* __hpux */
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc. */
+#endif /* not GNU C. */
+#endif /* alloca not defined. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYACCEPT return(0)
+#define YYABORT return(1)
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define YYFAIL goto yyerrlab
+#define YYRECOVERING() (!!yyerrstatus)
+#define YYBACKUP(token, value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+#ifndef YYPURE
+#define YYLEX yylex()
+#endif
+
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval, &yylloc)
+#endif
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval)
+#endif
+#endif /* not YYLSP_NEEDED */
+#endif
+
+/* If nonreentrant, generate the variables here */
+
+#ifndef YYPURE
+
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
+
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
+
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
+
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
+
+#ifndef YYINITDEPTH
+#define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
+
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 10000
+#endif
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+int yyparse (void);
+#endif
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#else /* __cplusplus */
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (char *to, char *from, int count)
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#endif
+#endif
+
+#line 196 "/usr/cygnus/progressive-97r2/share/bison.simple"
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
+
+#ifdef YYPARSE_PARAM
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
+#define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
+
+ int yystacksize = YYINITDEPTH;
+
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
+#endif
+#endif
+
+ YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+
+ int yylen;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss - 1;
+ yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
+
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
+
+ *++yyssp = yystate;
+
+ if (yyssp >= yyss + yystacksize - 1)
+ {
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
+ /* Get the current used size of the three stacks, in elements. */
+ int size = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
+#else /* no yyoverflow */
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ return 2;
+ }
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+ yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
+ yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
+#endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d\n", yystate);
+#endif
+
+ goto yybackup;
+ yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
+ }
+
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ goto yydefault;
+
+ yyn = yytable[yyn];
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+/* Do the default action for the current state. */
+yydefault:
+
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+
+/* Do a reduction. yyn is the number of a rule to reduce with. */
+yyreduce:
+ yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
+
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+
+
+ switch (yyn) {
+
+case 3:
+#line 47 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_name (yyvsp[-1].id, yyvsp[0].number); ;
+ break;}
+case 4:
+#line 48 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_library (yyvsp[-1].id, yyvsp[0].number); ;
+ break;}
+case 6:
+#line 50 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_description (yyvsp[0].id);;
+ break;}
+case 7:
+#line 51 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_stacksize (yyvsp[-1].number, yyvsp[0].number);;
+ break;}
+case 8:
+#line 52 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_heapsize (yyvsp[-1].number, yyvsp[0].number);;
+ break;}
+case 9:
+#line 53 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_code (yyvsp[0].number);;
+ break;}
+case 10:
+#line 54 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_data (yyvsp[0].number);;
+ break;}
+case 13:
+#line 57 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_version (yyvsp[0].number,0);;
+ break;}
+case 14:
+#line 58 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_version (yyvsp[-2].number,yyvsp[0].number);;
+ break;}
+case 18:
+#line 70 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_exports (yyvsp[-5].id, yyvsp[-4].id, yyvsp[-3].number, yyvsp[-2].number, yyvsp[-1].number, yyvsp[0].number);;
+ break;}
+case 21:
+#line 78 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_import (yyvsp[-4].id,yyvsp[-2].id,yyvsp[0].id);;
+ break;}
+case 22:
+#line 79 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_import (0, yyvsp[-2].id,yyvsp[0].id);;
+ break;}
+case 25:
+#line 87 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ def_section (yyvsp[-1].id,yyvsp[0].number);;
+ break;}
+case 30:
+#line 99 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number=yyvsp[0].number;;
+ break;}
+case 31:
+#line 100 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number=-1;;
+ break;}
+case 32:
+#line 104 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number = 1;;
+ break;}
+case 33:
+#line 105 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number = 2;;
+ break;}
+case 34:
+#line 106 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number=4;;
+ break;}
+case 35:
+#line 107 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number=8;;
+ break;}
+case 36:
+#line 111 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{yyval.number=1;;
+ break;}
+case 37:
+#line 112 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{yyval.number=0;;
+ break;}
+case 38:
+#line 116 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{yyval.number=1;;
+ break;}
+case 39:
+#line 117 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{yyval.number=0;;
+ break;}
+case 40:
+#line 121 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number = 1; ;
+ break;}
+case 41:
+#line 122 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number = 0; ;
+ break;}
+case 42:
+#line 125 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.id =yyvsp[0].id; ;
+ break;}
+case 43:
+#line 126 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.id=""; ;
+ break;}
+case 44:
+#line 130 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number=yyvsp[0].number;;
+ break;}
+case 45:
+#line 131 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number=-1;;
+ break;}
+case 46:
+#line 135 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.id = yyvsp[0].id; ;
+ break;}
+case 47:
+#line 136 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.id = 0; ;
+ break;}
+case 48:
+#line 139 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number= yyvsp[0].number;;
+ break;}
+case 49:
+#line 140 "/5g/ian/binutils/release/copy/binutils/defparse.y"
+{ yyval.number=-1;;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+#line 498 "/usr/cygnus/progressive-97r2/share/bison.simple"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
+
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTBASE];
+
+ goto yynewstate;
+
+yyerrlab: /* here on detecting error */
+
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
+ {
+ ++yynerrs;
+
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (yyn > YYFLAG && yyn < YYLAST)
+ {
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
+ {
+ strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
+ }
+ yyerror(msg);
+ free(msg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exceeded");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror("parse error");
+ }
+
+ goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
+
+ if (yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
+
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+yyerrdefault: /* current state does not do anything special for the error token. */
+
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
+
+yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+yyerrhandle:
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ yystate = yyn;
+ goto yynewstate;
+}
+#line 145 "/5g/ian/binutils/release/copy/binutils/defparse.y"
diff --git a/contrib/binutils/binutils/defparse.h b/contrib/binutils/binutils/defparse.h
new file mode 100644
index 0000000..fa35fb0
--- /dev/null
+++ b/contrib/binutils/binutils/defparse.h
@@ -0,0 +1,27 @@
+typedef union {
+ char *id;
+ int number;
+} YYSTYPE;
+#define NAME 258
+#define LIBRARY 259
+#define DESCRIPTION 260
+#define STACKSIZE 261
+#define HEAPSIZE 262
+#define CODE 263
+#define DATA 264
+#define SECTIONS 265
+#define EXPORTS 266
+#define IMPORTS 267
+#define VERSIONK 268
+#define BASE 269
+#define CONSTANT 270
+#define READ 271
+#define WRITE 272
+#define EXECUTE 273
+#define SHARED 274
+#define NONAME 275
+#define ID 276
+#define NUMBER 277
+
+
+extern YYSTYPE yylval;
diff --git a/contrib/binutils/binutils/defparse.y b/contrib/binutils/binutils/defparse.y
index 8a0f844..713b5d7 100644
--- a/contrib/binutils/binutils/defparse.y
+++ b/contrib/binutils/binutils/defparse.y
@@ -1,6 +1,6 @@
-/* defparse.y - parser for .def files */
+%{ /* defparse.y - parser for .def files */
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -18,6 +18,10 @@ 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 "bucomm.h"
+#include "dlltool.h"
+%}
%union {
char *id;
@@ -25,11 +29,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
};
%token NAME, LIBRARY, DESCRIPTION, STACKSIZE, HEAPSIZE, CODE, DATA
-%token SECTIONS, EXPORTS, IMPORTS, VERSION, BASE, CONSTANT
+%token SECTIONS, EXPORTS, IMPORTS, VERSIONK, BASE, CONSTANT
%token READ WRITE EXECUTE SHARED NONAME
%token <id> ID
%token <number> NUMBER
-%type <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT attr attr_list opt_number
+%type <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA
+%type <number> attr attr_list opt_number
%type <id> opt_name opt_equal_name
%%
@@ -49,19 +54,20 @@ command:
| DATA attr_list { def_data ($2);}
| SECTIONS seclist
| IMPORTS implist
- | VERSION NUMBER { def_version ($2,0);}
- | VERSION NUMBER '.' NUMBER { def_version ($2,$4);}
+ | VERSIONK NUMBER { def_version ($2,0);}
+ | VERSIONK NUMBER '.' NUMBER { def_version ($2,$4);}
;
explist:
- explist expline
+ /* EMPTY */
| expline
+ | explist expline
;
expline:
- ID opt_equal_name opt_ordinal opt_NONAME opt_CONSTANT
- { def_exports ($1, $2, $3, $4, $5);}
+ ID opt_equal_name opt_ordinal opt_NONAME opt_CONSTANT opt_DATA
+ { def_exports ($1, $2, $3, $4, $5, $6);}
;
implist:
implist impline
@@ -105,11 +111,17 @@ opt_CONSTANT:
CONSTANT {$$=1;}
| {$$=0;}
;
+
opt_NONAME:
NONAME {$$=1;}
| {$$=0;}
;
+opt_DATA:
+ DATA { $$ = 1; }
+ | { $$ = 0; }
+ ;
+
opt_name: ID { $$ =$1; }
| { $$=""; }
;
diff --git a/contrib/binutils/binutils/dep-in.sed b/contrib/binutils/binutils/dep-in.sed
index 278f253..f61921a 100644
--- a/contrib/binutils/binutils/dep-in.sed
+++ b/contrib/binutils/binutils/dep-in.sed
@@ -5,6 +5,7 @@
s!@INCDIR@!$(INCDIR)!g
s!@BFDDIR@!$(BFDDIR)!g
s!@SRCDIR@/!!g
+s!@OBJDIR@/!!g
s/\\\n */ /g
diff --git a/contrib/binutils/binutils/dlltool.c b/contrib/binutils/binutils/dlltool.c
index c5530bd..1253f9f 100644
--- a/contrib/binutils/binutils/dlltool.c
+++ b/contrib/binutils/binutils/dlltool.c
@@ -1,5 +1,5 @@
/* dlltool.c -- tool to generate stuff for PE style DLLs
- Copyright (C) 1995, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 96, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -15,7 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
/*
@@ -46,7 +47,7 @@
LIBRARY <name> [ , <base> ]
The result is going to be <name>.DLL
- EXPORTS ( <name1> [ = <name2> ] [ @ <integer> ] [ NONAME ] [CONSTANT] ) *
+ EXPORTS ( <name1> [ = <name2> ] [ @ <integer> ] [ NONAME ] [CONSTANT] [DATA] ) *
Declares name1 as an exported symbol from the
DLL, with optional ordinal number <integer>
@@ -201,7 +202,6 @@
*/
/* AIX requires this to be the first thing in the file. */
-/* AIX requires this to be the first thing in the file. */
#ifndef __GNUC__
# ifdef _AIX
#pragma alloca
@@ -217,10 +217,15 @@
#include "bucomm.h"
#include "getopt.h"
#include "demangle.h"
+#include "dlltool.h"
+
#include <ctype.h>
+#include <time.h>
+
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
-#else
+#else /* ! HAVE_SYS_WAIT_H */
+#if ! defined (_WIN32) || defined (__CYGWIN32__)
#ifndef WIFEXITED
#define WIFEXITED(w) (((w)&0377) == 0)
#endif
@@ -233,13 +238,23 @@
#ifndef WEXITSTATUS
#define WEXITSTATUS(w) (((w) >> 8) & 0377)
#endif
+#else /* defined (_WIN32) && ! defined (__CYGWIN32__) */
+#ifndef WIFEXITED
+#define WIFEXITED(w) (((w) & 0xff) == 0)
#endif
-
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
+#ifndef WIFSIGNALED
+#define WIFSIGNALED(w) (((w) & 0xff) != 0 && ((w) & 0xff) != 0x7f)
+#endif
+#ifndef WTERMSIG
+#define WTERMSIG(w) ((w) & 0x7f)
#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(w) (((w) & 0xff00) >> 8)
+#endif
+#endif /* defined (_WIN32) && ! defined (__CYGWIN32__) */
+#endif /* ! HAVE_SYS_WAIT_H */
-char *as_name = "as";
+static char *as_name = "as";
static int no_idata4;
static int no_idata5;
@@ -253,49 +268,50 @@ static int add_indirect = 0;
static int add_underscore = 0;
static int dontdeltemps = 0;
-int yyparse();
-int yydebug;
static char *def_file;
static char *program_name;
-char *strrchr ();
-char *strdup ();
static int machine;
-int killat;
+static int killat;
static int verbose;
-FILE *output_def;
-FILE *base_file;
+static FILE *output_def;
+static FILE *base_file;
#ifdef DLLTOOL_ARM
-static char *mname = "arm";
+static const char *mname = "arm";
#endif
#ifdef DLLTOOL_I386
-static char *mname = "i386";
+static const char *mname = "i386";
#endif
#ifdef DLLTOOL_PPC
-static char *mname = "ppc";
+static const char *mname = "ppc";
#endif
#define PATHMAX 250 /* What's the right name for this ? */
/* This bit of assemly does jmp * ....
s set how_jtab_roff to mark where the 32bit abs branch should go */
-unsigned char i386_jtab[] = { 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90};
-
+static const unsigned char i386_jtab[] =
+{
+ 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90
+};
-unsigned char arm_jtab[] = { 0x00, 0xc0, 0x9f, 0xe5,
- 0x00, 0xf0, 0x9c, 0xe5,
- 0, 0, 0, 0};
+static const unsigned char arm_jtab[] =
+{
+ 0x00, 0xc0, 0x9f, 0xe5,
+ 0x00, 0xf0, 0x9c, 0xe5,
+ 0, 0, 0, 0
+};
/* This is the glue sequence for PowerPC PE. There is a */
/* tocrel16-tocdefn reloc against the first instruction. */
/* We also need a IMGLUE reloc against the glue function */
/* to restore the toc saved by the third instruction in */
/* the glue. */
-unsigned char ppc_jtab[] =
+static const unsigned char ppc_jtab[] =
{
0x00, 0x00, 0x62, 0x81, /* lwz r11,0(r2) */
/* Reloc TOCREL16 __imp_xxx */
@@ -306,33 +322,35 @@ unsigned char ppc_jtab[] =
0x20, 0x04, 0x80, 0x4E /* bctr */
};
+#ifdef DLLTOOL_PPC
/* the glue instruction, picks up the toc from the stw in */
/* the above code: "lwz r2,4(r1)" */
-bfd_vma ppc_glue_insn = 0x80410004;
+static bfd_vma ppc_glue_insn = 0x80410004;
+#endif
+static char outfile[PATHMAX];
-char outfile[PATHMAX];
struct mac
{
- char *type;
- char *how_byte;
- char *how_short;
- char *how_long;
- char *how_asciz;
- char *how_comment;
- char *how_jump;
- char *how_global;
- char *how_space;
- char *how_align_short;
- char *how_align_long;
- char *how_bfd_target;
+ const char *type;
+ const char *how_byte;
+ const char *how_short;
+ const char *how_long;
+ const char *how_asciz;
+ const char *how_comment;
+ const char *how_jump;
+ const char *how_global;
+ const char *how_space;
+ const char *how_align_short;
+ const char *how_align_long;
+ const char *how_bfd_target;
enum bfd_architecture how_bfd_arch;
- unsigned char *how_jtab;
+ const unsigned char *how_jtab;
int how_jtab_size; /* size of the jtab entry */
int how_jtab_roff; /* offset into it for the ind 32 reloc into idata 5 */
- }
-mtable[]
-=
+ };
+
+static const struct mac mtable[] =
{
{
#define MARM 0
@@ -357,8 +375,56 @@ mtable[]
{ 0}
};
+typedef struct dlist
+{
+ char *text;
+ struct dlist *next;
+}
+dlist_type;
+
+typedef struct export
+ {
+ const char *name;
+ const char *internal_name;
+ int ordinal;
+ int constant;
+ int noname;
+ int data;
+ int hint;
+ struct export *next;
+ }
+export_type;
-char *
+static const char *rvaafter PARAMS ((int));
+static const char *rvabefore PARAMS ((int));
+static const char *asm_prefix PARAMS ((int));
+static void run PARAMS ((const char *, char *));
+static void basenames PARAMS ((bfd *));
+static void scan_open_obj_file PARAMS ((bfd *));
+static void scan_obj_file PARAMS ((const char *));
+static void dump_def_info PARAMS ((FILE *));
+static int sfunc PARAMS ((const void *, const void *));
+static void flush_page PARAMS ((FILE *, long *, int, int));
+static void gen_def_file PARAMS ((void));
+static void gen_exp_file PARAMS ((void));
+static const char *xlate PARAMS ((const char *));
+static void dump_iat PARAMS ((FILE *, export_type *));
+static char *make_label PARAMS ((const char *, const char *));
+static bfd *make_one_lib_file PARAMS ((export_type *, int));
+static bfd *make_head PARAMS ((void));
+static bfd *make_tail PARAMS ((void));
+static void gen_lib_file PARAMS ((void));
+static int pfunc PARAMS ((const void *, const void *));
+static int nfunc PARAMS ((const void *, const void *));
+static void remove_null_names PARAMS ((export_type **));
+static void dtab PARAMS ((export_type **));
+static void process_duplicates PARAMS ((export_type **));
+static void fill_ordinals PARAMS ((export_type **));
+static int alphafunc PARAMS ((const void *, const void *));
+static void mangle_defs PARAMS ((void));
+static void usage PARAMS ((FILE *, int));
+
+static const char *
rvaafter (machine)
int machine;
{
@@ -371,10 +437,10 @@ rvaafter (machine)
case MPPC:
return "";
}
-return "";
+ return "";
}
-char *
+static const char *
rvabefore (machine)
int machine;
{
@@ -387,12 +453,12 @@ rvabefore (machine)
case MPPC:
return ".rva\t";
}
-return "";
+ return "";
}
-char *
+static const char *
asm_prefix (machine)
-int machine;
+ int machine;
{
switch (machine)
{
@@ -403,8 +469,9 @@ int machine;
case MPPC:
return "";
}
-return "";
+ return "";
}
+
#define ASM_BYTE mtable[machine].how_byte
#define ASM_SHORT mtable[machine].how_short
#define ASM_LONG mtable[machine].how_long
@@ -425,12 +492,9 @@ return "";
#define HOW_JTAB_ROFF mtable[machine].how_jtab_roff
static char **oav;
-
-FILE *yyin; /* communications with flex */
-extern int linenumber;
void
process_def_file (name)
- char *name;
+ const char *name;
{
FILE *f = fopen (name, FOPEN_RT);
if (!f)
@@ -448,27 +512,7 @@ process_def_file (name)
/* Communications with the parser */
-
-typedef struct dlist
-{
- char *text;
- struct dlist *next;
-}
-dlist_type;
-
-typedef struct export
- {
- char *name;
- char *internal_name;
- int ordinal;
- int constant;
- int noname;
- int hint;
- struct export *next;
- }
-export_type;
-
-static char *d_name; /* Arg to NAME or LIBRARY */
+static const char *d_name; /* Arg to NAME or LIBRARY */
static int d_nfuncs; /* Number of functions exported */
static int d_named_nfuncs; /* Number of named functions exported */
static int d_low_ord; /* Lowest ordinal index */
@@ -482,7 +526,8 @@ static int d_is_dll;
static int d_is_exe;
int
-yyerror ()
+yyerror (err)
+ const char *err;
{
fprintf (stderr, "%s: Syntax error in def file %s:%d\n",
program_name, def_file, linenumber);
@@ -490,12 +535,13 @@ yyerror ()
}
void
-def_exports (name, internal_name, ordinal, noname, constant)
- char *name;
- char *internal_name;
+def_exports (name, internal_name, ordinal, noname, constant, data)
+ const char *name;
+ const char *internal_name;
int ordinal;
int noname;
int constant;
+ int data;
{
struct export *p = (struct export *) xmalloc (sizeof (*p));
@@ -504,15 +550,15 @@ def_exports (name, internal_name, ordinal, noname, constant)
p->ordinal = ordinal;
p->constant = constant;
p->noname = noname;
+ p->data = data;
p->next = d_exports;
d_exports = p;
d_nfuncs++;
}
-
void
def_name (name, base)
- char *name;
+ const char *name;
int base;
{
if (verbose)
@@ -527,7 +573,7 @@ def_name (name, base)
void
def_library (name, base)
- char *name;
+ const char *name;
int base;
{
if (verbose)
@@ -542,10 +588,10 @@ def_library (name, base)
void
def_description (desc)
- char *desc;
+ const char *desc;
{
dlist_type *d = (dlist_type *) xmalloc (sizeof (dlist_type));
- d->text = strdup (desc);
+ d->text = xstrdup (desc);
d->next = d_list;
d_list = d;
}
@@ -555,7 +601,7 @@ new_directive (dir)
char *dir;
{
dlist_type *d = (dlist_type *) xmalloc (sizeof (dlist_type));
- d->text = strdup (dir);
+ d->text = xstrdup (dir);
d->next = a_list;
a_list = d;
}
@@ -570,7 +616,7 @@ def_stacksize (reserve, commit)
sprintf (b, "-stack 0x%x,0x%x ", reserve, commit);
else
sprintf (b, "-stack 0x%x ", reserve);
- new_directive (strdup (b));
+ new_directive (xstrdup (b));
}
void
@@ -583,15 +629,14 @@ def_heapsize (reserve, commit)
sprintf (b, "-heap 0x%x,0x%x ", reserve, commit);
else
sprintf (b, "-heap 0x%x ", reserve);
- new_directive (strdup (b));
+ new_directive (xstrdup (b));
}
-
void
def_import (internal, module, entry)
- char *internal;
- char *module;
- char *entry;
+ const char *internal;
+ const char *module;
+ const char *entry;
{
if (verbose)
fprintf (stderr, "%s: IMPORTS are ignored", program_name);
@@ -599,16 +644,15 @@ def_import (internal, module, entry)
void
def_version (major, minor)
-int major;
-int minor;
+ int major;
+ int minor;
{
printf ("VERSION %d.%d\n", major, minor);
}
-
void
def_section (name, attr)
- char *name;
+ const char *name;
int attr;
{
char buf[200];
@@ -625,8 +669,9 @@ def_section (name, attr)
*d++ = 'S';
*d++ = 0;
sprintf (buf, "-attr %s %s", name, atts);
- new_directive (strdup (buf));
+ new_directive (xstrdup (buf));
}
+
void
def_code (attr)
int attr;
@@ -642,19 +687,20 @@ def_data (attr)
def_section ("DATA", attr);
}
-
/**********************************************************************/
-void
+static void
run (what, args)
- char *what;
+ const char *what;
char *args;
{
char *s;
- int pid;
+ int pid, wait_status;
int i;
- char **argv;
- extern char **environ;
+ const char **argv;
+ char *errmsg_fmt, *errmsg_arg;
+ char *temp_base = choose_temp_base ();
+
if (verbose)
fprintf (stderr, "%s %s\n", what, args);
@@ -677,44 +723,41 @@ run (what, args)
break;
*s++ = 0;
}
- argv[i++] = 0;
+ argv[i++] = NULL;
+ pid = pexecute (argv[0], (char * const *) argv, program_name, temp_base,
+ &errmsg_fmt, &errmsg_arg, PEXECUTE_ONE | PEXECUTE_SEARCH);
- pid = vfork ();
+ if (pid == -1)
+ {
+ int errno_val = errno;
- if (pid == 0)
+ fprintf (stderr, "%s: ", program_name);
+ fprintf (stderr, errmsg_fmt, errmsg_arg);
+ fprintf (stderr, ": %s\n", strerror (errno_val));
+ exit (1);
+ }
+
+ pid = pwait (pid, &wait_status, 0);
+ if (pid == -1)
{
- execvp (what, argv);
- fprintf (stderr, "%s: can't exec %s\n", program_name, what);
+ fprintf (stderr, "%s: wait: %s\n", program_name, strerror (errno));
exit (1);
}
- else if (pid == -1)
+ else if (WIFSIGNALED (wait_status))
{
- extern int errno;
- fprintf (stderr, "%s: vfork failed, %d\n", program_name, errno);
+ fprintf (stderr, "%s: subprocess got fatal signal %d\n",
+ program_name, WTERMSIG (wait_status));
exit (1);
}
- else
+ else if (WIFEXITED (wait_status))
{
- int status;
- waitpid (pid, &status, 0);
- if (status)
- {
- if (WIFSIGNALED (status))
- {
- fprintf (stderr, "%s: %s %s terminated with signal %d\n",
- program_name, what, args, WTERMSIG (status));
- exit (1);
- }
-
- if (WIFEXITED (status))
- {
- fprintf (stderr, "%s: %s %s terminated with exit status %d\n",
- program_name, what, args, WEXITSTATUS (status));
- exit (1);
- }
- }
+ if (WEXITSTATUS (wait_status) != 0)
+ fprintf (stderr, "%s: %s exited with status %d\n",
+ program_name, what, WEXITSTATUS (wait_status));
}
+ else
+ abort ();
}
/* read in and block out the base relocations */
@@ -722,13 +765,9 @@ static void
basenames (abfd)
bfd *abfd;
{
-
-
-
-
}
-void
+static void
scan_open_obj_file (abfd)
bfd *abfd;
{
@@ -766,7 +805,7 @@ scan_open_obj_file (abfd)
/* FIXME: The 5th arg is for the `constant' field.
What should it be? Not that it matters since it's not
currently useful. */
- def_exports (c, 0, -1, 0, 0);
+ def_exports (c, 0, -1, 0, 0, 0);
}
else
p++;
@@ -781,10 +820,9 @@ scan_open_obj_file (abfd)
program_name);
}
-
-void
+static void
scan_obj_file (filename)
- char *filename;
+ const char *filename;
{
bfd *f = bfd_openr (filename, 0);
@@ -816,9 +854,7 @@ scan_obj_file (filename)
/**********************************************************************/
-
-
-void
+static void
dump_def_info (f)
FILE *f;
{
@@ -830,32 +866,32 @@ dump_def_info (f)
fprintf (f, "\n");
for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
{
- fprintf (f, "%s %d = %s %s @ %d %s%s\n",
+ fprintf (f, "%s %d = %s %s @ %d %s%s%s\n",
ASM_C,
i,
exp->name,
exp->internal_name,
exp->ordinal,
exp->noname ? "NONAME " : "",
- exp->constant ? "CONSTANT" : "");
+ exp->constant ? "CONSTANT" : "",
+ exp->data ? "DATA" : "");
}
}
+
/* Generate the .exp file */
-int
+static int
sfunc (a, b)
- long *a;
- long *b;
+ const void *a;
+ const void *b;
{
- return *a - *b;
+ return *(const long *) a - *(const long *) b;
}
-
-
static void
flush_page (f, need, page_addr, on_page)
FILE *f;
- int *need;
+ long *need;
int page_addr;
int on_page;
{
@@ -872,16 +908,14 @@ flush_page (f, need, page_addr, on_page)
ASM_C);
for (i = 0; i < on_page; i++)
{
- fprintf (f, "\t%s\t0x%x\n", ASM_SHORT, (need[i] - page_addr) | 0x3000);
+ fprintf (f, "\t%s\t0x%lx\n", ASM_SHORT, (need[i] - page_addr) | 0x3000);
}
/* And padding */
if (on_page & 1)
fprintf (f, "\t%s\t0x%x\n", ASM_SHORT, 0 | 0x0000);
-
}
-
-void
+static void
gen_def_file ()
{
int i;
@@ -896,16 +930,18 @@ gen_def_file ()
for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
{
char *quote = strchr (exp->name, '.') ? "\"" : "";
- fprintf (output_def, "\t%s%s%s @ %d%s ; %s\n",
+ fprintf (output_def, "\t%s%s%s @ %d%s%s ; %s\n",
quote,
exp->name,
quote,
exp->ordinal,
exp->noname ? " NONAME" : "",
+ exp->data ? " DATA" : "",
cplus_demangle (exp->internal_name, DMGL_ANSI | DMGL_PARAMS));
}
}
-void
+
+static void
gen_exp_file ()
{
FILE *f;
@@ -937,7 +973,8 @@ gen_exp_file ()
{
fprintf (f, "\t.section .edata\n\n");
fprintf (f, "\t%s 0 %s Allways 0\n", ASM_LONG, ASM_C);
- fprintf (f, "\t%s 0x%x %s Time and date\n", ASM_LONG, time(0),ASM_C);
+ fprintf (f, "\t%s 0x%lx %s Time and date\n", ASM_LONG, (long) time(0),
+ ASM_C);
fprintf (f, "\t%s 0 %s Major and Minor version\n", ASM_LONG, ASM_C);
fprintf (f, "\t%sname%s %s Ptr to name of dll\n", ASM_RVA_BEFORE, ASM_RVA_AFTER, ASM_C);
fprintf (f, "\t%s %d %s Starting ordinal of exports\n", ASM_LONG, d_low_ord, ASM_C);
@@ -1060,8 +1097,13 @@ gen_exp_file ()
for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
if (!exp->noname || show_allnames)
{
+ /* We use a single underscore for MS compatibility, and a
+ double underscore for backward compatibility with old
+ cygwin releases. */
fprintf (f, "\t%s\t__imp_%s\n", ASM_GLOBAL, exp->name);
+ fprintf (f, "\t%s\t_imp__%s\n", ASM_GLOBAL, exp->name);
fprintf (f, "__imp_%s:\n", exp->name);
+ fprintf (f, "_imp__%s:\n", exp->name);
fprintf (f, "\t%s\t%s\n", ASM_LONG, exp->name);
}
}
@@ -1091,7 +1133,6 @@ gen_exp_file ()
fprintf (f, "\t.section\t.reloc\n");
if (num_entries)
{
-
int src;
int dst = 0;
int last = -1;
@@ -1135,8 +1176,9 @@ gen_exp_file ()
}
}
-static char *
-xlate (char *name)
+static const char *
+xlate (name)
+ const char *name;
{
if (add_underscore)
{
@@ -1158,9 +1200,10 @@ xlate (char *name)
/**********************************************************************/
-static void dump_iat (f, exp)
-FILE *f;
-export_type *exp;
+static void
+dump_iat (f, exp)
+ FILE *f;
+ export_type *exp;
{
if (exp->noname && !show_allnames )
{
@@ -1176,8 +1219,6 @@ export_type *exp;
}
}
-
-
typedef struct
{
int id;
@@ -1191,7 +1232,6 @@ typedef struct
unsigned char *data;
} sinfo;
-
#ifndef DLLTOOL_PPC
#define TEXT 0
@@ -1201,12 +1241,9 @@ typedef struct
#define IDATA5 4
#define IDATA4 5
#define IDATA6 6
-#define PDATA 7
-#define RDATA 8
#define NSECS 7
-
static sinfo secdata[NSECS] =
{
{ TEXT, ".text", SEC_CODE | SEC_HAS_CONTENTS, 2},
@@ -1250,7 +1287,8 @@ static sinfo secdata[NSECS] =
#endif
/*
-This is what we're trying to make
+This is what we're trying to make. We generate the imp symbols with
+both single and double underscores, for compatibility.
.text
.global _GetFileVersionInfoSizeW@8
@@ -1314,6 +1352,7 @@ make_one_lib_file (exp, i)
fprintf (f, "\t.text\n");
fprintf (f, "\t%s\t%s%s\n", ASM_GLOBAL, ASM_PREFIX, exp->name);
fprintf (f, "\t%s\t__imp_%s\n", ASM_GLOBAL, exp->name);
+ fprintf (f, "\t%s\t_imp__%s\n", ASM_GLOBAL, exp->name);
fprintf (f, "%s%s:\n\t%s\t__imp_%s\n", ASM_PREFIX,
exp->name, ASM_JUMP, exp->name);
@@ -1325,6 +1364,7 @@ make_one_lib_file (exp, i)
fprintf (f, "\t.section .idata$5\n");
fprintf (f, "__imp_%s:\n", exp->name);
+ fprintf (f, "_imp__%s:\n", exp->name);
dump_iat (f, exp);
@@ -1355,7 +1395,7 @@ make_one_lib_file (exp, i)
bfd *abfd;
asymbol *exp_label;
- asymbol *iname;
+ asymbol *iname, *iname2;
asymbol *iname_lab;
asymbol **iname_lab_pp;
asymbol **iname_pp;
@@ -1367,13 +1407,12 @@ make_one_lib_file (exp, i)
#define EXTRA 0
#endif
- asymbol *function_name; /* ".." functionName */
+#ifdef DLLTOOL_PPC
asymbol **fn_pp;
- asymbol *toc_symbol; /* The .toc symbol */
asymbol **toc_pp;
+#endif
- /* one symbol for each section, 2 extra + a null */
- asymbol *ptrs[NSECS+3+EXTRA+1];
+ asymbol *ptrs[NSECS + 4 + EXTRA + 1];
char *outname = xmalloc (10);
int oidx = 0;
@@ -1410,33 +1449,48 @@ make_one_lib_file (exp, i)
si->sym->value = 0;
ptrs[oidx] = si->sym;
si->sympp = ptrs + oidx;
+ si->size = 0;
+ si->data = NULL;
oidx++;
}
- exp_label = bfd_make_empty_symbol(abfd);
- exp_label->name = make_label ("",exp->name);
+ if (! exp->data)
+ {
+ exp_label = bfd_make_empty_symbol (abfd);
+ exp_label->name = make_label ("", exp->name);
- /* On PowerPC, the function name points to a descriptor in the
- rdata section, the first element of which is a pointer to the
- code (..function_name), and the second points to the .toc
- */
- if (machine == MPPC)
- exp_label->section = secdata[RDATA].sec;
- else
- exp_label->section = secdata[TEXT].sec;
+ /* On PowerPC, the function name points to a descriptor in
+ the rdata section, the first element of which is a
+ pointer to the code (..function_name), and the second
+ points to the .toc */
+#ifdef DLLTOOL_PPC
+ if (machine == MPPC)
+ exp_label->section = secdata[RDATA].sec;
+ else
+#endif
+ exp_label->section = secdata[TEXT].sec;
- exp_label->flags = BSF_GLOBAL;
- exp_label->value = 0;
+ exp_label->flags = BSF_GLOBAL;
+ exp_label->value = 0;
- ptrs[oidx++] = exp_label;
+ ptrs[oidx++] = exp_label;
+ }
+ /* Generate imp symbols with one underscore for Microsoft
+ compatibility, and with two underscores for backward
+ compatibility with old versions of cygwin. */
iname = bfd_make_empty_symbol(abfd);
iname->name = make_label ("__imp_", exp->name);
iname->section = secdata[IDATA5].sec;
iname->flags = BSF_GLOBAL;
iname->value = 0;
+ iname2 = bfd_make_empty_symbol(abfd);
+ iname2->name = make_label ("_imp__", exp->name);
+ iname2->section = secdata[IDATA5].sec;
+ iname2->flags = BSF_GLOBAL;
+ iname2->value = 0;
iname_lab = bfd_make_empty_symbol(abfd);
@@ -1448,30 +1502,39 @@ make_one_lib_file (exp, i)
iname_pp = ptrs + oidx;
ptrs[oidx++] = iname;
+ ptrs[oidx++] = iname2;
iname_lab_pp = ptrs + oidx;
ptrs[oidx++] = iname_lab;
#ifdef DLLTOOL_PPC
/* The symbol refering to the code (.text) */
- function_name = bfd_make_empty_symbol(abfd);
- function_name->name = make_label ("..", exp->name);
- function_name->section = secdata[TEXT].sec;
- function_name->flags = BSF_GLOBAL;
- function_name->value = 0;
+ {
+ asymbol *function_name;
- fn_pp = ptrs + oidx;
- ptrs[oidx++] = function_name;
+ function_name = bfd_make_empty_symbol(abfd);
+ function_name->name = make_label ("..", exp->name);
+ function_name->section = secdata[TEXT].sec;
+ function_name->flags = BSF_GLOBAL;
+ function_name->value = 0;
+
+ fn_pp = ptrs + oidx;
+ ptrs[oidx++] = function_name;
+ }
/* The .toc symbol */
- toc_symbol = bfd_make_empty_symbol(abfd);
- toc_symbol->name = make_label (".", "toc");
- toc_symbol->section = (asection *)&bfd_und_section;
- toc_symbol->flags = BSF_GLOBAL;
- toc_symbol->value = 0;
-
- toc_pp = ptrs + oidx;
- ptrs[oidx++] = toc_symbol;
+ {
+ asymbol *toc_symbol; /* The .toc symbol */
+
+ toc_symbol = bfd_make_empty_symbol(abfd);
+ toc_symbol->name = make_label (".", "toc");
+ toc_symbol->section = (asection *)&bfd_und_section;
+ toc_symbol->flags = BSF_GLOBAL;
+ toc_symbol->value = 0;
+
+ toc_pp = ptrs + oidx;
+ ptrs[oidx++] = toc_symbol;
+ }
#endif
ptrs[oidx] = 0;
@@ -1486,31 +1549,34 @@ make_one_lib_file (exp, i)
switch (i)
{
case TEXT:
- si->size = HOW_JTAB_SIZE;
- si->data = xmalloc (HOW_JTAB_SIZE);
- memcpy (si->data, HOW_JTAB, HOW_JTAB_SIZE);
+ if (! exp->data)
+ {
+ si->size = HOW_JTAB_SIZE;
+ si->data = xmalloc (HOW_JTAB_SIZE);
+ memcpy (si->data, HOW_JTAB, HOW_JTAB_SIZE);
- /* add the reloc into idata$5 */
- rel = xmalloc (sizeof (arelent));
- rpp = xmalloc (sizeof (arelent *) * 2);
- rpp[0] = rel;
- rpp[1] = 0;
- rel->address = HOW_JTAB_ROFF;
- rel->addend = 0;
+ /* add the reloqc into idata$5 */
+ rel = xmalloc (sizeof (arelent));
+ rpp = xmalloc (sizeof (arelent *) * 2);
+ rpp[0] = rel;
+ rpp[1] = 0;
+ rel->address = HOW_JTAB_ROFF;
+ rel->addend = 0;
- if (machine == MPPC)
- {
- rel->howto = bfd_reloc_type_lookup (abfd,
- BFD_RELOC_16_GOTOFF);
- rel->sym_ptr_ptr = iname_pp;
- }
- else
- {
- rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32);
- rel->sym_ptr_ptr = secdata[IDATA5].sympp;
+ if (machine == MPPC)
+ {
+ rel->howto = bfd_reloc_type_lookup (abfd,
+ BFD_RELOC_16_GOTOFF);
+ rel->sym_ptr_ptr = iname_pp;
+ }
+ else
+ {
+ rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32);
+ rel->sym_ptr_ptr = secdata[IDATA5].sympp;
+ }
+ sec->orelocation = rpp;
+ sec->reloc_count = 1;
}
- sec->orelocation = rpp;
- sec->reloc_count = 1;
break;
case IDATA4:
case IDATA5:
@@ -1547,7 +1613,10 @@ make_one_lib_file (exp, i)
case IDATA6:
if (!exp->noname)
{
- int idx = exp->hint + 1;
+ /* This used to add 1 to exp->hint. I don't know
+ why it did that, and it does not match what I see
+ in programs compiled with the MS tools. */
+ int idx = exp->hint;
si->size = strlen (xlate (exp->name)) + 3;
si->data = xmalloc (si->size);
si->data[0] = idx & 0xff;
@@ -1570,6 +1639,7 @@ make_one_lib_file (exp, i)
sec->reloc_count = 1;
break;
+#ifdef DLLTOOL_PPC
case PDATA:
{
/* The .pdata section is 5 words long. */
@@ -1655,7 +1725,7 @@ make_one_lib_file (exp, i)
*/
si->size = 8;
- si->data =xmalloc(8);
+ si->data = xmalloc (8);
memset (si->data, 0, si->size);
rpp = xmalloc (sizeof (arelent *) * 3);
@@ -1678,6 +1748,7 @@ make_one_lib_file (exp, i)
sec->orelocation = rpp;
sec->reloc_count = 2;
break;
+#endif /* DLLTOOL_PPC */
}
}
@@ -1718,9 +1789,8 @@ make_one_lib_file (exp, i)
}
-
static bfd *
-make_head()
+make_head ()
{
FILE * f = fopen ("dh.s", FOPEN_WT);
@@ -1772,7 +1842,7 @@ make_head()
}
static bfd *
-make_tail()
+make_tail ()
{
FILE * f = fopen ("dt.s", FOPEN_WT);
@@ -1866,8 +1936,17 @@ gen_lib_file ()
ar_tail->next = ar_head;
head = ar_tail;
- bfd_set_archive_head (outarch, head);
- bfd_close (outarch);
+ if (! bfd_set_archive_head (outarch, head))
+ bfd_fatal ("bfd_set_archive_head");
+ if (! bfd_close (outarch))
+ bfd_fatal (imp_name);
+
+ while (head != NULL)
+ {
+ bfd *n = head->next;
+ bfd_close (head);
+ head = n;
+ }
/* Delete all the temp files */
@@ -1884,21 +1963,25 @@ gen_lib_file ()
}
if (dontdeltemps < 2)
- for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
- {
- sprintf (outfile, "ds%d.o",i);
- unlink (outfile);
- }
-
+ {
+ for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
+ {
+ sprintf (outfile, "ds%d.o",i);
+ if (unlink (outfile) < 0)
+ fprintf (stderr, "%s: cannot delete %s: %s\n", program_name,
+ outfile, strerror (errno));
+ }
+ }
}
+
/**********************************************************************/
/* Run through the information gathered from the .o files and the
.def file and work out the best stuff */
-int
+static int
pfunc (a, b)
- void *a;
- void *b;
+ const void *a;
+ const void *b;
{
export_type *ap = *(export_type **) a;
export_type *bp = *(export_type **) b;
@@ -1913,11 +1996,10 @@ pfunc (a, b)
return (ap->ordinal - bp->ordinal);
}
-
-int
+static int
nfunc (a, b)
- void *a;
- void *b;
+ const void *a;
+ const void *b;
{
export_type *ap = *(export_type **) a;
export_type *bp = *(export_type **) b;
@@ -1925,8 +2007,7 @@ nfunc (a, b)
return (strcmp (ap->name, bp->name));
}
-static
-void
+static void
remove_null_names (ptr)
export_type **ptr;
{
@@ -1953,10 +2034,11 @@ dtab (ptr)
{
if (ptr[i])
{
- printf ("%d %s @ %d %s%s\n",
+ printf ("%d %s @ %d %s%s%s\n",
i, ptr[i]->name, ptr[i]->ordinal,
ptr[i]->noname ? "NONAME " : "",
- ptr[i]->constant ? "CONSTANT" : "");
+ ptr[i]->constant ? "CONSTANT" : "",
+ ptr[i]->data ? "DATA" : "");
}
else
printf ("empty\n");
@@ -2005,6 +2087,7 @@ process_duplicates (d_export_vec)
b->ordinal = a->ordinal > 0 ? a->ordinal : b->ordinal;
b->constant |= a->constant;
b->noname |= a->noname;
+ b->data |= a->data;
d_export_vec[i] = 0;
}
@@ -2101,17 +2184,18 @@ fill_ordinals (d_export_vec)
}
}
-int alphafunc(av,bv)
-void *av;
-void *bv;
+static int
+alphafunc (av,bv)
+ const void *av;
+ const void *bv;
{
- export_type **a = av;
- export_type **b = bv;
+ const export_type **a = (const export_type **) av;
+ const export_type **b = (const export_type **) bv;
return strcmp ((*a)->name, (*b)->name);
}
-void
+static void
mangle_defs ()
{
/* First work out the minimum ordinal chosen */
@@ -2160,14 +2244,9 @@ mangle_defs ()
}
-
-
-
-
-
/**********************************************************************/
-void
+static void
usage (file, status)
FILE *file;
int status;
@@ -2193,7 +2272,7 @@ usage (file, status)
#define OPTION_NO_IDATA4 'x'
#define OPTION_NO_IDATA5 'c'
-static struct option long_options[] =
+static const struct option long_options[] =
{
{"nodelete", no_argument, NULL, 'n'},
{"dllname", required_argument, NULL, 'D'},
@@ -2213,8 +2292,6 @@ static struct option long_options[] =
{0}
};
-
-
int
main (ac, av)
int ac;
@@ -2270,7 +2347,11 @@ main (ac, av)
verbose = 1;
break;
case 'y':
+#if 0
+ /* We don't currently define YYDEBUG when building
+ defparse.y. */
yydebug = 1;
+#endif
break;
case 'U':
add_underscore = 1;
@@ -2342,8 +2423,9 @@ main (ac, av)
{
/* Make imp_name safe for use as a label. */
char *p;
- imp_name_lab = strdup (imp_name);
- for (p = imp_name_lab; *p; *p++)
+
+ imp_name_lab = xstrdup (imp_name);
+ for (p = imp_name_lab; *p; p++)
{
if (!isalpha (*p) && !isdigit (*p))
*p = '_';
diff --git a/contrib/binutils/binutils/dlltool.h b/contrib/binutils/binutils/dlltool.h
new file mode 100644
index 0000000..d9c7abe
--- /dev/null
+++ b/contrib/binutils/binutils/dlltool.h
@@ -0,0 +1,41 @@
+/* dlltool.h -- header file for dlltool
+ Copyright (C) 1997 Free Software Foundation, Inc.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "ansidecl.h"
+#include <stdio.h>
+
+extern void def_code PARAMS ((int));
+extern void def_data PARAMS ((int));
+extern void def_description PARAMS ((const char *));
+extern void def_exports
+ PARAMS ((const char *, const char *, int, int, int, int));
+extern void def_heapsize PARAMS ((int, int));
+extern void def_import PARAMS ((const char *, const char *, const char *));
+extern void def_library PARAMS ((const char *, int));
+extern void def_name PARAMS ((const char *, int));
+extern void def_section PARAMS ((const char *, int));
+extern void def_stacksize PARAMS ((int, int));
+extern void def_version PARAMS ((int, int));
+extern int yyparse PARAMS ((void));
+extern int yyerror PARAMS ((const char *));
+extern int yydebug;
+extern int yylex PARAMS ((void));
+extern FILE *yyin;
+extern int linenumber;
diff --git a/contrib/binutils/binutils/objcopy.1 b/contrib/binutils/binutils/objcopy.1
index d3b8bb3..6c98df8 100644
--- a/contrib/binutils/binutils/objcopy.1
+++ b/contrib/binutils/binutils/objcopy.1
@@ -24,6 +24,8 @@ objcopy \- copy and translate object files
.RB "[\|" \-\-strip\-unneeded\fR "\|]"
.RB "[\|" \-K\ \fIsymbolname\fR\ |\ \fB\-\-keep\-symbol=\fIsymbolname\fR "\|]"
.RB "[\|" \-N\ \fIsymbolname\fR\ |\ \fB\-\-strip\-symbol=\fIsymbolname\fR "\|]"
+.RB "[\|" \-L\ \fIsymbolname\fR\ |\ \fB\-\-localize\-symbol=\fIsymbolname\fR "\|]"
+.RB "[\|" \-W\ \fIsymbolname\fR\ |\ \fB\-\-weaken\-symbol=\fIsymbolname\fR "\|]"
.RB "[\|" \-x\fR\ |\ \fB\-\-discard\-all\fR "\|]"
.RB "[\|" \-X\fR\ |\ \fB\-\-discard\-locals\fR "\|]"
.RB "[\|" \-b\ \fIbyte\fR\ |\ \fB\-\-byte=\fIbyte\fR "\|]"
@@ -139,8 +141,14 @@ may be given more than once.
.TP
.B \-N \fIsymbolname\fR, \fB\-\-strip\-symbol=\fIsymbolname
Do not copy symbol \fIsymbolname\fP from the source file. This option
-may be given more than once, and may be combined with strip options
-other than \fB\-K\fR.
+may be given more than once.
+.TP
+.B \-L \fIsymbolname\fR, \fB\-\-localize\-symbol=\fIsymbolname
+Make symbol \fIsymbolname\fP local to the file, so that it is not
+visible externally. This option may be given more than once.
+.TP
+.B \-W \fIsymbolname\fR, \fB\-\-weaken\-symbol=\fIsymbolname
+Make symbol \fIsymbolname\fP weak. This option may be given more than once.
.TP
.B \-x\fR, \fB \-\-discard\-all
Do not copy non-global symbols from the source file.
@@ -170,12 +178,13 @@ because only certain debugging formats are supported, and the
conversion process can be time consuming.
.TP
.B \-\-gap\-fill=\fIval
-Fill gaps between sections with \fIval\fP. This is done by increasing
+Fill gaps between sections with \fIval\fP. This operation applies to
+the \fIload address\fP (LMA) of the sections. It is done by increasing
the size of the section with the lower address, and filling in the extra
space created with \fIval\fP.
.TP
.B \-\-pad\-to=\fIaddress
-Pad the output file up to the virtual address \fIaddress\fP. This is
+Pad the output file up to the load address \fIaddress\fP. This is
done by increasing the size of the last section. The extra space is
filled in with the value specified by \fB\-\-gap\-fill\fP (default
zero).
diff --git a/contrib/binutils/binutils/objcopy.c b/contrib/binutils/binutils/objcopy.c
index 8f24e49..f054bb9 100644
--- a/contrib/binutils/binutils/objcopy.c
+++ b/contrib/binutils/binutils/objcopy.c
@@ -1,5 +1,6 @@
/* objcopy.c -- copy object file from input to output, optionally massaging it.
- Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -15,7 +16,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include "bfd.h"
#include "progress.h"
@@ -33,6 +35,17 @@
#endif /* HAVE_UTIMES */
#endif /* ! HAVE_GOOD_UTIME_H */
+/* A list of symbols to explicitly strip out, or to keep. A linked
+ list is good enough for a small number from the command line, but
+ this will slow things down a lot if many symbols are being
+ deleted. */
+
+struct symlist
+{
+ const char *name;
+ struct symlist *next;
+};
+
static void copy_usage PARAMS ((FILE *, int));
static void strip_usage PARAMS ((FILE *, int));
static flagword parse_flags PARAMS ((const char *));
@@ -40,9 +53,9 @@ static struct section_list *find_section_list PARAMS ((const char *, boolean));
static void setup_section PARAMS ((bfd *, asection *, PTR));
static void copy_section PARAMS ((bfd *, asection *, PTR));
static void get_sections PARAMS ((bfd *, asection *, PTR));
-static int compare_section_vma PARAMS ((const PTR, const PTR));
-static void add_strip_symbol PARAMS ((const char *));
-static boolean is_strip_symbol PARAMS ((const char *));
+static int compare_section_lma PARAMS ((const PTR, const PTR));
+static void add_specific_symbol PARAMS ((const char *, struct symlist **));
+static boolean is_specified_symbol PARAMS ((const char *, struct symlist *));
static boolean is_strip_section PARAMS ((bfd *, asection *));
static unsigned int filter_symbols
PARAMS ((bfd *, bfd *, asymbol **, asymbol **, long));
@@ -55,7 +68,7 @@ static void copy_file
PARAMS ((const char *, const char *, const char *, const char *));
static int simple_copy PARAMS ((const char *, const char *));
static int smart_rename PARAMS ((const char *, const char *));
-static void make_same_dates PARAMS ((const char *, const char *));
+static void set_times PARAMS ((const char *, const struct stat *));
static int strip_main PARAMS ((int, char **));
static int copy_main PARAMS ((int, char **));
@@ -166,6 +179,17 @@ static boolean change_leading_char = false;
static boolean remove_leading_char = false;
+/* List of symbols to strip, keep, localize, and weaken. */
+
+static struct symlist *strip_specific_list = NULL;
+static struct symlist *keep_specific_list = NULL;
+static struct symlist *localize_specific_list = NULL;
+static struct symlist *weaken_specific_list = NULL;
+
+/* If this is true, we weaken global symbols (set BSF_WEAK). */
+
+static boolean weaken = false;
+
/* 150 isn't special; it's just an arbitrary non-ASCII char value. */
#define OPTION_ADD_SECTION 150
@@ -235,6 +259,7 @@ static struct option copy_options[] =
{"output-target", required_argument, 0, 'O'},
{"pad-to", required_argument, 0, OPTION_PAD_TO},
{"preserve-dates", no_argument, 0, 'p'},
+ {"localize-symbol", required_argument, 0, 'L'},
{"remove-leading-char", no_argument, 0, OPTION_REMOVE_LEADING_CHAR},
{"remove-section", required_argument, 0, 'R'},
{"set-section-flags", required_argument, 0, OPTION_SET_SECTION_FLAGS},
@@ -247,6 +272,7 @@ static struct option copy_options[] =
{"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, 'V'},
{"weaken", no_argument, 0, OPTION_WEAKEN},
+ {"weaken-symbol", required_argument, 0, 'W'},
{0, no_argument, 0, 0}
};
@@ -278,11 +304,12 @@ Usage: %s [-vVSpgxX] [-I bfdname] [-O bfdname] [-F bfdname] [-b byte]\n\
[--adjust-warnings] [--no-adjust-warnings]\n\
[--set-section-flags=section=flags] [--add-section=sectionname=filename]\n\
[--keep-symbol symbol] [-K symbol] [--strip-symbol symbol] [-N symbol]\n\
- [--change-leading-char] [--remove-leading-char] [--weaken] [--verbose]\n\
- [--version] [--help] in-file [out-file]\n");
+ [--localize-symbol symbol] [-L symbol] [--weaken-symbol symbol]\n\
+ [-W symbol] [--change-leading-char] [--remove-leading-char] [--weaken]\n\
+ [--verbose] [--version] [--help] in-file [out-file]\n");
list_supported_targets (program_name, stream);
if (exit_status == 0)
- fprintf (stream, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
exit (exit_status);
}
@@ -301,7 +328,7 @@ Usage: %s [-vVsSpgxX] [-I bfdname] [-O bfdname] [-F bfdname] [-R section]\n\
program_name);
list_supported_targets (program_name, stream);
if (exit_status == 0)
- fprintf (stream, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
exit (exit_status);
}
@@ -329,14 +356,31 @@ parse_flags (s)
++snext;
}
-#define PARSE_FLAG(fname,fval) if (strncmp (fname, s, len) == 0) ret |= fval;
+ if (0) ;
+#define PARSE_FLAG(fname,fval) \
+ else if (strncasecmp (fname, s, len) == 0) ret |= fval
PARSE_FLAG ("alloc", SEC_ALLOC);
PARSE_FLAG ("load", SEC_LOAD);
PARSE_FLAG ("readonly", SEC_READONLY);
PARSE_FLAG ("code", SEC_CODE);
PARSE_FLAG ("data", SEC_DATA);
PARSE_FLAG ("rom", SEC_ROM);
+ PARSE_FLAG ("contents", SEC_HAS_CONTENTS);
#undef PARSE_FLAG
+ else
+ {
+ char *copy;
+
+ copy = xmalloc (len + 1);
+ strncpy (copy, s, len);
+ copy[len] = '\0';
+ fprintf (stderr, "%s: unrecognized section flag `%s'\n",
+ program_name, copy);
+ fprintf (stderr,
+ "%s: supported flags: alloc, load, readonly, code, data, rom, contents\n",
+ program_name);
+ exit (1);
+ }
s = snext;
}
@@ -376,59 +420,37 @@ find_section_list (name, add)
return p;
}
-/* Make a list of symbols to explicitly strip out, or to keep. A
- linked list is good enough for a small number from the command
- line, but this will slow things down a lot if many symbols are
- being deleted. */
-
-struct symlist
-{
- const char *name;
- struct symlist *next;
-};
-
-/* List of symbols to strip. */
-
-static struct symlist *strip_specific_list = NULL;
-
-/* If this is false, we strip the symbols in strip_specific_list.
- Otherwise, we keep only the symbols in the list. */
-
-static boolean keep_symbols = false;
-
-/* If this is true, we weaken global symbols (set BSF_WEAK). */
-
-static boolean weaken = false;
-
/* Add a symbol to strip_specific_list. */
static void
-add_strip_symbol (name)
+add_specific_symbol (name, list)
const char *name;
+ struct symlist **list;
{
struct symlist *tmp_list;
tmp_list = (struct symlist *) xmalloc (sizeof (struct symlist));
tmp_list->name = name;
- tmp_list->next = strip_specific_list;
- strip_specific_list = tmp_list;
+ tmp_list->next = *list;
+ *list = tmp_list;
}
/* See whether a symbol should be stripped or kept based on
strip_specific_list and keep_symbols. */
static boolean
-is_strip_symbol (name)
+is_specified_symbol (name, list)
const char *name;
+ struct symlist *list;
{
struct symlist *tmp_list;
- for (tmp_list = strip_specific_list; tmp_list; tmp_list = tmp_list->next)
+ for (tmp_list = list; tmp_list; tmp_list = tmp_list->next)
{
if (strcmp (name, tmp_list->name) == 0)
- return keep_symbols ? false : true;
+ return true;
}
- return keep_symbols;
+ return false;
}
/* See if a section is being removed. */
@@ -472,28 +494,28 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
{
asymbol *sym = from[src_count];
flagword flags = sym->flags;
+ const char *name = bfd_asymbol_name (sym);
int keep;
if (change_leading_char
&& (bfd_get_symbol_leading_char (abfd)
!= bfd_get_symbol_leading_char (obfd))
&& (bfd_get_symbol_leading_char (abfd) == '\0'
- || (bfd_asymbol_name (sym)[0]
- == bfd_get_symbol_leading_char (abfd))))
+ || (name[0] == bfd_get_symbol_leading_char (abfd))))
{
if (bfd_get_symbol_leading_char (obfd) == '\0')
- bfd_asymbol_name (sym) = bfd_asymbol_name (sym) + 1;
+ name = bfd_asymbol_name (sym) = name + 1;
else
{
char *n;
- n = xmalloc (strlen (bfd_asymbol_name (sym)) + 2);
+ n = xmalloc (strlen (name) + 2);
n[0] = bfd_get_symbol_leading_char (obfd);
if (bfd_get_symbol_leading_char (abfd) == '\0')
- strcpy (n + 1, bfd_asymbol_name (sym));
+ strcpy (n + 1, name);
else
- strcpy (n + 1, bfd_asymbol_name (sym) + 1);
- bfd_asymbol_name (sym) = n;
+ strcpy (n + 1, name + 1);
+ name = bfd_asymbol_name (sym) = n;
}
}
@@ -502,8 +524,8 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
|| (flags & BSF_WEAK) != 0
|| bfd_is_und_section (bfd_get_section (sym))
|| bfd_is_com_section (bfd_get_section (sym)))
- && bfd_asymbol_name (sym)[0] == bfd_get_symbol_leading_char (abfd))
- bfd_asymbol_name (sym) = bfd_asymbol_name (sym) + 1;
+ && name[0] == bfd_get_symbol_leading_char (abfd))
+ name = bfd_asymbol_name (sym) = name + 1;
if ((flags & BSF_KEEP) != 0) /* Used in relocation. */
keep = 1;
@@ -522,16 +544,25 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
&& (discard_locals != locals_start_L
|| ! bfd_is_local_label (abfd, sym))));
- if (keep && is_strip_symbol (bfd_asymbol_name (sym)))
+ if (keep && is_specified_symbol (name, strip_specific_list))
keep = 0;
+ if (!keep && is_specified_symbol (name, keep_specific_list))
+ keep = 1;
if (keep && is_strip_section (abfd, bfd_get_section (sym)))
keep = 0;
- if (keep && weaken && (flags & BSF_GLOBAL) != 0)
+ if (keep && (flags & BSF_GLOBAL) != 0
+ && (weaken || is_specified_symbol (name, weaken_specific_list)))
{
sym->flags &=~ BSF_GLOBAL;
sym->flags |= BSF_WEAK;
}
+ if (keep && (flags & (BSF_GLOBAL | BSF_WEAK))
+ && is_specified_symbol (name, localize_specific_list))
+ {
+ sym->flags &= ~(BSF_GLOBAL | BSF_WEAK);
+ sym->flags |= BSF_LOCAL;
+ }
if (keep)
to[dst_count++] = sym;
@@ -678,7 +709,7 @@ copy_object (ibfd, obfd)
set = osections;
bfd_map_over_sections (obfd, get_sections, (void *) &set);
- qsort (osections, c, sizeof (asection *), compare_section_vma);
+ qsort (osections, c, sizeof (asection *), compare_section_lma);
gaps = (bfd_size_type *) xmalloc (c * sizeof (bfd_size_type));
memset (gaps, 0, c * sizeof (bfd_size_type));
@@ -697,8 +728,8 @@ copy_object (ibfd, obfd)
continue;
size = bfd_section_size (obfd, osections[i]);
- gap_start = bfd_section_vma (obfd, osections[i]) + size;
- gap_stop = bfd_section_vma (obfd, osections[i + 1]);
+ gap_start = bfd_section_lma (obfd, osections[i]) + size;
+ gap_stop = bfd_section_lma (obfd, osections[i + 1]);
if (gap_start < gap_stop)
{
if (! bfd_set_section_size (obfd, osections[i],
@@ -720,15 +751,15 @@ copy_object (ibfd, obfd)
if (pad_to_set)
{
- bfd_vma vma;
+ bfd_vma lma;
bfd_size_type size;
- vma = bfd_section_vma (obfd, osections[c - 1]);
+ lma = bfd_section_lma (obfd, osections[c - 1]);
size = bfd_section_size (obfd, osections[c - 1]);
- if (vma + size < pad_to)
+ if (lma + size < pad_to)
{
if (! bfd_set_section_size (obfd, osections[c - 1],
- pad_to - vma))
+ pad_to - lma))
{
fprintf (stderr, "%s: Can't add padding to %s: %s\n",
program_name,
@@ -738,12 +769,12 @@ copy_object (ibfd, obfd)
}
else
{
- gaps[c - 1] = pad_to - (vma + size);
- if (max_gap < pad_to - (vma + size))
- max_gap = pad_to - (vma + size);
+ gaps[c - 1] = pad_to - (lma + size);
+ if (max_gap < pad_to - (lma + size))
+ max_gap = pad_to - (lma + size);
}
}
- }
+ }
}
/* Symbol filtering must happen after the output sections have
@@ -778,6 +809,9 @@ copy_object (ibfd, obfd)
|| strip_symbols == strip_unneeded
|| discard_locals != locals_undef
|| strip_specific_list != NULL
+ || keep_specific_list != NULL
+ || localize_specific_list != NULL
+ || weaken_specific_list != NULL
|| sections_removed
|| convert_debugging
|| change_leading_char
@@ -904,7 +938,11 @@ copy_archive (ibfd, obfd, output_target)
char *dir = make_tempname (bfd_get_filename (obfd));
/* Make a temp directory to hold the contents. */
+#if defined (_WIN32) && !defined (__CYGWIN32__)
+ if (mkdir (dir) != 0)
+#else
if (mkdir (dir, 0700) != 0)
+#endif
{
fatal ("cannot mkdir %s for archive copying (error: %s)",
dir, strerror (errno));
@@ -1257,6 +1295,22 @@ copy_section (ibfd, isection, obfdarg)
}
free (memhunk);
}
+ else if (p != NULL && p->set_flags && (p->flags & SEC_HAS_CONTENTS) != 0)
+ {
+ PTR memhunk = (PTR) xmalloc ((unsigned) size);
+
+ /* We don't permit the user to turn off the SEC_HAS_CONTENTS
+ flag--they can just remove the section entirely and add it
+ back again. However, we do permit them to turn on the
+ SEC_HAS_CONTENTS flag, and take it to mean that the section
+ contents should be zeroed out. */
+
+ memset (memhunk, 0, size);
+ if (! bfd_set_section_contents (obfd, osection, memhunk, (file_ptr) 0,
+ size))
+ nonfatal (bfd_get_filename (obfd));
+ free (memhunk);
+ }
}
/* Get all the sections. This is used when --gap-fill or --pad-to is
@@ -1279,7 +1333,7 @@ get_sections (obfd, osection, secppparg)
sections to the front, where they are easier to ignore. */
static int
-compare_section_vma (arg1, arg2)
+compare_section_lma (arg1, arg2)
const PTR arg1;
const PTR arg2;
{
@@ -1304,13 +1358,13 @@ compare_section_vma (arg1, arg2)
return 1;
}
- /* Sort sections by VMA. */
- if ((*sec1)->vma > (*sec2)->vma)
+ /* Sort sections by LMA. */
+ if ((*sec1)->lma > (*sec2)->lma)
return 1;
- else if ((*sec1)->vma < (*sec2)->vma)
+ else if ((*sec1)->lma < (*sec2)->lma)
return -1;
- /* Sort sections with the same VMA by size. */
+ /* Sort sections with the same LMA by size. */
if ((*sec1)->_raw_size > (*sec2)->_raw_size)
return 1;
else if ((*sec1)->_raw_size < (*sec2)->_raw_size)
@@ -1506,6 +1560,24 @@ smart_rename (from, to)
if (lstat (to, &s))
return -1;
+#if defined (_WIN32) && !defined (__CYGWIN32__)
+ /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
+ fail instead. Also, chown is not present. */
+
+ if (stat (to, &s) == 0)
+ remove (to);
+
+ ret = rename (from, to);
+ if (ret != 0)
+ {
+ /* We have to clean up here. */
+ int saved = errno;
+ fprintf (stderr, "%s: %s: ", program_name, to);
+ errno = saved;
+ perror ("rename");
+ unlink (from);
+ }
+#else
/* Use rename only if TO is not a symbolic link and has
only one hard link. */
if (!S_ISLNK (s.st_mode) && s.st_nlink == 1)
@@ -1550,47 +1622,41 @@ smart_rename (from, to)
}
unlink (from);
}
+#endif /* _WIN32 && !__CYGWIN32__ */
+
return ret;
}
-/* Set the date of the file DESTINATION to be the same as the date of
- the file SOURCE. */
+/* Set the times of the file DESTINATION to be the same as those in
+ STATBUF. */
static void
-make_same_dates (source, destination)
- const char *source;
+set_times (destination, statbuf)
const char *destination;
+ const struct stat *statbuf;
{
- struct stat statbuf;
int result;
- if (stat (source, &statbuf) < 0)
- {
- fprintf (stderr, "%s: ", source);
- perror ("cannot stat");
- return;
- }
-
{
#ifdef HAVE_GOOD_UTIME_H
struct utimbuf tb;
- tb.actime = statbuf.st_atime;
- tb.modtime = statbuf.st_mtime;
+ tb.actime = statbuf->st_atime;
+ tb.modtime = statbuf->st_mtime;
result = utime (destination, &tb);
#else /* ! HAVE_GOOD_UTIME_H */
#ifndef HAVE_UTIMES
long tb[2];
- tb[0] = statbuf.st_atime;
- tb[1] = statbuf.st_mtime;
+ tb[0] = statbuf->st_atime;
+ tb[1] = statbuf->st_mtime;
result = utime (destination, tb);
#else /* HAVE_UTIMES */
struct timeval tv[2];
- tv[0].tv_sec = statbuf.st_atime;
+ tv[0].tv_sec = statbuf->st_atime;
tv[0].tv_usec = 0;
- tv[1].tv_sec = statbuf.st_mtime;
+ tv[1].tv_sec = statbuf->st_mtime;
tv[1].tv_usec = 0;
result = utimes (destination, tv);
#endif /* HAVE_UTIMES */
@@ -1646,23 +1712,10 @@ strip_main (argc, argv)
strip_symbols = strip_unneeded;
break;
case 'K':
- if (! keep_symbols && strip_specific_list != NULL)
- {
- fprintf (stderr, "%s: Can not specify both -K and -N\n",
- program_name);
- strip_usage (stderr, 1);
- }
- keep_symbols = true;
- add_strip_symbol (optarg);
+ add_specific_symbol (optarg, &keep_specific_list);
break;
case 'N':
- if (keep_symbols)
- {
- fprintf (stderr, "%s: Can not specify both -K and -N\n",
- program_name);
- strip_usage (stderr, 1);
- }
- add_strip_symbol (optarg);
+ add_specific_symbol (optarg, &strip_specific_list);
break;
case 'o':
output_file = optarg;
@@ -1711,18 +1764,30 @@ strip_main (argc, argv)
for (; i < argc; i++)
{
int hold_status = status;
+ struct stat statbuf;
char *tmpname;
+ if (preserve_dates)
+ {
+ if (stat (argv[i], &statbuf) < 0)
+ {
+ fprintf (stderr, "%s: ", argv[i]);
+ perror ("cannot stat");
+ continue;
+ }
+ }
+
if (output_file != NULL)
tmpname = output_file;
else
tmpname = make_tempname (argv[i]);
status = 0;
+
copy_file (argv[i], tmpname, input_target, output_target);
if (status == 0)
{
if (preserve_dates)
- make_same_dates (argv[i], tmpname);
+ set_times (tmpname, &statbuf);
if (output_file == NULL)
smart_rename (tmpname, argv[i]);
status = hold_status;
@@ -1748,8 +1813,9 @@ copy_main (argc, argv)
boolean preserve_dates = false;
int c;
struct section_list *p;
+ struct stat statbuf;
- while ((c = getopt_long (argc, argv, "b:i:I:K:N:s:O:d:F:R:SpgxXVv",
+ while ((c = getopt_long (argc, argv, "b:i:I:K:N:s:O:d:F:L:R:SpgxXVvW:",
copy_options, (int *) 0)) != EOF)
{
switch (c)
@@ -1798,23 +1864,16 @@ copy_main (argc, argv)
strip_symbols = strip_unneeded;
break;
case 'K':
- if (! keep_symbols && strip_specific_list != NULL)
- {
- fprintf (stderr, "%s: Can not specify both -K and -N\n",
- program_name);
- strip_usage (stderr, 1);
- }
- keep_symbols = true;
- add_strip_symbol (optarg);
+ add_specific_symbol (optarg, &keep_specific_list);
break;
case 'N':
- if (keep_symbols)
- {
- fprintf (stderr, "%s: Can not specify both -K and -N\n",
- program_name);
- strip_usage (stderr, 1);
- }
- add_strip_symbol (optarg);
+ add_specific_symbol (optarg, &strip_specific_list);
+ break;
+ case 'L':
+ add_specific_symbol (optarg, &localize_specific_list);
+ break;
+ case 'W':
+ add_specific_symbol (optarg, &weaken_specific_list);
break;
case 'p':
preserve_dates = true;
@@ -2038,6 +2097,16 @@ copy_main (argc, argv)
if (output_target == (char *) NULL)
output_target = input_target;
+ if (preserve_dates)
+ {
+ if (stat (input_filename, &statbuf) < 0)
+ {
+ fprintf (stderr, "%s: ", input_filename);
+ perror ("cannot stat");
+ exit (1);
+ }
+ }
+
/* If there is no destination file then create a temp and rename
the result into the input. */
@@ -2049,7 +2118,7 @@ copy_main (argc, argv)
if (status == 0)
{
if (preserve_dates)
- make_same_dates (input_filename, tmpname);
+ set_times (tmpname, &statbuf);
smart_rename (tmpname, input_filename);
}
else
@@ -2059,7 +2128,7 @@ copy_main (argc, argv)
{
copy_file (input_filename, output_filename, input_target, output_target);
if (status == 0 && preserve_dates)
- make_same_dates (input_filename, output_filename);
+ set_times (output_filename, &statbuf);
}
if (adjust_warn)
diff --git a/contrib/binutils/binutils/objdump.1 b/contrib/binutils/binutils/objdump.1
index 6c15531..69217b9 100644
--- a/contrib/binutils/binutils/objdump.1
+++ b/contrib/binutils/binutils/objdump.1
@@ -254,7 +254,7 @@ Only useful with \fB\-d\fP, \fB\-D\fP, or \fB\-r\fP.
.TP
.BI "\-\-architecture=" "machine"
Specify the architecture to use when disassembling object files. This
-can be useful when disasembling object files which do not describe
+can be useful when disassembling object files which do not describe
architecture information, such as S-records. You can list the available
architectures with the \fB\-i\fP option.
diff --git a/contrib/binutils/binutils/objdump.c b/contrib/binutils/binutils/objdump.c
index 2ae4002..65ac410 100644
--- a/contrib/binutils/binutils/objdump.c
+++ b/contrib/binutils/binutils/objdump.c
@@ -1,5 +1,6 @@
/* objdump.c -- dump information about an object file.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -232,7 +233,7 @@ Usage: %s [-ahifCdDprRtTxsSlw] [-b bfdname] [-m machine] [-j section-name]\n\
at least one option besides -l (--line-numbers) must be given\n");
list_supported_targets (program_name, stream);
if (status == 0)
- fprintf (stream, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
exit (status);
}
@@ -803,12 +804,12 @@ objdump_print_addr_with_sym (abfd, sec, sym, vma, info, skip_zeroes)
secaddr = bfd_get_section_vma (abfd, sec);
if (vma < secaddr)
{
- (*info->fprintf_func) (info->stream, "-");
+ (*info->fprintf_func) (info->stream, "-0x");
objdump_print_value (secaddr - vma, info, true);
}
else if (vma > secaddr)
{
- (*info->fprintf_func) (info->stream, "+");
+ (*info->fprintf_func) (info->stream, "+0x");
objdump_print_value (vma - secaddr, info, true);
}
(*info->fprintf_func) (info->stream, ">");
@@ -819,12 +820,12 @@ objdump_print_addr_with_sym (abfd, sec, sym, vma, info, skip_zeroes)
objdump_print_symname (abfd, info, sym);
if (bfd_asymbol_value (sym) > vma)
{
- (*info->fprintf_func) (info->stream, "-");
+ (*info->fprintf_func) (info->stream, "-0x");
objdump_print_value (bfd_asymbol_value (sym) - vma, info, true);
}
else if (vma > bfd_asymbol_value (sym))
{
- (*info->fprintf_func) (info->stream, "+");
+ (*info->fprintf_func) (info->stream, "+0x");
objdump_print_value (vma - bfd_asymbol_value (sym), info, true);
}
(*info->fprintf_func) (info->stream, ">");
@@ -845,6 +846,7 @@ objdump_print_addr (vma, info, skip_zeroes)
if (sorted_symcount < 1)
{
+ (*info->fprintf_func) (info->stream, "0x");
objdump_print_value (vma, info, skip_zeroes);
return;
}
@@ -867,6 +869,27 @@ objdump_print_address (vma, info)
objdump_print_addr (vma, info, ! prefix_addresses);
}
+/* Determine of the given address has a symbol associated with it. */
+
+static int
+objdump_symbol_at_address (vma, info)
+ bfd_vma vma;
+ struct disassemble_info * info;
+{
+ struct objdump_disasm_info * aux;
+ asymbol * sym;
+
+ /* No symbols - do not bother checking. */
+ if (sorted_symcount < 1)
+ return 0;
+
+ aux = (struct objdump_disasm_info *) info->application_data;
+ sym = find_symbol_for_address (aux->abfd, aux->sec, vma, aux->require_sec,
+ (long *) NULL);
+
+ return (sym != NULL && (bfd_asymbol_value (sym) == vma));
+}
+
/* Hold the last function name and the last line number we displayed
in a disassembly. */
@@ -1207,7 +1230,8 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
{
char buf[1000];
SFILE sfile;
- int bpc, pb = 0;
+ int bpc = 0;
+ int pb = 0;
done_dot = false;
@@ -1240,6 +1264,11 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
info->stream = (FILE *) &sfile;
info->bytes_per_line = 0;
info->bytes_per_chunk = 0;
+ if ((*relppp < relppend) && ((**relppp)->address >= (bfd_vma) i &&
+ (**relppp)->address < (bfd_vma) i + bytes))
+ info->flags = INSN_HAS_RELOC;
+ else
+ info->flags = 0;
bytes = (*disassemble_fn) (section->vma + i, info);
info->fprintf_func = (fprintf_ftype) fprintf;
info->stream = stdout;
@@ -1457,6 +1486,7 @@ disassemble_data (abfd)
aux.abfd = abfd;
aux.require_sec = false;
disasm_info.print_address_func = objdump_print_address;
+ disasm_info.symbol_at_address_func = objdump_symbol_at_address;
if (machine != (char *) NULL)
{
@@ -1512,6 +1542,8 @@ disassemble_data (abfd)
arelent **relpp = NULL;
arelent **relppend = NULL;
long stop;
+ asymbol *sym = NULL;
+ long place = 0;
if ((section->flags & SEC_LOAD) == 0
|| (! disassemble_all
@@ -1578,91 +1610,96 @@ disassemble_data (abfd)
stop = disasm_info.buffer_length;
}
- if (prefix_addresses)
- disassemble_bytes (&disasm_info, disassemble_fn, true, data, i, stop,
- &relpp, relppend);
- else
- {
- asymbol *sym;
- long place;
+ sym = find_symbol_for_address (abfd, section, section->vma + i,
+ true, &place);
- sym = find_symbol_for_address (abfd, section, section->vma + i,
- true, &place);
- ++place;
- while (i < stop)
+ while (i < stop)
+ {
+ asymbol *nextsym;
+ long nextstop;
+ boolean insns;
+
+ if (sym != NULL && bfd_asymbol_value (sym) <= section->vma + i)
{
- asymbol *nextsym;
- long nextstop;
- boolean insns;
+ int x;
- if (sym != NULL && bfd_asymbol_value (sym) <= section->vma + i)
- disasm_info.symbol = sym;
- else
- disasm_info.symbol = NULL;
+ for (x = place;
+ (x < sorted_symcount
+ && bfd_asymbol_value (sorted_syms[x]) <= section->vma + i);
+ ++x)
+ continue;
+ disasm_info.symbols = & sorted_syms[place];
+ disasm_info.num_symbols = x - place;
+ }
+ else
+ disasm_info.symbols = NULL;
+ if (! prefix_addresses)
+ {
printf ("\n");
objdump_print_addr_with_sym (abfd, section, sym,
section->vma + i,
&disasm_info,
false);
printf (":\n");
-
- if (sym != NULL && bfd_asymbol_value (sym) > section->vma + i)
- nextsym = sym;
- else if (sym == NULL)
+ }
+
+ if (sym != NULL && bfd_asymbol_value (sym) > section->vma + i)
+ nextsym = sym;
+ else if (sym == NULL)
+ nextsym = NULL;
+ else
+ {
+ while (place < sorted_symcount
+ /* ??? Why the test for != section? */
+ && (sorted_syms[place]->section != section
+ || (bfd_asymbol_value (sorted_syms[place])
+ <= bfd_asymbol_value (sym))))
+ ++place;
+ if (place >= sorted_symcount)
nextsym = NULL;
else
- {
- while (place < sorted_symcount
- && (sorted_syms[place]->section != section
- || (bfd_asymbol_value (sorted_syms[place])
- <= bfd_asymbol_value (sym))))
- ++place;
- if (place >= sorted_symcount)
- nextsym = NULL;
- else
- nextsym = sorted_syms[place];
- }
-
- if (sym != NULL && bfd_asymbol_value (sym) > section->vma + i)
- {
- nextstop = bfd_asymbol_value (sym) - section->vma;
- if (nextstop > stop)
- nextstop = stop;
- }
- else if (nextsym == NULL)
+ nextsym = sorted_syms[place];
+ }
+
+ if (sym != NULL && bfd_asymbol_value (sym) > section->vma + i)
+ {
+ nextstop = bfd_asymbol_value (sym) - section->vma;
+ if (nextstop > stop)
nextstop = stop;
- else
- {
- nextstop = bfd_asymbol_value (nextsym) - section->vma;
- if (nextstop > stop)
- nextstop = stop;
- }
-
- /* If a symbol is explicitly marked as being an object
- rather than a function, just dump the bytes without
- disassembling them. */
- if (disassemble_all
- || sym == NULL
- || bfd_asymbol_value (sym) > section->vma + i
- || ((sym->flags & BSF_OBJECT) == 0
- && (strstr (bfd_asymbol_name (sym), "gnu_compiled")
- == NULL)
- && (strstr (bfd_asymbol_name (sym), "gcc2_compiled")
- == NULL))
- || (sym->flags & BSF_FUNCTION) != 0)
- insns = true;
- else
- insns = false;
-
- disassemble_bytes (&disasm_info, disassemble_fn, insns, data, i,
- nextstop, &relpp, relppend);
-
- i = nextstop;
- sym = nextsym;
}
+ else if (nextsym == NULL)
+ nextstop = stop;
+ else
+ {
+ nextstop = bfd_asymbol_value (nextsym) - section->vma;
+ if (nextstop > stop)
+ nextstop = stop;
+ }
+
+ /* If a symbol is explicitly marked as being an object
+ rather than a function, just dump the bytes without
+ disassembling them. */
+ if (disassemble_all
+ || sym == NULL
+ || bfd_asymbol_value (sym) > section->vma + i
+ || ((sym->flags & BSF_OBJECT) == 0
+ && (strstr (bfd_asymbol_name (sym), "gnu_compiled")
+ == NULL)
+ && (strstr (bfd_asymbol_name (sym), "gcc2_compiled")
+ == NULL))
+ || (sym->flags & BSF_FUNCTION) != 0)
+ insns = true;
+ else
+ insns = false;
+
+ disassemble_bytes (&disasm_info, disassemble_fn, insns, data, i,
+ nextstop, &relpp, relppend);
+
+ i = nextstop;
+ sym = nextsym;
}
-
+
free (data);
if (relbuf != NULL)
free (relbuf);
@@ -1863,11 +1900,12 @@ dump_section_stabs (abfd, stabsect_name, strsect_name)
len = strlen (stabsect_name);
-/* If the prefix matches, and the files section name ends with a nul or a digit,
- then we match. Ie: we want either an exact match or a a section followed by
- a number. */
+ /* If the prefix matches, and the files section name ends with a
+ nul or a digit, then we match. I.e., we want either an exact
+ match or a section followed by a number. */
if (strncmp (stabsect_name, s->name, len) == 0
- && (s->name[len] == '\000' || isdigit (s->name[len])))
+ && (s->name[len] == '\000'
+ || isdigit ((unsigned char) s->name[len])))
{
if (read_section_stabs (abfd, s->name, strsect_name))
{
diff --git a/contrib/binutils/binutils/rclex.c b/contrib/binutils/binutils/rclex.c
new file mode 100644
index 0000000..3c9682e
--- /dev/null
+++ b/contrib/binutils/binutils/rclex.c
@@ -0,0 +1,2526 @@
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+#include <unistd.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator). This
+ * avoids problems with code like:
+ *
+ * if ( condition_holds )
+ * yyless( 5 );
+ * else
+ * do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ *yy_cp = yy_hold_char; \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+ };
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yytext_ptr = yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
+ yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 86
+#define YY_END_OF_BUFFER 87
+static yyconst short int yy_accept[470] =
+ { 0,
+ 0, 0, 87, 85, 84, 83, 85, 78, 80, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 2, 4, 84,
+ 0, 81, 78, 80, 79, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 81, 0, 82, 11, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+
+ 82, 82, 82, 82, 82, 3, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 76, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 41, 82, 82,
+ 82, 53, 42, 82, 82, 82, 82, 82, 82, 82,
+ 46, 82, 82, 82, 82, 82, 82, 71, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+
+ 82, 82, 82, 7, 82, 82, 82, 38, 1, 82,
+ 82, 82, 82, 82, 18, 82, 82, 25, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 70,
+ 82, 82, 39, 40, 82, 82, 82, 82, 82, 30,
+ 82, 82, 82, 82, 82, 82, 50, 82, 82, 82,
+ 82, 82, 34, 82, 82, 9, 82, 82, 19, 82,
+ 68, 82, 82, 82, 82, 82, 82, 12, 0, 82,
+ 82, 82, 82, 82, 82, 82, 13, 82, 14, 82,
+ 82, 82, 82, 65, 82, 82, 82, 52, 82, 72,
+ 82, 82, 82, 82, 82, 82, 47, 82, 82, 82,
+
+ 82, 82, 82, 82, 82, 82, 58, 82, 82, 36,
+ 82, 82, 82, 82, 82, 82, 82, 82, 0, 82,
+ 0, 77, 17, 82, 82, 51, 82, 10, 82, 82,
+ 82, 82, 16, 82, 82, 82, 82, 82, 82, 82,
+ 29, 82, 82, 82, 82, 82, 82, 82, 73, 82,
+ 31, 82, 82, 82, 82, 82, 82, 45, 6, 82,
+ 82, 82, 82, 77, 82, 23, 24, 82, 15, 82,
+ 27, 82, 82, 66, 82, 28, 54, 43, 82, 82,
+ 82, 48, 82, 69, 8, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
+
+ 64, 82, 82, 82, 82, 56, 82, 82, 82, 82,
+ 35, 49, 82, 82, 82, 82, 20, 82, 82, 82,
+ 82, 82, 82, 82, 82, 74, 82, 82, 82, 32,
+ 82, 82, 37, 82, 82, 82, 82, 82, 82, 75,
+ 82, 67, 61, 82, 82, 82, 33, 59, 60, 5,
+ 21, 82, 82, 82, 82, 55, 57, 82, 82, 82,
+ 26, 63, 82, 82, 82, 62, 22, 44, 0
+ } ;
+
+static yyconst int yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
+ 1, 1, 1, 7, 1, 1, 1, 8, 8, 8,
+ 9, 8, 8, 8, 8, 8, 8, 1, 1, 1,
+ 1, 1, 1, 1, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 19, 26, 27, 28, 29, 30, 19, 31, 32, 19,
+ 1, 1, 1, 1, 1, 1, 33, 33, 33, 33,
+
+ 33, 33, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 33,
+ 19, 19, 34, 1, 35, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst int yy_meta[36] =
+ { 0,
+ 1, 2, 3, 2, 1, 4, 2, 5, 5, 5,
+ 5, 5, 5, 5, 5, 1, 1, 1, 1, 1,
+ 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 5, 1, 1
+ } ;
+
+static yyconst short int yy_base[476] =
+ { 0,
+ 0, 0, 515, 516, 34, 516, 509, 0, 492, 25,
+ 26, 45, 25, 28, 24, 486, 497, 49, 0, 40,
+ 43, 486, 51, 66, 67, 482, 35, 516, 516, 81,
+ 503, 84, 0, 486, 516, 0, 494, 477, 492, 475,
+ 74, 474, 477, 475, 46, 489, 69, 484, 471, 481,
+ 55, 477, 481, 466, 67, 469, 83, 83, 467, 477,
+ 464, 478, 464, 459, 475, 470, 74, 453, 81, 457,
+ 86, 76, 468, 467, 465, 452, 452, 458, 95, 461,
+ 453, 447, 446, 106, 466, 456, 0, 451, 444, 449,
+ 448, 443, 452, 435, 436, 449, 433, 448, 430, 426,
+
+ 429, 430, 433, 441, 424, 0, 423, 436, 435, 420,
+ 415, 417, 427, 419, 420, 424, 412, 428, 423, 410,
+ 424, 405, 406, 407, 419, 409, 0, 402, 409, 416,
+ 414, 410, 408, 415, 393, 399, 412, 406, 392, 401,
+ 397, 391, 387, 388, 386, 392, 394, 103, 383, 387,
+ 399, 388, 389, 396, 385, 377, 379, 376, 373, 376,
+ 370, 374, 387, 368, 363, 98, 381, 0, 379, 367,
+ 363, 0, 0, 362, 363, 360, 358, 375, 361, 356,
+ 105, 373, 372, 351, 355, 355, 349, 0, 366, 352,
+ 347, 346, 352, 346, 343, 356, 346, 354, 356, 352,
+
+ 347, 344, 349, 0, 335, 344, 350, 0, 0, 334,
+ 115, 334, 345, 119, 0, 345, 331, 0, 328, 326,
+ 336, 325, 336, 328, 327, 320, 317, 313, 330, 0,
+ 330, 331, 0, 0, 327, 322, 329, 314, 314, 0,
+ 114, 305, 307, 318, 322, 318, 0, 321, 318, 107,
+ 318, 318, 0, 306, 316, 0, 316, 308, 0, 294,
+ 0, 298, 307, 294, 291, 304, 304, 0, 132, 137,
+ 293, 287, 290, 300, 288, 290, 0, 293, 295, 295,
+ 276, 292, 295, 0, 293, 278, 276, 0, 277, 0,
+ 270, 283, 267, 285, 270, 281, 0, 280, 279, 271,
+
+ 265, 277, 261, 257, 259, 257, 0, 274, 256, 0,
+ 255, 254, 258, 248, 269, 268, 265, 258, 270, 143,
+ 269, 149, 0, 259, 241, 0, 240, 0, 259, 238,
+ 258, 239, 0, 250, 237, 250, 236, 231, 247, 246,
+ 0, 249, 247, 247, 234, 227, 240, 225, 0, 222,
+ 0, 223, 222, 239, 224, 237, 218, 227, 0, 216,
+ 215, 222, 217, 235, 213, 0, 0, 209, 0, 226,
+ 0, 209, 203, 0, 216, 0, 0, 0, 212, 206,
+ 211, 0, 220, 0, 0, 215, 204, 199, 200, 199,
+ 213, 199, 199, 197, 206, 208, 207, 199, 188, 194,
+
+ 192, 188, 188, 190, 196, 0, 198, 182, 184, 182,
+ 0, 0, 184, 181, 188, 176, 0, 177, 171, 172,
+ 170, 183, 186, 181, 171, 0, 183, 171, 164, 0,
+ 167, 175, 0, 164, 160, 155, 157, 156, 159, 0,
+ 155, 0, 0, 160, 165, 156, 0, 0, 0, 0,
+ 0, 141, 150, 141, 139, 0, 0, 128, 122, 126,
+ 0, 0, 109, 91, 79, 0, 0, 0, 516, 156,
+ 161, 65, 166, 171, 176
+ } ;
+
+static yyconst short int yy_def[476] =
+ { 0,
+ 469, 1, 469, 469, 469, 469, 470, 471, 472, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 469, 469, 469,
+ 470, 469, 471, 472, 469, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 469, 470, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 469, 474,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 475, 474,
+ 475, 474, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 475, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ 473, 473, 473, 473, 473, 473, 473, 473, 0, 469,
+ 469, 469, 469, 469, 469
+ } ;
+
+static yyconst short int yy_nxt[552] =
+ { 0,
+ 4, 5, 6, 5, 7, 8, 4, 9, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 19,
+ 20, 21, 22, 19, 23, 24, 25, 19, 26, 27,
+ 19, 19, 19, 28, 29, 30, 37, 30, 50, 41,
+ 52, 55, 51, 42, 81, 38, 43, 56, 82, 63,
+ 53, 39, 83, 40, 44, 95, 67, 64, 54, 96,
+ 59, 45, 60, 65, 103, 46, 68, 66, 47, 34,
+ 61, 62, 48, 49, 70, 73, 71, 74, 76, 72,
+ 77, 104, 30, 78, 30, 84, 90, 108, 85, 91,
+ 98, 99, 111, 75, 79, 113, 123, 109, 126, 129,
+
+ 124, 131, 132, 114, 139, 468, 112, 84, 127, 130,
+ 85, 205, 225, 467, 206, 241, 269, 269, 242, 270,
+ 140, 226, 243, 295, 227, 228, 141, 229, 207, 273,
+ 304, 466, 274, 269, 269, 305, 319, 465, 321, 296,
+ 321, 322, 36, 321, 321, 464, 321, 322, 36, 321,
+ 321, 463, 321, 322, 36, 321, 31, 31, 462, 31,
+ 31, 33, 33, 461, 33, 33, 36, 460, 459, 36,
+ 36, 320, 320, 458, 320, 320, 321, 321, 457, 456,
+ 321, 455, 454, 453, 452, 451, 450, 449, 448, 447,
+ 446, 445, 444, 443, 442, 441, 440, 439, 438, 437,
+
+ 436, 435, 434, 433, 432, 431, 430, 429, 428, 427,
+ 426, 425, 424, 423, 422, 421, 420, 419, 418, 417,
+ 416, 415, 414, 413, 412, 411, 410, 409, 408, 407,
+ 406, 405, 404, 403, 402, 401, 400, 399, 398, 364,
+ 397, 396, 395, 394, 393, 392, 391, 390, 389, 388,
+ 387, 386, 385, 384, 383, 382, 381, 380, 379, 378,
+ 377, 376, 375, 374, 373, 372, 371, 370, 369, 368,
+ 367, 366, 365, 364, 364, 363, 362, 361, 360, 359,
+ 358, 357, 356, 355, 354, 353, 352, 351, 350, 349,
+ 348, 347, 346, 345, 344, 343, 342, 341, 340, 339,
+
+ 338, 337, 336, 335, 334, 333, 332, 331, 330, 329,
+ 328, 327, 326, 325, 324, 323, 318, 317, 316, 315,
+ 314, 313, 312, 311, 310, 309, 308, 307, 306, 303,
+ 302, 301, 300, 299, 298, 297, 294, 293, 292, 291,
+ 290, 289, 288, 287, 286, 285, 284, 283, 282, 281,
+ 280, 279, 278, 277, 276, 275, 272, 271, 268, 267,
+ 266, 265, 264, 263, 262, 261, 260, 259, 258, 257,
+ 256, 255, 254, 253, 252, 251, 250, 249, 248, 247,
+ 246, 245, 244, 240, 239, 238, 237, 236, 235, 234,
+ 233, 232, 231, 230, 224, 223, 222, 221, 220, 219,
+
+ 218, 217, 216, 215, 214, 213, 212, 211, 210, 209,
+ 208, 204, 203, 202, 201, 200, 199, 198, 197, 196,
+ 195, 194, 193, 192, 191, 190, 189, 188, 187, 186,
+ 185, 184, 183, 182, 181, 180, 179, 178, 177, 176,
+ 175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
+ 165, 164, 163, 162, 161, 160, 159, 158, 157, 156,
+ 155, 154, 153, 152, 151, 150, 149, 148, 147, 146,
+ 32, 145, 144, 143, 142, 138, 137, 136, 135, 134,
+ 133, 128, 125, 122, 121, 120, 119, 118, 117, 116,
+ 115, 110, 107, 106, 105, 102, 101, 100, 97, 94,
+
+ 93, 92, 89, 88, 87, 86, 35, 32, 80, 69,
+ 58, 57, 35, 32, 469, 3, 469, 469, 469, 469,
+ 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
+ 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
+ 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
+ 469
+ } ;
+
+static yyconst short int yy_chk[552] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 5, 10, 5, 13, 11,
+ 14, 15, 13, 11, 27, 10, 11, 15, 27, 20,
+ 14, 10, 27, 10, 12, 45, 21, 20, 14, 45,
+ 18, 12, 18, 20, 51, 12, 21, 20, 12, 472,
+ 18, 18, 12, 12, 23, 24, 23, 24, 25, 23,
+ 25, 51, 30, 25, 30, 32, 41, 55, 32, 41,
+ 47, 47, 57, 24, 25, 58, 67, 55, 69, 71,
+
+ 67, 72, 72, 58, 79, 465, 57, 84, 69, 71,
+ 84, 148, 166, 464, 148, 181, 211, 211, 181, 211,
+ 79, 166, 181, 241, 166, 166, 79, 166, 148, 214,
+ 250, 463, 214, 269, 269, 250, 269, 460, 270, 241,
+ 270, 270, 270, 270, 320, 459, 320, 320, 320, 320,
+ 322, 458, 322, 322, 322, 322, 470, 470, 455, 470,
+ 470, 471, 471, 454, 471, 471, 473, 453, 452, 473,
+ 473, 474, 474, 446, 474, 474, 475, 475, 445, 444,
+ 475, 441, 439, 438, 437, 436, 435, 434, 432, 431,
+ 429, 428, 427, 425, 424, 423, 422, 421, 420, 419,
+
+ 418, 416, 415, 414, 413, 410, 409, 408, 407, 405,
+ 404, 403, 402, 401, 400, 399, 398, 397, 396, 395,
+ 394, 393, 392, 391, 390, 389, 388, 387, 386, 383,
+ 381, 380, 379, 375, 373, 372, 370, 368, 365, 364,
+ 363, 362, 361, 360, 358, 357, 356, 355, 354, 353,
+ 352, 350, 348, 347, 346, 345, 344, 343, 342, 340,
+ 339, 338, 337, 336, 335, 334, 332, 331, 330, 329,
+ 327, 325, 324, 321, 319, 318, 317, 316, 315, 314,
+ 313, 312, 311, 309, 308, 306, 305, 304, 303, 302,
+ 301, 300, 299, 298, 296, 295, 294, 293, 292, 291,
+
+ 289, 287, 286, 285, 283, 282, 281, 280, 279, 278,
+ 276, 275, 274, 273, 272, 271, 267, 266, 265, 264,
+ 263, 262, 260, 258, 257, 255, 254, 252, 251, 249,
+ 248, 246, 245, 244, 243, 242, 239, 238, 237, 236,
+ 235, 232, 231, 229, 228, 227, 226, 225, 224, 223,
+ 222, 221, 220, 219, 217, 216, 213, 212, 210, 207,
+ 206, 205, 203, 202, 201, 200, 199, 198, 197, 196,
+ 195, 194, 193, 192, 191, 190, 189, 187, 186, 185,
+ 184, 183, 182, 180, 179, 178, 177, 176, 175, 174,
+ 171, 170, 169, 167, 165, 164, 163, 162, 161, 160,
+
+ 159, 158, 157, 156, 155, 154, 153, 152, 151, 150,
+ 149, 147, 146, 145, 144, 143, 142, 141, 140, 139,
+ 138, 137, 136, 135, 134, 133, 132, 131, 130, 129,
+ 128, 126, 125, 124, 123, 122, 121, 120, 119, 118,
+ 117, 116, 115, 114, 113, 112, 111, 110, 109, 108,
+ 107, 105, 104, 103, 102, 101, 100, 99, 98, 97,
+ 96, 95, 94, 93, 92, 91, 90, 89, 88, 86,
+ 85, 83, 82, 81, 80, 78, 77, 76, 75, 74,
+ 73, 70, 68, 66, 65, 64, 63, 62, 61, 60,
+ 59, 56, 54, 53, 52, 50, 49, 48, 46, 44,
+
+ 43, 42, 40, 39, 38, 37, 34, 31, 26, 22,
+ 17, 16, 9, 7, 3, 469, 469, 469, 469, 469,
+ 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
+ 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
+ 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
+ 469
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+char *yytext;
+#line 1 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+#define INITIAL 0
+#line 2 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+/* Copyright 1997, 1998 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor, Cygnus Support.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/* This is a lex input file which generates a lexer used by the
+ Windows rc file parser. It basically just recognized a bunch of
+ keywords. */
+
+#include "bfd.h"
+#include "bucomm.h"
+#include "libiberty.h"
+#include "windres.h"
+#include "rcparse.h"
+
+#include <ctype.h>
+#include <assert.h>
+
+/* Whether we are in rcdata mode, in which we returns the lengths of
+ strings. */
+
+static int rcdata_mode;
+
+/* List of allocated strings. */
+
+struct alloc_string
+{
+ struct alloc_string *next;
+ char *s;
+};
+
+static struct alloc_string *strings;
+
+/* Local functions. */
+
+static void cpp_line PARAMS ((const char *));
+static char *handle_quotes PARAMS ((const char *, unsigned long *));
+static char *get_string PARAMS ((int));
+
+#line 691 "lex.yy.c"
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines. This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( yy_current_buffer->yy_is_interactive ) \
+ { \
+ int c = '*', n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
+YY_DECL
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+#line 58 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+
+
+#line 841 "lex.yy.c"
+
+ if ( yy_init )
+ {
+ yy_init = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! yy_current_buffer )
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_load_buffer_state();
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yy_start;
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 470 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 516 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+
+do_action: /* This label is used only to access EOF actions. */
+
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yy_hold_char;
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 60 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return BEG; }
+ YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 61 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return BEG; }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 62 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return END; }
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 63 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return END; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 64 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return ACCELERATORS; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 65 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return VIRTKEY; }
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 66 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return ASCII; }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 67 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return NOINVERT; }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 68 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return SHIFT; }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 69 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return CONTROL; }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 70 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return ALT; }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 71 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return BITMAP; }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 72 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return CURSOR; }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 73 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return DIALOG; }
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 74 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return DIALOGEX; }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 75 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return EXSTYLE; }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 76 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return CAPTION; }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 77 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return CLASS; }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 78 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return STYLE; }
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 79 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return AUTO3STATE; }
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 80 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return AUTOCHECKBOX; }
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 81 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return AUTORADIOBUTTON; }
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 82 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return CHECKBOX; }
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 83 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return COMBOBOX; }
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 84 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return CTEXT; }
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 85 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return DEFPUSHBUTTON; }
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 86 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return EDITTEXT; }
+ YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 87 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return GROUPBOX; }
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 88 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return LISTBOX; }
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 89 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return LTEXT; }
+ YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 90 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return PUSHBOX; }
+ YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 91 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return PUSHBUTTON; }
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 92 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return RADIOBUTTON; }
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 93 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return RTEXT; }
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 94 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return SCROLLBAR; }
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 95 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return STATE3; }
+ YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 96 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return USERBUTTON; }
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 97 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return BEDIT; }
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 98 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return HEDIT; }
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 99 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return IEDIT; }
+ YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 100 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return FONT; }
+ YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 101 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return ICON; }
+ YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 102 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return LANGUAGE; }
+ YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 103 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return CHARACTERISTICS; }
+ YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 104 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return VERSIONK; }
+ YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 105 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return MENU; }
+ YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 106 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return MENUEX; }
+ YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 107 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return MENUITEM; }
+ YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 108 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return SEPARATOR; }
+ YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 109 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return POPUP; }
+ YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 110 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return CHECKED; }
+ YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 111 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return GRAYED; }
+ YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 112 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return HELP; }
+ YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 113 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return INACTIVE; }
+ YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 114 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return MENUBARBREAK; }
+ YY_BREAK
+case 56:
+YY_RULE_SETUP
+#line 115 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return MENUBREAK; }
+ YY_BREAK
+case 57:
+YY_RULE_SETUP
+#line 116 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return MESSAGETABLE; }
+ YY_BREAK
+case 58:
+YY_RULE_SETUP
+#line 117 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return RCDATA; }
+ YY_BREAK
+case 59:
+YY_RULE_SETUP
+#line 118 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return STRINGTABLE; }
+ YY_BREAK
+case 60:
+YY_RULE_SETUP
+#line 119 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return VERSIONINFO; }
+ YY_BREAK
+case 61:
+YY_RULE_SETUP
+#line 120 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return FILEVERSION; }
+ YY_BREAK
+case 62:
+YY_RULE_SETUP
+#line 121 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return PRODUCTVERSION; }
+ YY_BREAK
+case 63:
+YY_RULE_SETUP
+#line 122 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return FILEFLAGSMASK; }
+ YY_BREAK
+case 64:
+YY_RULE_SETUP
+#line 123 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return FILEFLAGS; }
+ YY_BREAK
+case 65:
+YY_RULE_SETUP
+#line 124 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return FILEOS; }
+ YY_BREAK
+case 66:
+YY_RULE_SETUP
+#line 125 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return FILETYPE; }
+ YY_BREAK
+case 67:
+YY_RULE_SETUP
+#line 126 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return FILESUBTYPE; }
+ YY_BREAK
+case 68:
+YY_RULE_SETUP
+#line 127 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return VALUE; }
+ YY_BREAK
+case 69:
+YY_RULE_SETUP
+#line 128 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return MOVEABLE; }
+ YY_BREAK
+case 70:
+YY_RULE_SETUP
+#line 129 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return FIXED; }
+ YY_BREAK
+case 71:
+YY_RULE_SETUP
+#line 130 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return PURE; }
+ YY_BREAK
+case 72:
+YY_RULE_SETUP
+#line 131 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return IMPURE; }
+ YY_BREAK
+case 73:
+YY_RULE_SETUP
+#line 132 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return PRELOAD; }
+ YY_BREAK
+case 74:
+YY_RULE_SETUP
+#line 133 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return LOADONCALL; }
+ YY_BREAK
+case 75:
+YY_RULE_SETUP
+#line 134 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return DISCARDABLE; }
+ YY_BREAK
+case 76:
+YY_RULE_SETUP
+#line 135 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return NOT; }
+ YY_BREAK
+case 77:
+YY_RULE_SETUP
+#line 137 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{
+ char *s, *send;
+
+ /* This is a hack to let us parse version
+ information easily. */
+
+ s = strchr (yytext, '"');
+ ++s;
+ send = strchr (s, '"');
+ if (strncmp (s, "StringFileInfo",
+ sizeof "StringFileInfo" - 1) == 0
+ && s + sizeof "StringFileInfo" - 1 == send)
+ return BLOCKSTRINGFILEINFO;
+ else if (strncmp (s, "VarFileInfo",
+ sizeof "VarFileInfo" - 1) == 0
+ && s + sizeof "VarFileInfo" - 1 == send)
+ return BLOCKVARFILEINFO;
+ else
+ {
+ char *r;
+
+ r = get_string (send - s + 1);
+ strncpy (r, s, send - s);
+ r[send - s] = '\0';
+ yylval.s = r;
+ return BLOCK;
+ }
+ }
+ YY_BREAK
+case 78:
+YY_RULE_SETUP
+#line 166 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{
+ cpp_line (yytext);
+ }
+ YY_BREAK
+case 79:
+YY_RULE_SETUP
+#line 170 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{
+ yylval.i.val = strtoul (yytext, 0, 0);
+ yylval.i.dword = 1;
+ return NUMBER;
+ }
+ YY_BREAK
+case 80:
+YY_RULE_SETUP
+#line 176 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{
+ yylval.i.val = strtoul (yytext, 0, 0);
+ yylval.i.dword = 0;
+ return NUMBER;
+ }
+ YY_BREAK
+case 81:
+YY_RULE_SETUP
+#line 182 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{
+ char *s;
+ unsigned long length;
+
+ s = handle_quotes (yytext, &length);
+ if (! rcdata_mode)
+ {
+ yylval.s = s;
+ return QUOTEDSTRING;
+ }
+ else
+ {
+ yylval.ss.length = length;
+ yylval.ss.s = s;
+ return SIZEDSTRING;
+ }
+ }
+ YY_BREAK
+case 82:
+YY_RULE_SETUP
+#line 200 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{
+ char *s;
+
+ /* I rejected comma in a string in order to
+ handle VIRTKEY, CONTROL in an accelerator
+ resource. This means that an unquoted
+ file name can not contain a comma. I
+ don't know what rc permits. */
+
+ s = get_string (strlen (yytext) + 1);
+ strcpy (s, yytext);
+ yylval.s = s;
+ return STRING;
+ }
+ YY_BREAK
+case 83:
+YY_RULE_SETUP
+#line 215 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ ++rc_lineno; }
+ YY_BREAK
+case 84:
+YY_RULE_SETUP
+#line 216 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ /* ignore whitespace */ }
+ YY_BREAK
+case 85:
+YY_RULE_SETUP
+#line 217 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+{ return *yytext; }
+ YY_BREAK
+case 86:
+YY_RULE_SETUP
+#line 219 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+ECHO;
+ YY_BREAK
+#line 1420 "lex.yy.c"
+case YY_STATE_EOF(INITIAL):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between yy_current_buffer and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yy_current_buffer->yy_input_file = yyin;
+ yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yy_c_buf_p;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap() )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p =
+ yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yy_c_buf_p =
+ &yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+ {
+ register char *dest = yy_current_buffer->yy_ch_buf;
+ register char *source = yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( yy_current_buffer->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a singled characater, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+ YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = yy_current_buffer;
+
+ int yy_c_buf_p_offset =
+ (int) (yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = yy_current_buffer->yy_buf_size -
+ number_to_move - 1;
+#endif
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+ yy_n_chars, num_to_read );
+ }
+
+ if ( yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ yy_current_buffer->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ yy_n_chars += number_to_move;
+ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+ return ret_val;
+ }
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = yy_start;
+
+ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 470 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+ }
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+ {
+ register int yy_is_jam;
+ register char *yy_cp = yy_c_buf_p;
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 470 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 469);
+
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+ {
+ register char *yy_cp = yy_c_buf_p;
+
+ /* undo effects of setting up yytext */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = yy_n_chars + 2;
+ register char *dest = &yy_current_buffer->yy_ch_buf[
+ yy_current_buffer->yy_buf_size + 2];
+ register char *source =
+ &yy_current_buffer->yy_ch_buf[number_to_move];
+
+ while ( source > yy_current_buffer->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ yy_n_chars = yy_current_buffer->yy_buf_size;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+
+ yytext_ptr = yy_bp;
+ yy_hold_char = *yy_cp;
+ yy_c_buf_p = yy_cp;
+ }
+#endif /* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+ {
+ int c;
+
+ *yy_c_buf_p = yy_hold_char;
+
+ if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ /* This was really a NUL. */
+ *yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ yytext_ptr = yy_c_buf_p;
+ ++yy_c_buf_p;
+
+ switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap() )
+ {
+ yy_c_buf_p =
+ yytext_ptr + YY_MORE_ADJ;
+ return EOF;
+ }
+
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+ break;
+
+ case EOB_ACT_LAST_MATCH:
+#ifdef __cplusplus
+ YY_FATAL_ERROR(
+ "unexpected last match in yyinput()" );
+#else
+ YY_FATAL_ERROR(
+ "unexpected last match in input()" );
+#endif
+ }
+ }
+ }
+
+ c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
+ *yy_c_buf_p = '\0'; /* preserve yytext */
+ yy_hold_char = *++yy_c_buf_p;
+
+
+ return c;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+ {
+ if ( ! yy_current_buffer )
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_init_buffer( yy_current_buffer, input_file );
+ yy_load_buffer_state();
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+ {
+ if ( yy_current_buffer == new_buffer )
+ return;
+
+ if ( yy_current_buffer )
+ {
+ /* Flush out information for old buffer. */
+ *yy_c_buf_p = yy_hold_char;
+ yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ yy_current_buffer = new_buffer;
+ yy_load_buffer_state();
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yy_did_buffer_switch_on_eof = 1;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+ {
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+ yyin = yy_current_buffer->yy_input_file;
+ yy_hold_char = *yy_c_buf_p;
+ }
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer( b, file );
+
+ return b;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+ {
+ if ( ! b )
+ return;
+
+ if ( b == yy_current_buffer )
+ yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yy_flex_free( (void *) b->yy_ch_buf );
+
+ yy_flex_free( (void *) b );
+ }
+
+
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+extern int isatty YY_PROTO(( int ));
+#endif
+#endif
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+ {
+ yy_flush_buffer( b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+ b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+ b->yy_is_interactive = 0;
+#else
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+ {
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == yy_current_buffer )
+ yy_load_buffer_state();
+ }
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer( b );
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *str )
+#else
+YY_BUFFER_STATE yy_scan_string( str )
+yyconst char *str;
+#endif
+ {
+ int len;
+ for ( len = 0; str[len]; ++len )
+ ;
+
+ return yy_scan_bytes( str, len );
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+ {
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yy_flex_alloc( n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+ {
+ if ( yy_start_stack_ptr >= yy_start_stack_depth )
+ {
+ yy_size_t new_size;
+
+ yy_start_stack_depth += YY_START_STACK_INCR;
+ new_size = yy_start_stack_depth * sizeof( int );
+
+ if ( ! yy_start_stack )
+ yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+ else
+ yy_start_stack = (int *) yy_flex_realloc(
+ (void *) yy_start_stack, new_size );
+
+ if ( ! yy_start_stack )
+ YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+ BEGIN(new_state);
+ }
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+ {
+ if ( --yy_start_stack_ptr < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ }
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+ {
+ return yy_start_stack[yy_start_stack_ptr - 1];
+ }
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+ }
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ yytext[yyleng] = yy_hold_char; \
+ yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
+ yy_hold_char = *yy_c_buf_p; \
+ *yy_c_buf_p = '\0'; \
+ yyleng = n; \
+ } \
+ while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+ {
+ return (void *) malloc( size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+ {
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+ {
+ free( ptr );
+ }
+
+#if YY_MAIN
+int main()
+ {
+ yylex();
+ return 0;
+ }
+#endif
+#line 219 "/5g/ian/binutils/release/copy/binutils/rclex.l"
+
+#ifndef yywrap
+/* This is needed for some versions of lex. */
+int yywrap ()
+{
+ return 1;
+}
+#endif
+
+/* Handle a C preprocessor line. */
+
+static void
+cpp_line (s)
+ const char *s;
+{
+ int line;
+ char *send, *fn;
+
+ ++s;
+ while (isspace (*s))
+ ++s;
+
+ line = strtol (s, &send, 0);
+ if (*send != '\0' && ! isspace (*send))
+ return;
+
+ /* Subtract 1 because we are about to count the newline. */
+ rc_lineno = line - 1;
+
+ s = send;
+ while (isspace (*s))
+ ++s;
+
+ if (*s != '"')
+ return;
+
+ ++s;
+ send = strchr (s, '"');
+ if (send == NULL)
+ return;
+
+ fn = (char *) xmalloc (send - s + 1);
+ strncpy (fn, s, send - s);
+ fn[send - s] = '\0';
+
+ free (rc_filename);
+ rc_filename = fn;
+}
+
+/* Handle a quoted string. The quotes are stripped. A pair of quotes
+ in a string are turned into a single quote. Adjacent strings are
+ merged separated by whitespace are merged, as in C. */
+
+static char *
+handle_quotes (input, len)
+ const char *input;
+ unsigned long *len;
+{
+ char *ret, *s;
+ const char *t;
+ int ch;
+
+ ret = get_string (strlen (input) + 1);
+
+ s = ret;
+ t = input;
+ if (*t == '"')
+ ++t;
+ while (*t != '\0')
+ {
+ if (*t == '\\')
+ {
+ ++t;
+ switch (*t)
+ {
+ case '\0':
+ rcparse_warning ("backslash at end of string");
+ break;
+
+ case '\"':
+ rcparse_warning ("use \"\" to put \" in a string");
+ break;
+
+ case 'a':
+ *s++ = ESCAPE_A;
+ ++t;
+ break;
+
+ case 'b':
+ *s++ = ESCAPE_B;
+ ++t;
+ break;
+
+ case 'f':
+ *s++ = ESCAPE_F;
+ ++t;
+ break;
+
+ case 'n':
+ *s++ = ESCAPE_N;
+ ++t;
+ break;
+
+ case 'r':
+ *s++ = ESCAPE_R;
+ ++t;
+ break;
+
+ case 't':
+ *s++ = ESCAPE_T;
+ ++t;
+ break;
+
+ case 'v':
+ *s++ = ESCAPE_V;
+ ++t;
+ break;
+
+ case '\\':
+ *s++ = *t++;
+ break;
+
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ ch = *t - '0';
+ ++t;
+ if (*t >= '0' && *t <= '7')
+ {
+ ch = (ch << 3) | (*t - '0');
+ ++t;
+ if (*t >= '0' && *t <= '7')
+ {
+ ch = (ch << 3) | (*t - '0');
+ ++t;
+ }
+ }
+ *s++ = ch;
+ break;
+
+ case 'x':
+ ++t;
+ ch = 0;
+ while (1)
+ {
+ if (*t >= '0' && *t <= '9')
+ ch = (ch << 4) | (*t - '0');
+ else if (*t >= 'a' && *t <= 'f')
+ ch = (ch << 4) | (*t - 'a');
+ else if (*t >= 'A' && *t <= 'F')
+ ch = (ch << 4) | (*t - 'A');
+ else
+ break;
+ ++t;
+ }
+ *s++ = ch;
+ break;
+
+ default:
+ rcparse_warning ("unrecognized escape sequence");
+ *s++ = '\\';
+ *s++ = *t++;
+ break;
+ }
+ }
+ else if (*t != '"')
+ *s++ = *t++;
+ else if (t[1] == '\0')
+ break;
+ else if (t[1] == '"')
+ {
+ *s++ = '"';
+ t += 2;
+ }
+ else
+ {
+ ++t;
+ assert (isspace (*t));
+ while (isspace (*t))
+ ++t;
+ if (*t == '\0')
+ break;
+ assert (*t == '"');
+ ++t;
+ }
+ }
+
+ *s = '\0';
+
+ *len = s - ret;
+
+ return ret;
+}
+
+/* Allocate a string of a given length. */
+
+static char *
+get_string (len)
+ int len;
+{
+ struct alloc_string *as;
+
+ as = (struct alloc_string *) xmalloc (sizeof *as);
+ as->s = xmalloc (len);
+
+ as->next = strings;
+ strings = as->next;
+
+ return as->s;
+}
+
+/* Discard all the strings we have allocated. The parser calls this
+ when it no longer needs them. */
+
+void
+rcparse_discard_strings ()
+{
+ struct alloc_string *as;
+
+ as = strings;
+ while (as != NULL)
+ {
+ struct alloc_string *n;
+
+ free (as->s);
+ n = as->next;
+ free (as);
+ as = n;
+ }
+
+ strings = NULL;
+}
+
+/* Enter rcdata mode. */
+
+void
+rcparse_rcdata ()
+{
+ rcdata_mode = 1;
+}
+
+/* Go back to normal mode from rcdata mode. */
+
+void
+rcparse_normal ()
+{
+ rcdata_mode = 0;
+}
diff --git a/contrib/binutils/binutils/rclex.l b/contrib/binutils/binutils/rclex.l
new file mode 100644
index 0000000..50ef185
--- /dev/null
+++ b/contrib/binutils/binutils/rclex.l
@@ -0,0 +1,465 @@
+%{ /* rclex.l -- lexer for Windows rc files parser */
+/* Copyright 1997, 1998 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor, Cygnus Support.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/* This is a lex input file which generates a lexer used by the
+ Windows rc file parser. It basically just recognized a bunch of
+ keywords. */
+
+#include "bfd.h"
+#include "bucomm.h"
+#include "libiberty.h"
+#include "windres.h"
+#include "rcparse.h"
+
+#include <ctype.h>
+#include <assert.h>
+
+/* Whether we are in rcdata mode, in which we returns the lengths of
+ strings. */
+
+static int rcdata_mode;
+
+/* List of allocated strings. */
+
+struct alloc_string
+{
+ struct alloc_string *next;
+ char *s;
+};
+
+static struct alloc_string *strings;
+
+/* Local functions. */
+
+static void cpp_line PARAMS ((const char *));
+static char *handle_quotes PARAMS ((const char *, unsigned long *));
+static char *get_string PARAMS ((int));
+
+%}
+
+%%
+
+"BEGIN" { return BEG; }
+"{" { return BEG; }
+"END" { return END; }
+"}" { return END; }
+"ACCELERATORS" { return ACCELERATORS; }
+"VIRTKEY" { return VIRTKEY; }
+"ASCII" { return ASCII; }
+"NOINVERT" { return NOINVERT; }
+"SHIFT" { return SHIFT; }
+"CONTROL" { return CONTROL; }
+"ALT" { return ALT; }
+"BITMAP" { return BITMAP; }
+"CURSOR" { return CURSOR; }
+"DIALOG" { return DIALOG; }
+"DIALOGEX" { return DIALOGEX; }
+"EXSTYLE" { return EXSTYLE; }
+"CAPTION" { return CAPTION; }
+"CLASS" { return CLASS; }
+"STYLE" { return STYLE; }
+"AUTO3STATE" { return AUTO3STATE; }
+"AUTOCHECKBOX" { return AUTOCHECKBOX; }
+"AUTORADIOBUTTON" { return AUTORADIOBUTTON; }
+"CHECKBOX" { return CHECKBOX; }
+"COMBOBOX" { return COMBOBOX; }
+"CTEXT" { return CTEXT; }
+"DEFPUSHBUTTON" { return DEFPUSHBUTTON; }
+"EDITTEXT" { return EDITTEXT; }
+"GROUPBOX" { return GROUPBOX; }
+"LISTBOX" { return LISTBOX; }
+"LTEXT" { return LTEXT; }
+"PUSHBOX" { return PUSHBOX; }
+"PUSHBUTTON" { return PUSHBUTTON; }
+"RADIOBUTTON" { return RADIOBUTTON; }
+"RTEXT" { return RTEXT; }
+"SCROLLBAR" { return SCROLLBAR; }
+"STATE3" { return STATE3; }
+"USERBUTTON" { return USERBUTTON; }
+"BEDIT" { return BEDIT; }
+"HEDIT" { return HEDIT; }
+"IEDIT" { return IEDIT; }
+"FONT" { return FONT; }
+"ICON" { return ICON; }
+"LANGUAGE" { return LANGUAGE; }
+"CHARACTERISTICS" { return CHARACTERISTICS; }
+"VERSION" { return VERSIONK; }
+"MENU" { return MENU; }
+"MENUEX" { return MENUEX; }
+"MENUITEM" { return MENUITEM; }
+"SEPARATOR" { return SEPARATOR; }
+"POPUP" { return POPUP; }
+"CHECKED" { return CHECKED; }
+"GRAYED" { return GRAYED; }
+"HELP" { return HELP; }
+"INACTIVE" { return INACTIVE; }
+"MENUBARBREAK" { return MENUBARBREAK; }
+"MENUBREAK" { return MENUBREAK; }
+"MESSAGETABLE" { return MESSAGETABLE; }
+"RCDATA" { return RCDATA; }
+"STRINGTABLE" { return STRINGTABLE; }
+"VERSIONINFO" { return VERSIONINFO; }
+"FILEVERSION" { return FILEVERSION; }
+"PRODUCTVERSION" { return PRODUCTVERSION; }
+"FILEFLAGSMASK" { return FILEFLAGSMASK; }
+"FILEFLAGS" { return FILEFLAGS; }
+"FILEOS" { return FILEOS; }
+"FILETYPE" { return FILETYPE; }
+"FILESUBTYPE" { return FILESUBTYPE; }
+"VALUE" { return VALUE; }
+"MOVEABLE" { return MOVEABLE; }
+"FIXED" { return FIXED; }
+"PURE" { return PURE; }
+"IMPURE" { return IMPURE; }
+"PRELOAD" { return PRELOAD; }
+"LOADONCALL" { return LOADONCALL; }
+"DISCARDABLE" { return DISCARDABLE; }
+"NOT" { return NOT; }
+
+"BLOCK"[ \t\n]*"\""[^\#\n]*"\"" {
+ char *s, *send;
+
+ /* This is a hack to let us parse version
+ information easily. */
+
+ s = strchr (yytext, '"');
+ ++s;
+ send = strchr (s, '"');
+ if (strncmp (s, "StringFileInfo",
+ sizeof "StringFileInfo" - 1) == 0
+ && s + sizeof "StringFileInfo" - 1 == send)
+ return BLOCKSTRINGFILEINFO;
+ else if (strncmp (s, "VarFileInfo",
+ sizeof "VarFileInfo" - 1) == 0
+ && s + sizeof "VarFileInfo" - 1 == send)
+ return BLOCKVARFILEINFO;
+ else
+ {
+ char *r;
+
+ r = get_string (send - s + 1);
+ strncpy (r, s, send - s);
+ r[send - s] = '\0';
+ yylval.s = r;
+ return BLOCK;
+ }
+ }
+
+"#"[^\n]* {
+ cpp_line (yytext);
+ }
+
+[0-9][x0-9A-Fa-f]*L {
+ yylval.i.val = strtoul (yytext, 0, 0);
+ yylval.i.dword = 1;
+ return NUMBER;
+ }
+
+[0-9][x0-9A-Fa-f]* {
+ yylval.i.val = strtoul (yytext, 0, 0);
+ yylval.i.dword = 0;
+ return NUMBER;
+ }
+
+("\""[^\"\n]*"\""[ \t]*)+ {
+ char *s;
+ unsigned long length;
+
+ s = handle_quotes (yytext, &length);
+ if (! rcdata_mode)
+ {
+ yylval.s = s;
+ return QUOTEDSTRING;
+ }
+ else
+ {
+ yylval.ss.length = length;
+ yylval.ss.s = s;
+ return SIZEDSTRING;
+ }
+ }
+
+[A-Za-z][^ ,\t\r\n]* {
+ char *s;
+
+ /* I rejected comma in a string in order to
+ handle VIRTKEY, CONTROL in an accelerator
+ resource. This means that an unquoted
+ file name can not contain a comma. I
+ don't know what rc permits. */
+
+ s = get_string (strlen (yytext) + 1);
+ strcpy (s, yytext);
+ yylval.s = s;
+ return STRING;
+ }
+
+[\n] { ++rc_lineno; }
+[ \t\r]+ { /* ignore whitespace */ }
+. { return *yytext; }
+
+%%
+#ifndef yywrap
+/* This is needed for some versions of lex. */
+int yywrap ()
+{
+ return 1;
+}
+#endif
+
+/* Handle a C preprocessor line. */
+
+static void
+cpp_line (s)
+ const char *s;
+{
+ int line;
+ char *send, *fn;
+
+ ++s;
+ while (isspace (*s))
+ ++s;
+
+ line = strtol (s, &send, 0);
+ if (*send != '\0' && ! isspace (*send))
+ return;
+
+ /* Subtract 1 because we are about to count the newline. */
+ rc_lineno = line - 1;
+
+ s = send;
+ while (isspace (*s))
+ ++s;
+
+ if (*s != '"')
+ return;
+
+ ++s;
+ send = strchr (s, '"');
+ if (send == NULL)
+ return;
+
+ fn = (char *) xmalloc (send - s + 1);
+ strncpy (fn, s, send - s);
+ fn[send - s] = '\0';
+
+ free (rc_filename);
+ rc_filename = fn;
+}
+
+/* Handle a quoted string. The quotes are stripped. A pair of quotes
+ in a string are turned into a single quote. Adjacent strings are
+ merged separated by whitespace are merged, as in C. */
+
+static char *
+handle_quotes (input, len)
+ const char *input;
+ unsigned long *len;
+{
+ char *ret, *s;
+ const char *t;
+ int ch;
+
+ ret = get_string (strlen (input) + 1);
+
+ s = ret;
+ t = input;
+ if (*t == '"')
+ ++t;
+ while (*t != '\0')
+ {
+ if (*t == '\\')
+ {
+ ++t;
+ switch (*t)
+ {
+ case '\0':
+ rcparse_warning ("backslash at end of string");
+ break;
+
+ case '\"':
+ rcparse_warning ("use \"\" to put \" in a string");
+ break;
+
+ case 'a':
+ *s++ = ESCAPE_A;
+ ++t;
+ break;
+
+ case 'b':
+ *s++ = ESCAPE_B;
+ ++t;
+ break;
+
+ case 'f':
+ *s++ = ESCAPE_F;
+ ++t;
+ break;
+
+ case 'n':
+ *s++ = ESCAPE_N;
+ ++t;
+ break;
+
+ case 'r':
+ *s++ = ESCAPE_R;
+ ++t;
+ break;
+
+ case 't':
+ *s++ = ESCAPE_T;
+ ++t;
+ break;
+
+ case 'v':
+ *s++ = ESCAPE_V;
+ ++t;
+ break;
+
+ case '\\':
+ *s++ = *t++;
+ break;
+
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ ch = *t - '0';
+ ++t;
+ if (*t >= '0' && *t <= '7')
+ {
+ ch = (ch << 3) | (*t - '0');
+ ++t;
+ if (*t >= '0' && *t <= '7')
+ {
+ ch = (ch << 3) | (*t - '0');
+ ++t;
+ }
+ }
+ *s++ = ch;
+ break;
+
+ case 'x':
+ ++t;
+ ch = 0;
+ while (1)
+ {
+ if (*t >= '0' && *t <= '9')
+ ch = (ch << 4) | (*t - '0');
+ else if (*t >= 'a' && *t <= 'f')
+ ch = (ch << 4) | (*t - 'a');
+ else if (*t >= 'A' && *t <= 'F')
+ ch = (ch << 4) | (*t - 'A');
+ else
+ break;
+ ++t;
+ }
+ *s++ = ch;
+ break;
+
+ default:
+ rcparse_warning ("unrecognized escape sequence");
+ *s++ = '\\';
+ *s++ = *t++;
+ break;
+ }
+ }
+ else if (*t != '"')
+ *s++ = *t++;
+ else if (t[1] == '\0')
+ break;
+ else if (t[1] == '"')
+ {
+ *s++ = '"';
+ t += 2;
+ }
+ else
+ {
+ ++t;
+ assert (isspace (*t));
+ while (isspace (*t))
+ ++t;
+ if (*t == '\0')
+ break;
+ assert (*t == '"');
+ ++t;
+ }
+ }
+
+ *s = '\0';
+
+ *len = s - ret;
+
+ return ret;
+}
+
+/* Allocate a string of a given length. */
+
+static char *
+get_string (len)
+ int len;
+{
+ struct alloc_string *as;
+
+ as = (struct alloc_string *) xmalloc (sizeof *as);
+ as->s = xmalloc (len);
+
+ as->next = strings;
+ strings = as->next;
+
+ return as->s;
+}
+
+/* Discard all the strings we have allocated. The parser calls this
+ when it no longer needs them. */
+
+void
+rcparse_discard_strings ()
+{
+ struct alloc_string *as;
+
+ as = strings;
+ while (as != NULL)
+ {
+ struct alloc_string *n;
+
+ free (as->s);
+ n = as->next;
+ free (as);
+ as = n;
+ }
+
+ strings = NULL;
+}
+
+/* Enter rcdata mode. */
+
+void
+rcparse_rcdata ()
+{
+ rcdata_mode = 1;
+}
+
+/* Go back to normal mode from rcdata mode. */
+
+void
+rcparse_normal ()
+{
+ rcdata_mode = 0;
+}
diff --git a/contrib/binutils/binutils/rcparse.c b/contrib/binutils/binutils/rcparse.c
new file mode 100644
index 0000000..767dbcf
--- /dev/null
+++ b/contrib/binutils/binutils/rcparse.c
@@ -0,0 +1,2993 @@
+
+/* A Bison parser, made from /5g/ian/binutils/release/copy/binutils/rcparse.y
+ by GNU Bison version 1.25
+ */
+
+#define YYBISON 1 /* Identify Bison output. */
+
+#define BEG 258
+#define END 259
+#define ACCELERATORS 260
+#define VIRTKEY 261
+#define ASCII 262
+#define NOINVERT 263
+#define SHIFT 264
+#define CONTROL 265
+#define ALT 266
+#define BITMAP 267
+#define CURSOR 268
+#define DIALOG 269
+#define DIALOGEX 270
+#define EXSTYLE 271
+#define CAPTION 272
+#define CLASS 273
+#define STYLE 274
+#define AUTO3STATE 275
+#define AUTOCHECKBOX 276
+#define AUTORADIOBUTTON 277
+#define CHECKBOX 278
+#define COMBOBOX 279
+#define CTEXT 280
+#define DEFPUSHBUTTON 281
+#define EDITTEXT 282
+#define GROUPBOX 283
+#define LISTBOX 284
+#define LTEXT 285
+#define PUSHBOX 286
+#define PUSHBUTTON 287
+#define RADIOBUTTON 288
+#define RTEXT 289
+#define SCROLLBAR 290
+#define STATE3 291
+#define USERBUTTON 292
+#define BEDIT 293
+#define HEDIT 294
+#define IEDIT 295
+#define FONT 296
+#define ICON 297
+#define LANGUAGE 298
+#define CHARACTERISTICS 299
+#define VERSIONK 300
+#define MENU 301
+#define MENUEX 302
+#define MENUITEM 303
+#define SEPARATOR 304
+#define POPUP 305
+#define CHECKED 306
+#define GRAYED 307
+#define HELP 308
+#define INACTIVE 309
+#define MENUBARBREAK 310
+#define MENUBREAK 311
+#define MESSAGETABLE 312
+#define RCDATA 313
+#define STRINGTABLE 314
+#define VERSIONINFO 315
+#define FILEVERSION 316
+#define PRODUCTVERSION 317
+#define FILEFLAGSMASK 318
+#define FILEFLAGS 319
+#define FILEOS 320
+#define FILETYPE 321
+#define FILESUBTYPE 322
+#define BLOCKSTRINGFILEINFO 323
+#define BLOCKVARFILEINFO 324
+#define VALUE 325
+#define BLOCK 326
+#define MOVEABLE 327
+#define FIXED 328
+#define PURE 329
+#define IMPURE 330
+#define PRELOAD 331
+#define LOADONCALL 332
+#define DISCARDABLE 333
+#define NOT 334
+#define QUOTEDSTRING 335
+#define STRING 336
+#define NUMBER 337
+#define SIZEDSTRING 338
+#define NEG 339
+
+#line 1 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+ /* rcparse.y -- parser for Windows rc files
+ Copyright 1997 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor, Cygnus Support.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/* This is a parser for Windows rc files. It is based on the parser
+ by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */
+
+#include "bfd.h"
+#include "bucomm.h"
+#include "libiberty.h"
+#include "windres.h"
+
+#include <ctype.h>
+
+/* The current language. */
+
+static unsigned short language;
+
+/* The resource information during a sub statement. */
+
+static struct res_res_info sub_res_info;
+
+/* Dialog information. This is built by the nonterminals styles and
+ controls. */
+
+static struct dialog dialog;
+
+/* This is used when building a style. It is modified by the
+ nonterminal styleexpr. */
+
+static unsigned long style;
+
+/* These are used when building a control. They are set before using
+ control_params. */
+
+static unsigned long base_style;
+static unsigned long default_style;
+static unsigned long class;
+
+
+#line 59 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+typedef union
+{
+ struct accelerator acc;
+ struct accelerator *pacc;
+ struct dialog_control *dialog_control;
+ struct menuitem *menuitem;
+ struct
+ {
+ struct rcdata_item *first;
+ struct rcdata_item *last;
+ } rcdata;
+ struct rcdata_item *rcdata_item;
+ struct stringtable_data *stringtable;
+ struct fixed_versioninfo *fixver;
+ struct ver_info *verinfo;
+ struct ver_stringinfo *verstring;
+ struct ver_varinfo *vervar;
+ struct res_id id;
+ struct res_res_info res_info;
+ struct
+ {
+ unsigned short on;
+ unsigned short off;
+ } memflags;
+ struct
+ {
+ unsigned long val;
+ /* Nonzero if this number was explicitly specified as long. */
+ int dword;
+ } i;
+ unsigned long il;
+ unsigned short is;
+ const char *s;
+ struct
+ {
+ unsigned long length;
+ const char *s;
+ } ss;
+} YYSTYPE;
+#include <stdio.h>
+
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
+#endif
+
+
+
+#define YYFINAL 462
+#define YYFLAG -32768
+#define YYNTBASE 98
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 339 ? yytranslate[x] : 188)
+
+static const char yytranslate[] = { 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 91, 86, 2, 96,
+ 97, 89, 87, 94, 88, 2, 90, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 95, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 85, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 84, 2, 92, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 93
+};
+
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 1, 5, 9, 13, 17, 21, 25, 29, 33,
+ 37, 41, 45, 49, 53, 57, 58, 65, 66, 69,
+ 72, 77, 79, 81, 83, 87, 90, 92, 94, 96,
+ 98, 100, 102, 107, 112, 113, 127, 128, 142, 143,
+ 158, 159, 163, 164, 168, 172, 173, 178, 182, 188,
+ 196, 200, 204, 209, 213, 214, 217, 218, 222, 223,
+ 227, 228, 232, 233, 237, 238, 242, 243, 247, 259,
+ 272, 273, 277, 278, 282, 283, 287, 288, 292, 293,
+ 297, 304, 315, 327, 328, 332, 333, 337, 338, 342,
+ 343, 347, 348, 352, 353, 357, 358, 362, 363, 367,
+ 368, 372, 373, 390, 398, 408, 419, 420, 423, 424,
+ 428, 429, 433, 434, 438, 439, 443, 448, 453, 457,
+ 464, 465, 468, 473, 476, 483, 484, 488, 491, 493,
+ 495, 497, 499, 501, 503, 510, 511, 514, 517, 521,
+ 527, 533, 540, 548, 558, 563, 570, 571, 574, 575,
+ 577, 579, 581, 585, 589, 590, 597, 598, 602, 607,
+ 614, 619, 626, 627, 634, 641, 645, 649, 653, 657,
+ 661, 662, 671, 679, 680, 686, 687, 691, 693, 695,
+ 696, 699, 703, 708, 712, 713, 716, 717, 720, 722,
+ 724, 726, 728, 730, 732, 734, 736, 738, 740, 743,
+ 747, 752, 754, 758, 759, 761, 764, 766, 768, 772,
+ 775, 778, 782, 786, 790, 794, 798, 802, 806, 810,
+ 813, 815, 817, 821, 824, 828, 832, 836, 840, 844,
+ 848, 852
+};
+
+static const short yyrhs[] = { -1,
+ 98, 99, 100, 0, 98, 99, 106, 0, 98, 99,
+ 107, 0, 98, 99, 108, 0, 98, 99, 147, 0,
+ 98, 99, 148, 0, 98, 99, 149, 0, 98, 99,
+ 150, 0, 98, 99, 155, 0, 98, 99, 158, 0,
+ 98, 99, 159, 0, 98, 99, 164, 0, 98, 99,
+ 167, 0, 98, 99, 168, 0, 0, 173, 5, 174,
+ 3, 101, 4, 0, 0, 101, 102, 0, 103, 185,
+ 0, 103, 185, 94, 104, 0, 80, 0, 186, 0,
+ 105, 0, 104, 94, 105, 0, 104, 105, 0, 6,
+ 0, 7, 0, 8, 0, 9, 0, 10, 0, 11,
+ 0, 173, 12, 176, 178, 0, 173, 13, 175, 178,
+ 0, 0, 173, 14, 176, 112, 186, 182, 182, 182,
+ 109, 113, 3, 115, 4, 0, 0, 173, 15, 176,
+ 112, 186, 182, 182, 182, 110, 113, 3, 115, 4,
+ 0, 0, 173, 15, 176, 112, 186, 182, 182, 182,
+ 182, 111, 113, 3, 115, 4, 0, 0, 16, 95,
+ 183, 0, 0, 113, 17, 80, 0, 113, 18, 173,
+ 0, 0, 113, 19, 114, 179, 0, 113, 16, 183,
+ 0, 113, 41, 183, 94, 80, 0, 113, 41, 183,
+ 94, 80, 182, 182, 0, 113, 46, 173, 0, 113,
+ 44, 183, 0, 113, 43, 183, 182, 0, 113, 45,
+ 183, 0, 0, 115, 116, 0, 0, 20, 117, 138,
+ 0, 0, 21, 118, 138, 0, 0, 22, 119, 138,
+ 0, 0, 38, 120, 138, 0, 0, 23, 121, 138,
+ 0, 0, 24, 122, 138, 0, 10, 139, 183, 182,
+ 141, 182, 182, 182, 182, 181, 140, 0, 10, 139,
+ 183, 182, 141, 182, 182, 182, 182, 182, 182, 140,
+ 0, 0, 25, 123, 138, 0, 0, 26, 124, 138,
+ 0, 0, 27, 125, 138, 0, 0, 28, 126, 138,
+ 0, 0, 39, 127, 138, 0, 42, 139, 183, 182,
+ 182, 140, 0, 42, 139, 183, 182, 182, 182, 182,
+ 143, 181, 140, 0, 42, 139, 183, 182, 182, 182,
+ 182, 143, 182, 182, 140, 0, 0, 40, 128, 138,
+ 0, 0, 29, 129, 138, 0, 0, 30, 130, 138,
+ 0, 0, 31, 131, 138, 0, 0, 32, 132, 138,
+ 0, 0, 33, 133, 138, 0, 0, 34, 134, 138,
+ 0, 0, 35, 135, 138, 0, 0, 36, 136, 138,
+ 0, 0, 37, 80, 94, 183, 94, 183, 94, 183,
+ 94, 183, 94, 183, 94, 137, 179, 181, 0, 139,
+ 183, 182, 182, 182, 182, 140, 0, 139, 183, 182,
+ 182, 182, 182, 145, 181, 140, 0, 139, 183, 182,
+ 182, 182, 182, 145, 182, 182, 140, 0, 0, 80,
+ 94, 0, 0, 3, 160, 4, 0, 0, 94, 142,
+ 179, 0, 0, 94, 144, 179, 0, 0, 94, 146,
+ 179, 0, 173, 41, 175, 178, 0, 173, 42, 175,
+ 178, 0, 43, 183, 182, 0, 173, 46, 174, 3,
+ 151, 4, 0, 0, 151, 152, 0, 48, 80, 182,
+ 153, 0, 48, 49, 0, 50, 80, 153, 3, 151,
+ 4, 0, 0, 153, 94, 154, 0, 153, 154, 0,
+ 51, 0, 52, 0, 53, 0, 54, 0, 55, 0,
+ 56, 0, 173, 47, 174, 3, 156, 4, 0, 0,
+ 156, 157, 0, 48, 80, 0, 48, 80, 182, 0,
+ 48, 80, 182, 182, 181, 0, 50, 80, 3, 156,
+ 4, 0, 50, 80, 182, 3, 156, 4, 0, 50,
+ 80, 182, 182, 3, 156, 4, 0, 50, 80, 182,
+ 182, 182, 181, 3, 156, 4, 0, 173, 57, 176,
+ 178, 0, 173, 58, 174, 3, 160, 4, 0, 0,
+ 161, 162, 0, 0, 163, 0, 83, 0, 184, 0,
+ 163, 94, 83, 0, 163, 94, 184, 0, 0, 59,
+ 174, 3, 165, 166, 4, 0, 0, 166, 183, 80,
+ 0, 166, 183, 94, 80, 0, 173, 173, 174, 3,
+ 160, 4, 0, 173, 173, 174, 178, 0, 173, 60,
+ 169, 3, 170, 4, 0, 0, 169, 61, 183, 182,
+ 182, 182, 0, 169, 62, 183, 182, 182, 182, 0,
+ 169, 63, 183, 0, 169, 64, 183, 0, 169, 65,
+ 183, 0, 169, 66, 183, 0, 169, 67, 183, 0,
+ 0, 170, 68, 3, 71, 3, 171, 4, 4, 0,
+ 170, 69, 3, 70, 80, 172, 4, 0, 0, 171,
+ 70, 80, 94, 80, 0, 0, 172, 182, 182, 0,
+ 186, 0, 81, 0, 0, 174, 177, 0, 174, 44,
+ 183, 0, 174, 43, 183, 182, 0, 174, 45, 183,
+ 0, 0, 175, 177, 0, 0, 175, 177, 0, 72,
+ 0, 73, 0, 74, 0, 75, 0, 76, 0, 77,
+ 0, 78, 0, 80, 0, 81, 0, 180, 0, 79,
+ 180, 0, 179, 84, 180, 0, 179, 84, 79, 180,
+ 0, 82, 0, 96, 183, 97, 0, 0, 182, 0,
+ 94, 183, 0, 184, 0, 82, 0, 96, 184, 97,
+ 0, 92, 184, 0, 88, 184, 0, 184, 89, 184,
+ 0, 184, 90, 184, 0, 184, 91, 184, 0, 184,
+ 87, 184, 0, 184, 88, 184, 0, 184, 86, 184,
+ 0, 184, 85, 184, 0, 184, 84, 184, 0, 94,
+ 186, 0, 187, 0, 82, 0, 96, 184, 97, 0,
+ 92, 184, 0, 187, 89, 184, 0, 187, 90, 184,
+ 0, 187, 91, 184, 0, 187, 87, 184, 0, 187,
+ 88, 184, 0, 187, 86, 184, 0, 187, 85, 184,
+ 0, 187, 84, 184, 0
+};
+
+#endif
+
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 154, 156, 157, 158, 159, 160, 161, 162, 163, 164,
+ 165, 166, 167, 168, 169, 172, 181, 188, 193, 213,
+ 219, 230, 252, 261, 266, 271, 277, 282, 287, 291,
+ 295, 299, 307, 316, 325, 343, 347, 366, 370, 390,
+ 396, 401, 407, 409, 413, 417, 420, 423, 427, 433,
+ 446, 450, 454, 458, 464, 466, 476, 484, 487, 494,
+ 497, 504, 507, 514, 520, 527, 530, 537, 540, 551,
+ 560, 567, 570, 577, 580, 587, 590, 597, 600, 607,
+ 613, 624, 636, 646, 653, 659, 666, 669, 676, 679,
+ 686, 689, 696, 699, 706, 709, 716, 719, 726, 729,
+ 736, 739, 742, 756, 769, 780, 791, 796, 802, 807,
+ 815, 819, 821, 825, 827, 831, 835, 844, 854, 863,
+ 870, 875, 891, 896, 900, 906, 911, 915, 921, 926,
+ 930, 934, 938, 942, 950, 957, 962, 978, 983, 987,
+ 991, 995, 999, 1003, 1012, 1021, 1031, 1036, 1042, 1048,
+ 1054, 1063, 1071, 1080, 1093, 1096, 1099, 1101, 1105, 1114,
+ 1119, 1127, 1134, 1141, 1147, 1153, 1158, 1163, 1168, 1173,
+ 1186, 1191, 1195, 1201, 1206, 1212, 1217, 1225, 1231, 1248,
+ 1256, 1262, 1267, 1272, 1281, 1288, 1298, 1305, 1316, 1322,
+ 1327, 1332, 1337, 1342, 1347, 1356, 1361, 1377, 1382, 1386,
+ 1390, 1396, 1401, 1409, 1414, 1422, 1431, 1440, 1445, 1449,
+ 1454, 1459, 1464, 1469, 1474, 1479, 1484, 1489, 1494, 1504,
+ 1513, 1524, 1529, 1533, 1538, 1543, 1548, 1553, 1558, 1563,
+ 1568, 1573
+};
+#endif
+
+
+#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+
+static const char * const yytname[] = { "$","error","$undefined.","BEG","END",
+"ACCELERATORS","VIRTKEY","ASCII","NOINVERT","SHIFT","CONTROL","ALT","BITMAP",
+"CURSOR","DIALOG","DIALOGEX","EXSTYLE","CAPTION","CLASS","STYLE","AUTO3STATE",
+"AUTOCHECKBOX","AUTORADIOBUTTON","CHECKBOX","COMBOBOX","CTEXT","DEFPUSHBUTTON",
+"EDITTEXT","GROUPBOX","LISTBOX","LTEXT","PUSHBOX","PUSHBUTTON","RADIOBUTTON",
+"RTEXT","SCROLLBAR","STATE3","USERBUTTON","BEDIT","HEDIT","IEDIT","FONT","ICON",
+"LANGUAGE","CHARACTERISTICS","VERSIONK","MENU","MENUEX","MENUITEM","SEPARATOR",
+"POPUP","CHECKED","GRAYED","HELP","INACTIVE","MENUBARBREAK","MENUBREAK","MESSAGETABLE",
+"RCDATA","STRINGTABLE","VERSIONINFO","FILEVERSION","PRODUCTVERSION","FILEFLAGSMASK",
+"FILEFLAGS","FILEOS","FILETYPE","FILESUBTYPE","BLOCKSTRINGFILEINFO","BLOCKVARFILEINFO",
+"VALUE","BLOCK","MOVEABLE","FIXED","PURE","IMPURE","PRELOAD","LOADONCALL","DISCARDABLE",
+"NOT","QUOTEDSTRING","STRING","NUMBER","SIZEDSTRING","'|'","'^'","'&'","'+'",
+"'-'","'*'","'/'","'%'","'~'","NEG","','","'='","'('","')'","input","newcmd",
+"accelerator","acc_entries","acc_entry","acc_event","acc_options","acc_option",
+"bitmap","cursor","dialog","@1","@2","@3","exstyle","styles","@4","controls",
+"control","@5","@6","@7","@8","@9","@10","@11","@12","@13","@14","@15","@16",
+"@17","@18","@19","@20","@21","@22","@23","@24","@25","control_params","optstringc",
+"opt_control_data","control_styleexpr","@26","icon_styleexpr","@27","control_params_styleexpr",
+"@28","font","icon","language","menu","menuitems","menuitem","menuitem_flags",
+"menuitem_flag","menuex","menuexitems","menuexitem","messagetable","rcdata",
+"optrcdata_data","@29","optrcdata_data_int","rcdata_data","stringtable","@30",
+"string_data","user","versioninfo","fixedverinfo","verblocks","vervals","vertrans",
+"id","suboptions","memflags_move_discard","memflags_move","memflag","file_name",
+"styleexpr","parennumber","optcnumexpr","cnumexpr","numexpr","sizednumexpr",
+"cposnumexpr","posnumexpr","sizedposnumexpr", NULL
+};
+#endif
+
+static const short yyr1[] = { 0,
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
+ 98, 98, 98, 98, 98, 99, 100, 101, 101, 102,
+ 102, 103, 103, 104, 104, 104, 105, 105, 105, 105,
+ 105, 105, 106, 107, 109, 108, 110, 108, 111, 108,
+ 112, 112, 113, 113, 113, 114, 113, 113, 113, 113,
+ 113, 113, 113, 113, 115, 115, 117, 116, 118, 116,
+ 119, 116, 120, 116, 121, 116, 122, 116, 116, 116,
+ 123, 116, 124, 116, 125, 116, 126, 116, 127, 116,
+ 116, 116, 116, 128, 116, 129, 116, 130, 116, 131,
+ 116, 132, 116, 133, 116, 134, 116, 135, 116, 136,
+ 116, 137, 116, 138, 138, 138, 139, 139, 140, 140,
+ 142, 141, 144, 143, 146, 145, 147, 148, 149, 150,
+ 151, 151, 152, 152, 152, 153, 153, 153, 154, 154,
+ 154, 154, 154, 154, 155, 156, 156, 157, 157, 157,
+ 157, 157, 157, 157, 158, 159, 161, 160, 162, 162,
+ 163, 163, 163, 163, 165, 164, 166, 166, 166, 167,
+ 167, 168, 169, 169, 169, 169, 169, 169, 169, 169,
+ 170, 170, 170, 171, 171, 172, 172, 173, 173, 174,
+ 174, 174, 174, 174, 175, 175, 176, 176, 177, 177,
+ 177, 177, 177, 177, 177, 178, 178, 179, 179, 179,
+ 179, 180, 180, 181, 181, 182, 183, 184, 184, 184,
+ 184, 184, 184, 184, 184, 184, 184, 184, 184, 185,
+ 186, 187, 187, 187, 187, 187, 187, 187, 187, 187,
+ 187, 187
+};
+
+static const short yyr2[] = { 0,
+ 0, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 0, 6, 0, 2, 2,
+ 4, 1, 1, 1, 3, 2, 1, 1, 1, 1,
+ 1, 1, 4, 4, 0, 13, 0, 13, 0, 14,
+ 0, 3, 0, 3, 3, 0, 4, 3, 5, 7,
+ 3, 3, 4, 3, 0, 2, 0, 3, 0, 3,
+ 0, 3, 0, 3, 0, 3, 0, 3, 11, 12,
+ 0, 3, 0, 3, 0, 3, 0, 3, 0, 3,
+ 6, 10, 11, 0, 3, 0, 3, 0, 3, 0,
+ 3, 0, 3, 0, 3, 0, 3, 0, 3, 0,
+ 3, 0, 16, 7, 9, 10, 0, 2, 0, 3,
+ 0, 3, 0, 3, 0, 3, 4, 4, 3, 6,
+ 0, 2, 4, 2, 6, 0, 3, 2, 1, 1,
+ 1, 1, 1, 1, 6, 0, 2, 2, 3, 5,
+ 5, 6, 7, 9, 4, 6, 0, 2, 0, 1,
+ 1, 1, 3, 3, 0, 6, 0, 3, 4, 6,
+ 4, 6, 0, 6, 6, 3, 3, 3, 3, 3,
+ 0, 8, 7, 0, 5, 0, 3, 1, 1, 0,
+ 2, 3, 4, 3, 0, 2, 0, 2, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 4, 1, 3, 0, 1, 2, 1, 1, 3, 2,
+ 2, 3, 3, 3, 3, 3, 3, 3, 3, 2,
+ 1, 1, 3, 2, 3, 3, 3, 3, 3, 3,
+ 3, 3
+};
+
+static const short yydefact[] = { 1,
+ 16, 0, 0, 180, 179, 222, 0, 0, 2, 3,
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 0, 178, 221, 208, 0, 0, 0, 0,
+ 207, 0, 224, 0, 180, 185, 185, 185, 185, 185,
+ 185, 180, 180, 185, 180, 163, 180, 0, 0, 0,
+ 0, 0, 0, 0, 0, 211, 210, 0, 0, 119,
+ 0, 0, 0, 0, 0, 0, 0, 0, 155, 0,
+ 0, 0, 189, 190, 191, 192, 193, 194, 195, 181,
+ 223, 0, 0, 0, 0, 41, 41, 0, 0, 0,
+ 0, 0, 0, 0, 0, 232, 231, 230, 228, 229,
+ 225, 226, 227, 209, 206, 219, 218, 217, 215, 216,
+ 212, 213, 214, 157, 0, 182, 184, 18, 186, 196,
+ 197, 33, 186, 34, 0, 0, 0, 117, 118, 121,
+ 136, 145, 147, 171, 0, 0, 0, 0, 0, 0,
+ 0, 147, 161, 0, 183, 0, 0, 0, 0, 0,
+ 0, 0, 149, 0, 0, 0, 166, 167, 168, 169,
+ 170, 0, 156, 0, 17, 22, 19, 0, 23, 42,
+ 0, 0, 120, 0, 0, 122, 135, 0, 0, 137,
+ 146, 151, 148, 150, 152, 162, 0, 0, 0, 0,
+ 160, 158, 0, 0, 20, 0, 0, 124, 0, 126,
+ 138, 0, 0, 0, 0, 0, 0, 159, 220, 0,
+ 35, 37, 126, 0, 139, 136, 0, 153, 154, 0,
+ 0, 164, 165, 27, 28, 29, 30, 31, 32, 21,
+ 24, 43, 43, 39, 123, 121, 129, 130, 131, 132,
+ 133, 134, 0, 128, 204, 0, 136, 0, 174, 176,
+ 0, 26, 0, 0, 43, 0, 127, 140, 205, 141,
+ 0, 136, 204, 0, 0, 25, 55, 0, 0, 0,
+ 46, 0, 0, 0, 0, 0, 55, 0, 125, 142,
+ 0, 0, 0, 0, 173, 0, 0, 48, 44, 45,
+ 0, 0, 0, 52, 54, 51, 0, 55, 143, 136,
+ 172, 0, 177, 36, 107, 57, 59, 61, 65, 67,
+ 71, 73, 75, 77, 86, 88, 90, 92, 94, 96,
+ 98, 100, 0, 63, 79, 84, 107, 56, 0, 202,
+ 0, 47, 198, 0, 53, 38, 0, 0, 0, 0,
+ 0, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 0, 107,
+ 107, 107, 0, 199, 0, 0, 49, 40, 144, 175,
+ 108, 0, 58, 0, 60, 62, 66, 68, 72, 74,
+ 76, 78, 87, 89, 91, 93, 95, 97, 99, 101,
+ 0, 64, 80, 85, 0, 203, 0, 200, 0, 0,
+ 0, 0, 0, 201, 50, 111, 0, 0, 0, 109,
+ 0, 0, 0, 0, 147, 81, 0, 112, 0, 0,
+ 0, 0, 0, 0, 109, 0, 110, 113, 204, 204,
+ 115, 104, 204, 0, 0, 109, 205, 109, 205, 0,
+ 109, 205, 0, 114, 82, 109, 69, 109, 116, 105,
+ 109, 0, 83, 70, 106, 0, 102, 0, 204, 103,
+ 0, 0
+};
+
+static const short yydefgoto[] = { 1,
+ 2, 9, 146, 167, 168, 230, 231, 10, 11, 12,
+ 232, 233, 255, 126, 253, 291, 287, 328, 342, 343,
+ 344, 360, 345, 346, 347, 348, 349, 350, 361, 362,
+ 351, 352, 353, 354, 355, 356, 357, 358, 458, 373,
+ 374, 416, 407, 411, 429, 435, 433, 440, 13, 14,
+ 15, 16, 150, 176, 214, 244, 17, 151, 180, 18,
+ 19, 152, 153, 183, 184, 20, 114, 144, 21, 22,
+ 94, 154, 264, 265, 23, 32, 83, 84, 80, 122,
+ 332, 333, 258, 259, 30, 31, 195, 24, 25
+};
+
+static const short yypact[] = {-32768,
+ 41, 97, 496,-32768,-32768,-32768, 496, 496,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 149,-32768, 419,-32768, 496, 496, 496, -49,
+ 456, 214,-32768, 533,-32768, -75,-32768, -12, -12,-32768,
+-32768,-32768,-32768, -75,-32768,-32768,-32768, 496, 496, 496,
+ 496, 496, 496, 496, 496,-32768,-32768, 547, 496,-32768,
+ 496, 496, 496, 496, 496, 496, 496, 496,-32768, 496,
+ 496, 496,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768, 234, 583, 2, 573, 95, 95, 573, 573, 257,
+ 277, 2, 341, 295, 195, 577, 366, 538, 163, 163,
+-32768,-32768,-32768,-32768,-32768, 577, 366, 538, 163, 163,
+-32768,-32768,-32768,-32768, -49,-32768,-32768,-32768, 53,-32768,
+-32768,-32768,-32768,-32768, 33, 123, 123,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768, 496, 496, 496, 496, 496, 496,
+ 496,-32768,-32768, 14,-32768, 17, 496, -49, -49, 38,
+ 100, 127, 231, 55, -49, -49,-32768,-32768,-32768,-32768,
+-32768, 132,-32768, -77,-32768,-32768,-32768, 45,-32768,-32768,
+ -49, -49,-32768, 66, 63,-32768,-32768, 64, 67,-32768,
+-32768,-32768,-32768, 76, 456,-32768, 171, 180, -49, -49,
+-32768,-32768, 106, 123, 98, -49, -49,-32768, -49,-32768,
+ -49, 6, 309, 128, 131, -49, -49,-32768,-32768, 663,
+-32768, -49,-32768, 20, -49,-32768, 9,-32768, 456, 205,
+ 136,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 26,
+-32768,-32768,-32768,-32768, 376,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 624,-32768, -49, 125,-32768, 13,-32768,-32768,
+ 663,-32768, 405, 417,-32768, 154,-32768,-32768,-32768,-32768,
+ 164,-32768, -49, 7, 11,-32768,-32768, 496, 144, 169,
+-32768, 496, 496, 496, 496, 169,-32768, 423,-32768,-32768,
+ 184, 230, 232, 162,-32768, -49, 455,-32768,-32768,-32768,
+ -39, 153, -49,-32768,-32768,-32768, 492,-32768,-32768,-32768,
+-32768, 168,-32768,-32768, 186,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 201,-32768,-32768,-32768, 186,-32768, 34,-32768,
+ 496, 159,-32768, 202,-32768,-32768, 529, 196, 203, 170,
+ 496, 186, 186, 186, 186, 186, 186, 186, 186, 186,
+ 186, 186, 186, 186, 186, 186, 186, 186, 190, 186,
+ 186, 186, 496,-32768, 151, 115, -49,-32768,-32768,-32768,
+-32768, -49,-32768, 496,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+ 496,-32768,-32768,-32768, -49,-32768, 34,-32768, -49, 200,
+ -49, 209, -49,-32768,-32768,-32768, -49, -49, 496, 27,
+ -39, -49, -49, 210,-32768,-32768, -49, 159, -49, -49,
+ 496, 301, 221, -49, 28, 222,-32768,-32768, -49, -49,
+-32768,-32768, -49, 496, -39, 296, -49, 296, -49, -39,
+ 296, -49, 224, 159,-32768, 296,-32768, 296, 159,-32768,
+ 296, 496,-32768,-32768,-32768, 244,-32768, -39, -38,-32768,
+ 324,-32768
+};
+
+static const short yypgoto[] = {-32768,
+-32768,-32768,-32768,-32768,-32768,-32768, -172,-32768,-32768,-32768,
+-32768,-32768,-32768, 238, -211,-32768, -160,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 254,
+ -267, 145,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768, 90,-32768, 134, 105,-32768, -135,-32768,-32768,
+-32768, -141,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768, -21, 178, 256, 113, 491, 251,
+ -303, -319, -249, -30, -46, 0,-32768, -107,-32768
+};
+
+
+#define YYLAST 680
+
+
+static const short yytable[] = { 60,
+ 162, 47, 192, -187, -187, -187, 33, 34, 216, 364,
+ 283, 247, 105, 282, 285, 262, 193, 163, 148, 149,
+ 165, 254, 236, 115, 116, 117, 56, 57, 58, 415,
+ 415, 224, 225, 226, 227, 228, 229, 341, 169, 329,
+ 461, 173, 330, 278, 59, 366, 398, 96, 97, 98,
+ 99, 100, 101, 102, 103, 59, 331, 252, 186, 363,
+ 106, 107, 108, 109, 110, 111, 112, 113, -188, -187,
+ 237, 238, 239, 240, 241, 242, 284, 404, 266, -187,
+ 246, 120, 121, -187, 145, 174, 209, 175, 155, 156,
+ 157, 158, 159, 160, 161, 26, 166, 164, 6, 59,
+ 170, 27, 59, 177, 59, 28, 59, 418, 7, 29,
+ 125, 261, 8, 243, 198, 330, 297, 171, 172, 251,
+ 59, 431, 187, 188, 189, 190, 281, 147, 260, 331,
+ 181, 444, -188, -188, -188, 191, 449, 337, 194, 3,
+ 196, 197, 200, 201, -188, 199, 202, 178, -188, 179,
+ 86, 87, 185, 35, 459, 4, 92, 279, 206, 207,
+ 36, 37, 38, 39, 338, 211, 212, 280, 213, 203,
+ 215, 217, 178, 204, 179, 222, 223, 5, 6, 436,
+ 438, 234, 205, 441, 245, 208, 248, 299, 7, 40,
+ 41, 210, 8, 397, 42, 43, 330, 142, 220, 369,
+ 221, 174, 219, 175, 6, 44, 45, 249, 46, 460,
+ 331, 178, 82, 179, 7, 250, 69, 263, 8, 90,
+ 91, 288, 93, 289, 95, 292, 293, 294, 295, 5,
+ 6, 178, 300, 179, 286, 301, 118, 70, 71, 72,
+ 7, 302, 366, 178, 8, 179, 334, 396, 290, 5,
+ 6, 66, 67, 68, 296, 303, 70, 71, 72, 130,
+ 7, 339, 335, 371, 8, 340, 73, 74, 75, 76,
+ 77, 78, 79, 422, 120, 121, 70, 71, 72, 131,
+ 359, 367, 370, 391, 365, 73, 74, 75, 76, 77,
+ 78, 79, 85, 406, 372, 88, 89, 134, 415, 70,
+ 71, 72, 409, 421, 427, 73, 74, 75, 76, 77,
+ 78, 79, 26, 182, 428, 434, 395, 452, 27, 70,
+ 71, 72, 28, 462, 127, 256, 29, 401, 73, 74,
+ 75, 76, 77, 78, 79, 124, 399, 457, 128, 129,
+ 0, 400, 132, 133, 402, 143, 235, 257, 73, 74,
+ 75, 76, 77, 78, 79, 135, 136, 137, 138, 139,
+ 140, 141, 414, 0, 403, 0, 0, 0, 405, 0,
+ 408, 0, 410, 0, 426, 0, 412, 413, 0, 417,
+ 0, 419, 420, 70, 71, 72, 423, 443, 424, 425,
+ 26, 218, 0, 430, 0, 0, 27, 0, 437, 439,
+ 28, 0, 442, 0, 29, 456, 446, 267, 448, 0,
+ 0, 451, 73, 74, 75, 76, 77, 78, 79, 277,
+ 268, 269, 270, 271, 0, 298, 237, 238, 239, 240,
+ 241, 242, 268, 269, 270, 271, 0, 0, 268, 269,
+ 270, 271, 0, 0, 0, 272, 0, 273, 274, 275,
+ 276, 63, 64, 65, 66, 67, 68, 272, 304, 273,
+ 274, 275, 276, 272, 305, 273, 274, 275, 276, 243,
+ 0, 0, 0, 0, 306, 307, 308, 309, 310, 311,
+ 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
+ 322, 323, 324, 325, 326, 336, 327, 0, 0, 0,
+ 0, 305, 48, 49, 50, 51, 52, 53, 54, 55,
+ 0, 306, 307, 308, 309, 310, 311, 312, 313, 314,
+ 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
+ 325, 326, 368, 327, 0, 0, 0, 0, 305, 61,
+ 62, 63, 64, 65, 66, 67, 68, 0, 306, 307,
+ 308, 309, 310, 311, 312, 313, 314, 315, 316, 317,
+ 318, 319, 320, 321, 322, 323, 324, 325, 326, 432,
+ 327, 0, 0, 119, 0, 123, 0, 26, 123, 123,
+ 445, 0, 447, 27, 0, 450, 0, 28, 0, 0,
+ 453, 29, 454, 0, 0, 455, 375, 376, 377, 378,
+ 379, 380, 381, 382, 383, 384, 385, 386, 387, 388,
+ 389, 390, 0, 392, 393, 394, 61, 62, 63, 64,
+ 65, 66, 67, 68, 64, 65, 66, 67, 68, 81,
+ 61, 62, 63, 64, 65, 66, 67, 68, 0, 0,
+ 0, 0, 0, 104, 73, 74, 75, 76, 77, 78,
+ 79, 0, 120, 121, 73, 74, 75, 76, 77, 78,
+ 79, 62, 63, 64, 65, 66, 67, 68, 224, 225,
+ 226, 227, 228, 229, 237, 238, 239, 240, 241, 242
+};
+
+static const short yycheck[] = { 30,
+ 142, 23, 80, 16, 80, 81, 7, 8, 3, 329,
+ 4, 3, 59, 263, 4, 3, 94, 4, 126, 127,
+ 4, 233, 3, 70, 71, 72, 27, 28, 29, 3,
+ 3, 6, 7, 8, 9, 10, 11, 305, 146, 79,
+ 0, 4, 82, 255, 94, 84, 366, 48, 49, 50,
+ 51, 52, 53, 54, 55, 94, 96, 230, 4, 327,
+ 61, 62, 63, 64, 65, 66, 67, 68, 16, 82,
+ 51, 52, 53, 54, 55, 56, 70, 397, 251, 92,
+ 216, 80, 81, 96, 115, 48, 194, 50, 135, 136,
+ 137, 138, 139, 140, 141, 82, 80, 144, 82, 94,
+ 147, 88, 94, 4, 94, 92, 94, 411, 92, 96,
+ 16, 247, 96, 94, 49, 82, 277, 148, 149, 94,
+ 94, 94, 68, 69, 155, 156, 262, 95, 4, 96,
+ 4, 435, 80, 81, 82, 4, 440, 298, 94, 43,
+ 171, 172, 80, 80, 92, 80, 80, 48, 96, 50,
+ 38, 39, 153, 5, 458, 59, 44, 4, 189, 190,
+ 12, 13, 14, 15, 300, 196, 197, 4, 199, 94,
+ 201, 202, 48, 3, 50, 206, 207, 81, 82, 429,
+ 430, 212, 3, 433, 215, 80, 217, 4, 92, 41,
+ 42, 94, 96, 79, 46, 47, 82, 3, 71, 4,
+ 70, 48, 203, 50, 82, 57, 58, 3, 60, 459,
+ 96, 48, 35, 50, 92, 80, 3, 248, 96, 42,
+ 43, 268, 45, 80, 47, 272, 273, 274, 275, 81,
+ 82, 48, 3, 50, 265, 4, 3, 43, 44, 45,
+ 92, 80, 84, 48, 96, 50, 94, 97, 270, 81,
+ 82, 89, 90, 91, 276, 286, 43, 44, 45, 3,
+ 92, 94, 293, 94, 96, 80, 72, 73, 74, 75,
+ 76, 77, 78, 415, 80, 81, 43, 44, 45, 3,
+ 80, 80, 80, 94, 331, 72, 73, 74, 75, 76,
+ 77, 78, 37, 94, 341, 40, 41, 3, 3, 43,
+ 44, 45, 94, 94, 4, 72, 73, 74, 75, 76,
+ 77, 78, 82, 83, 94, 94, 363, 94, 88, 43,
+ 44, 45, 92, 0, 87, 236, 96, 374, 72, 73,
+ 74, 75, 76, 77, 78, 85, 367, 94, 88, 89,
+ -1, 372, 92, 3, 391, 95, 213, 243, 72, 73,
+ 74, 75, 76, 77, 78, 61, 62, 63, 64, 65,
+ 66, 67, 409, -1, 395, -1, -1, -1, 399, -1,
+ 401, -1, 403, -1, 421, -1, 407, 408, -1, 410,
+ -1, 412, 413, 43, 44, 45, 417, 434, 419, 420,
+ 82, 83, -1, 424, -1, -1, 88, -1, 429, 430,
+ 92, -1, 433, -1, 96, 452, 437, 3, 439, -1,
+ -1, 442, 72, 73, 74, 75, 76, 77, 78, 3,
+ 16, 17, 18, 19, -1, 3, 51, 52, 53, 54,
+ 55, 56, 16, 17, 18, 19, -1, -1, 16, 17,
+ 18, 19, -1, -1, -1, 41, -1, 43, 44, 45,
+ 46, 86, 87, 88, 89, 90, 91, 41, 4, 43,
+ 44, 45, 46, 41, 10, 43, 44, 45, 46, 94,
+ -1, -1, -1, -1, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 4, 42, -1, -1, -1,
+ -1, 10, 84, 85, 86, 87, 88, 89, 90, 91,
+ -1, 20, 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 4, 42, -1, -1, -1, -1, 10, 84,
+ 85, 86, 87, 88, 89, 90, 91, -1, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 425,
+ 42, -1, -1, 83, -1, 85, -1, 82, 88, 89,
+ 436, -1, 438, 88, -1, 441, -1, 92, -1, -1,
+ 446, 96, 448, -1, -1, 451, 343, 344, 345, 346,
+ 347, 348, 349, 350, 351, 352, 353, 354, 355, 356,
+ 357, 358, -1, 360, 361, 362, 84, 85, 86, 87,
+ 88, 89, 90, 91, 87, 88, 89, 90, 91, 97,
+ 84, 85, 86, 87, 88, 89, 90, 91, -1, -1,
+ -1, -1, -1, 97, 72, 73, 74, 75, 76, 77,
+ 78, -1, 80, 81, 72, 73, 74, 75, 76, 77,
+ 78, 85, 86, 87, 88, 89, 90, 91, 6, 7,
+ 8, 9, 10, 11, 51, 52, 53, 54, 55, 56
+};
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/usr/cygnus/progressive-97r2/share/bison.simple"
+
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+#ifndef alloca
+#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
+#include <alloca.h>
+#else /* not sparc */
+#if defined (MSDOS) && !defined (__TURBOC__)
+#include <malloc.h>
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+#include <malloc.h>
+ #pragma alloca
+#else /* not MSDOS, __TURBOC__, or _AIX */
+#ifdef __hpux
+#ifdef __cplusplus
+extern "C" {
+void *alloca (unsigned int);
+};
+#else /* not __cplusplus */
+void *alloca ();
+#endif /* not __cplusplus */
+#endif /* __hpux */
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc. */
+#endif /* not GNU C. */
+#endif /* alloca not defined. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYACCEPT return(0)
+#define YYABORT return(1)
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define YYFAIL goto yyerrlab
+#define YYRECOVERING() (!!yyerrstatus)
+#define YYBACKUP(token, value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+#ifndef YYPURE
+#define YYLEX yylex()
+#endif
+
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval, &yylloc)
+#endif
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval)
+#endif
+#endif /* not YYLSP_NEEDED */
+#endif
+
+/* If nonreentrant, generate the variables here */
+
+#ifndef YYPURE
+
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
+
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
+
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
+
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
+
+#ifndef YYINITDEPTH
+#define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
+
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 10000
+#endif
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+int yyparse (void);
+#endif
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#else /* __cplusplus */
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (char *to, char *from, int count)
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#endif
+#endif
+
+#line 196 "/usr/cygnus/progressive-97r2/share/bison.simple"
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
+
+#ifdef YYPARSE_PARAM
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
+#define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
+
+ int yystacksize = YYINITDEPTH;
+
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
+#endif
+#endif
+
+ YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+
+ int yylen;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss - 1;
+ yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
+
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
+
+ *++yyssp = yystate;
+
+ if (yyssp >= yyss + yystacksize - 1)
+ {
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
+ /* Get the current used size of the three stacks, in elements. */
+ int size = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
+#else /* no yyoverflow */
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ return 2;
+ }
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+ yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
+ yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
+#endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d\n", yystate);
+#endif
+
+ goto yybackup;
+ yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
+ }
+
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ goto yydefault;
+
+ yyn = yytable[yyn];
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+/* Do the default action for the current state. */
+yydefault:
+
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+
+/* Do a reduction. yyn is the number of a rule to reduce with. */
+yyreduce:
+ yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
+
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+
+
+ switch (yyn) {
+
+case 16:
+#line 174 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ rcparse_discard_strings ();
+ ;
+ break;}
+case 17:
+#line 183 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_accelerator (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].pacc);
+ ;
+ break;}
+case 18:
+#line 190 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.pacc = NULL;
+ ;
+ break;}
+case 19:
+#line 194 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ struct accelerator *a;
+
+ a = (struct accelerator *) res_alloc (sizeof *a);
+ *a = yyvsp[0].acc;
+ if (yyvsp[-1].pacc == NULL)
+ yyval.pacc = a;
+ else
+ {
+ struct accelerator **pp;
+
+ for (pp = &yyvsp[-1].pacc->next; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = a;
+ yyval.pacc = yyvsp[-1].pacc;
+ }
+ ;
+ break;}
+case 20:
+#line 215 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.acc = yyvsp[-1].acc;
+ yyval.acc.id = yyvsp[0].il;
+ ;
+ break;}
+case 21:
+#line 220 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.acc = yyvsp[-3].acc;
+ yyval.acc.id = yyvsp[-2].il;
+ yyval.acc.flags |= yyvsp[0].is;
+ if ((yyval.acc.flags & ACC_VIRTKEY) == 0
+ && (yyval.acc.flags & (ACC_SHIFT | ACC_CONTROL | ACC_ALT)) != 0)
+ rcparse_warning ("inappropriate modifiers for non-VIRTKEY");
+ ;
+ break;}
+case 22:
+#line 232 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ const char *s = yyvsp[0].s;
+ char ch;
+
+ yyval.acc.next = NULL;
+ yyval.acc.id = 0;
+ ch = *s;
+ if (ch != '^')
+ yyval.acc.flags = 0;
+ else
+ {
+ yyval.acc.flags = ACC_CONTROL | ACC_VIRTKEY;
+ ++s;
+ ch = *s;
+ ch = toupper ((unsigned char) ch);
+ }
+ yyval.acc.key = ch;
+ if (s[1] != '\0')
+ rcparse_warning ("accelerator should only be one character");
+ ;
+ break;}
+case 23:
+#line 253 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.acc.next = NULL;
+ yyval.acc.flags = 0;
+ yyval.acc.id = 0;
+ yyval.acc.key = yyvsp[0].il;
+ ;
+ break;}
+case 24:
+#line 263 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = yyvsp[0].is;
+ ;
+ break;}
+case 25:
+#line 267 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = yyvsp[-2].is | yyvsp[0].is;
+ ;
+ break;}
+case 26:
+#line 272 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = yyvsp[-1].is | yyvsp[0].is;
+ ;
+ break;}
+case 27:
+#line 279 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = ACC_VIRTKEY;
+ ;
+ break;}
+case 28:
+#line 283 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ /* This is just the absence of VIRTKEY. */
+ yyval.is = 0;
+ ;
+ break;}
+case 29:
+#line 288 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = ACC_NOINVERT;
+ ;
+ break;}
+case 30:
+#line 292 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = ACC_SHIFT;
+ ;
+ break;}
+case 31:
+#line 296 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = ACC_CONTROL;
+ ;
+ break;}
+case 32:
+#line 300 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = ACC_ALT;
+ ;
+ break;}
+case 33:
+#line 309 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_bitmap (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s);
+ ;
+ break;}
+case 34:
+#line 318 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_cursor (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s);
+ ;
+ break;}
+case 35:
+#line 328 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ memset (&dialog, 0, sizeof dialog);
+ dialog.x = yyvsp[-3].il;
+ dialog.y = yyvsp[-2].il;
+ dialog.width = yyvsp[-1].il;
+ dialog.height = yyvsp[0].il;
+ dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU;
+ dialog.exstyle = yyvsp[-4].il;
+ dialog.menu.named = 1;
+ dialog.class.named = 1;
+ dialog.font = NULL;
+ dialog.ex = NULL;
+ dialog.controls = NULL;
+ sub_res_info = yyvsp[-5].res_info;
+ ;
+ break;}
+case 36:
+#line 344 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_dialog (yyvsp[-12].id, &sub_res_info, &dialog);
+ ;
+ break;}
+case 37:
+#line 349 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ memset (&dialog, 0, sizeof dialog);
+ dialog.x = yyvsp[-3].il;
+ dialog.y = yyvsp[-2].il;
+ dialog.width = yyvsp[-1].il;
+ dialog.height = yyvsp[0].il;
+ dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU;
+ dialog.exstyle = yyvsp[-4].il;
+ dialog.menu.named = 1;
+ dialog.class.named = 1;
+ dialog.font = NULL;
+ dialog.ex = ((struct dialog_ex *)
+ res_alloc (sizeof (struct dialog_ex)));
+ memset (dialog.ex, 0, sizeof (struct dialog_ex));
+ dialog.controls = NULL;
+ sub_res_info = yyvsp[-5].res_info;
+ ;
+ break;}
+case 38:
+#line 367 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_dialog (yyvsp[-12].id, &sub_res_info, &dialog);
+ ;
+ break;}
+case 39:
+#line 372 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ memset (&dialog, 0, sizeof dialog);
+ dialog.x = yyvsp[-4].il;
+ dialog.y = yyvsp[-3].il;
+ dialog.width = yyvsp[-2].il;
+ dialog.height = yyvsp[-1].il;
+ dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU;
+ dialog.exstyle = yyvsp[-5].il;
+ dialog.menu.named = 1;
+ dialog.class.named = 1;
+ dialog.font = NULL;
+ dialog.ex = ((struct dialog_ex *)
+ res_alloc (sizeof (struct dialog_ex)));
+ memset (dialog.ex, 0, sizeof (struct dialog_ex));
+ dialog.ex->help = yyvsp[0].il;
+ dialog.controls = NULL;
+ sub_res_info = yyvsp[-6].res_info;
+ ;
+ break;}
+case 40:
+#line 391 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_dialog (yyvsp[-13].id, &sub_res_info, &dialog);
+ ;
+ break;}
+case 41:
+#line 398 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = 0;
+ ;
+ break;}
+case 42:
+#line 402 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = yyvsp[0].il;
+ ;
+ break;}
+case 44:
+#line 410 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ unicode_from_ascii ((int *) NULL, &dialog.caption, yyvsp[0].s);
+ ;
+ break;}
+case 45:
+#line 414 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ dialog.class = yyvsp[0].id;
+ ;
+ break;}
+case 46:
+#line 418 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{ style = dialog.style; ;
+ break;}
+case 47:
+#line 420 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ dialog.style = style;
+ ;
+ break;}
+case 48:
+#line 424 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ dialog.exstyle = yyvsp[0].il;
+ ;
+ break;}
+case 49:
+#line 428 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ dialog.style |= DS_SETFONT;
+ dialog.pointsize = yyvsp[-2].il;
+ unicode_from_ascii ((int *) NULL, &dialog.font, yyvsp[0].s);
+ ;
+ break;}
+case 50:
+#line 434 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ dialog.style |= DS_SETFONT;
+ dialog.pointsize = yyvsp[-4].il;
+ unicode_from_ascii ((int *) NULL, &dialog.font, yyvsp[-2].s);
+ if (dialog.ex == NULL)
+ rcparse_warning ("extended FONT requires DIALOGEX");
+ else
+ {
+ dialog.ex->weight = yyvsp[-1].il;
+ dialog.ex->italic = yyvsp[0].il;
+ }
+ ;
+ break;}
+case 51:
+#line 447 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ dialog.menu = yyvsp[0].id;
+ ;
+ break;}
+case 52:
+#line 451 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ sub_res_info.characteristics = yyvsp[0].il;
+ ;
+ break;}
+case 53:
+#line 455 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ sub_res_info.language = yyvsp[-1].il | (yyvsp[0].il << 8);
+ ;
+ break;}
+case 54:
+#line 459 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ sub_res_info.version = yyvsp[0].il;
+ ;
+ break;}
+case 56:
+#line 467 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ struct dialog_control **pp;
+
+ for (pp = &dialog.controls; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 57:
+#line 478 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_AUTO3STATE | WS_TABSTOP;
+ base_style = BS_AUTO3STATE;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 58:
+#line 484 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 59:
+#line 488 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_AUTOCHECKBOX | WS_TABSTOP;
+ base_style = BS_AUTOCHECKBOX;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 60:
+#line 494 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 61:
+#line 498 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_AUTORADIOBUTTON | WS_TABSTOP;
+ base_style = BS_AUTORADIOBUTTON;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 62:
+#line 504 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 63:
+#line 508 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ class = CTL_EDIT;
+ ;
+ break;}
+case 64:
+#line 514 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ if (dialog.ex == NULL)
+ rcparse_warning ("IEDIT requires DIALOGEX");
+ res_string_to_id (&yyval.dialog_control->class, "BEDIT");
+ ;
+ break;}
+case 65:
+#line 521 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_CHECKBOX | WS_TABSTOP;
+ base_style = BS_CHECKBOX | WS_TABSTOP;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 66:
+#line 527 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 67:
+#line 531 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = CBS_SIMPLE | WS_TABSTOP;
+ base_style = 0;
+ class = CTL_COMBOBOX;
+ ;
+ break;}
+case 68:
+#line 537 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 69:
+#line 542 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = define_control (yyvsp[-9].s, yyvsp[-8].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-2].il, yyvsp[-7].il, style, yyvsp[-1].il);
+ if (yyvsp[0].rcdata_item != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ yyval.dialog_control->data = yyvsp[0].rcdata_item;
+ }
+ ;
+ break;}
+case 70:
+#line 553 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = define_control (yyvsp[-10].s, yyvsp[-9].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-8].il, style, yyvsp[-2].il);
+ if (dialog.ex == NULL)
+ rcparse_warning ("help ID requires DIALOGEX");
+ yyval.dialog_control->help = yyvsp[-1].il;
+ yyval.dialog_control->data = yyvsp[0].rcdata_item;
+ ;
+ break;}
+case 71:
+#line 561 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = SS_CENTER | WS_GROUP;
+ base_style = SS_CENTER;
+ class = CTL_STATIC;
+ ;
+ break;}
+case 72:
+#line 567 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 73:
+#line 571 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_DEFPUSHBUTTON | WS_TABSTOP;
+ base_style = BS_DEFPUSHBUTTON | WS_TABSTOP;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 74:
+#line 577 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 75:
+#line 581 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ class = CTL_EDIT;
+ ;
+ break;}
+case 76:
+#line 587 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 77:
+#line 591 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_GROUPBOX;
+ base_style = BS_GROUPBOX;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 78:
+#line 597 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 79:
+#line 601 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ class = CTL_EDIT;
+ ;
+ break;}
+case 80:
+#line 607 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ if (dialog.ex == NULL)
+ rcparse_warning ("IEDIT requires DIALOGEX");
+ res_string_to_id (&yyval.dialog_control->class, "HEDIT");
+ ;
+ break;}
+case 81:
+#line 614 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = define_control (yyvsp[-4].s, yyvsp[-3].il, yyvsp[-2].il, yyvsp[-1].il, 0, 0, CTL_STATIC,
+ SS_ICON | WS_CHILD | WS_VISIBLE, 0);
+ if (yyvsp[0].rcdata_item != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ yyval.dialog_control->data = yyvsp[0].rcdata_item;
+ }
+ ;
+ break;}
+case 82:
+#line 626 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = define_control (yyvsp[-8].s, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, CTL_STATIC,
+ style, yyvsp[-1].il);
+ if (yyvsp[0].rcdata_item != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ yyval.dialog_control->data = yyvsp[0].rcdata_item;
+ }
+ ;
+ break;}
+case 83:
+#line 638 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = define_control (yyvsp[-9].s, yyvsp[-8].il, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, CTL_STATIC,
+ style, yyvsp[-2].il);
+ if (dialog.ex == NULL)
+ rcparse_warning ("help ID requires DIALOGEX");
+ yyval.dialog_control->help = yyvsp[-1].il;
+ yyval.dialog_control->data = yyvsp[0].rcdata_item;
+ ;
+ break;}
+case 84:
+#line 647 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ class = CTL_EDIT;
+ ;
+ break;}
+case 85:
+#line 653 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ if (dialog.ex == NULL)
+ rcparse_warning ("IEDIT requires DIALOGEX");
+ res_string_to_id (&yyval.dialog_control->class, "IEDIT");
+ ;
+ break;}
+case 86:
+#line 660 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = LBS_NOTIFY | WS_BORDER;
+ base_style = LBS_NOTIFY | WS_BORDER;
+ class = CTL_LISTBOX;
+ ;
+ break;}
+case 87:
+#line 666 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 88:
+#line 670 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = SS_LEFT | WS_GROUP;
+ base_style = SS_LEFT;
+ class = CTL_STATIC;
+ ;
+ break;}
+case 89:
+#line 676 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 90:
+#line 680 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_PUSHBOX | WS_TABSTOP;
+ base_style = BS_PUSHBOX;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 91:
+#line 686 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 92:
+#line 690 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_PUSHBUTTON | WS_TABSTOP;
+ base_style = BS_PUSHBUTTON | WS_TABSTOP;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 93:
+#line 696 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 94:
+#line 700 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_RADIOBUTTON | WS_TABSTOP;
+ base_style = BS_RADIOBUTTON;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 95:
+#line 706 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 96:
+#line 710 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = SS_RIGHT | WS_GROUP;
+ base_style = SS_RIGHT;
+ class = CTL_STATIC;
+ ;
+ break;}
+case 97:
+#line 716 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 98:
+#line 720 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = SBS_HORZ;
+ base_style = 0;
+ class = CTL_SCROLLBAR;
+ ;
+ break;}
+case 99:
+#line 726 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 100:
+#line 730 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ default_style = BS_3STATE | WS_TABSTOP;
+ base_style = BS_3STATE;
+ class = CTL_BUTTON;
+ ;
+ break;}
+case 101:
+#line 736 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = yyvsp[0].dialog_control;
+ ;
+ break;}
+case 102:
+#line 741 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{ style = WS_CHILD | WS_VISIBLE; ;
+ break;}
+case 103:
+#line 743 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = define_control (yyvsp[-14].s, yyvsp[-12].il, yyvsp[-10].il, yyvsp[-8].il, yyvsp[-6].il, yyvsp[-4].il, CTL_BUTTON,
+ style, yyvsp[0].il);
+ ;
+ break;}
+case 104:
+#line 759 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = define_control (yyvsp[-6].s, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-2].il, yyvsp[-1].il, class,
+ default_style | WS_CHILD | WS_VISIBLE, 0);
+ if (yyvsp[0].rcdata_item != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ yyval.dialog_control->data = yyvsp[0].rcdata_item;
+ }
+ ;
+ break;}
+case 105:
+#line 771 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = define_control (yyvsp[-8].s, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, class, style, yyvsp[-1].il);
+ if (yyvsp[0].rcdata_item != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ yyval.dialog_control->data = yyvsp[0].rcdata_item;
+ }
+ ;
+ break;}
+case 106:
+#line 782 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.dialog_control = define_control (yyvsp[-9].s, yyvsp[-8].il, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, class, style, yyvsp[-2].il);
+ if (dialog.ex == NULL)
+ rcparse_warning ("help ID requires DIALOGEX");
+ yyval.dialog_control->help = yyvsp[-1].il;
+ yyval.dialog_control->data = yyvsp[0].rcdata_item;
+ ;
+ break;}
+case 107:
+#line 793 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.s = NULL;
+ ;
+ break;}
+case 108:
+#line 797 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.s = yyvsp[-1].s;
+ ;
+ break;}
+case 109:
+#line 804 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.rcdata_item = NULL;
+ ;
+ break;}
+case 110:
+#line 808 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.rcdata_item = yyvsp[-1].rcdata.first;
+ ;
+ break;}
+case 111:
+#line 817 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{ style = WS_CHILD | WS_VISIBLE; ;
+ break;}
+case 113:
+#line 823 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{ style = SS_ICON | WS_CHILD | WS_VISIBLE; ;
+ break;}
+case 115:
+#line 829 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{ style = base_style | WS_CHILD | WS_VISIBLE; ;
+ break;}
+case 117:
+#line 837 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_font (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s);
+ ;
+ break;}
+case 118:
+#line 846 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_icon (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s);
+ ;
+ break;}
+case 119:
+#line 856 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ language = yyvsp[-1].il | (yyvsp[0].il << 8);
+ ;
+ break;}
+case 120:
+#line 865 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_menu (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].menuitem);
+ ;
+ break;}
+case 121:
+#line 872 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = NULL;
+ ;
+ break;}
+case 122:
+#line 876 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ if (yyvsp[-1].menuitem == NULL)
+ yyval.menuitem = yyvsp[0].menuitem;
+ else
+ {
+ struct menuitem **pp;
+
+ for (pp = &yyvsp[-1].menuitem->next; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = yyvsp[0].menuitem;
+ yyval.menuitem = yyvsp[-1].menuitem;
+ }
+ ;
+ break;}
+case 123:
+#line 893 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (yyvsp[-2].s, yyvsp[-1].il, yyvsp[0].is, 0, 0, NULL);
+ ;
+ break;}
+case 124:
+#line 897 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (NULL, 0, 0, 0, 0, NULL);
+ ;
+ break;}
+case 125:
+#line 901 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (yyvsp[-4].s, 0, yyvsp[-3].is, 0, 0, yyvsp[-1].menuitem);
+ ;
+ break;}
+case 126:
+#line 908 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = 0;
+ ;
+ break;}
+case 127:
+#line 912 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = yyvsp[-2].is | yyvsp[0].is;
+ ;
+ break;}
+case 128:
+#line 916 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = yyvsp[-1].is | yyvsp[0].is;
+ ;
+ break;}
+case 129:
+#line 923 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = MENUITEM_CHECKED;
+ ;
+ break;}
+case 130:
+#line 927 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = MENUITEM_GRAYED;
+ ;
+ break;}
+case 131:
+#line 931 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = MENUITEM_HELP;
+ ;
+ break;}
+case 132:
+#line 935 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = MENUITEM_INACTIVE;
+ ;
+ break;}
+case 133:
+#line 939 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = MENUITEM_MENUBARBREAK;
+ ;
+ break;}
+case 134:
+#line 943 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.is = MENUITEM_MENUBREAK;
+ ;
+ break;}
+case 135:
+#line 952 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_menu (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].menuitem);
+ ;
+ break;}
+case 136:
+#line 959 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = NULL;
+ ;
+ break;}
+case 137:
+#line 963 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ if (yyvsp[-1].menuitem == NULL)
+ yyval.menuitem = yyvsp[0].menuitem;
+ else
+ {
+ struct menuitem **pp;
+
+ for (pp = &yyvsp[-1].menuitem->next; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = yyvsp[0].menuitem;
+ yyval.menuitem = yyvsp[-1].menuitem;
+ }
+ ;
+ break;}
+case 138:
+#line 980 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (yyvsp[0].s, 0, 0, 0, 0, NULL);
+ ;
+ break;}
+case 139:
+#line 984 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (yyvsp[-1].s, yyvsp[0].il, 0, 0, 0, NULL);
+ ;
+ break;}
+case 140:
+#line 988 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (yyvsp[-3].s, yyvsp[-2].il, yyvsp[-1].il, yyvsp[0].il, 0, NULL);
+ ;
+ break;}
+case 141:
+#line 992 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (yyvsp[-3].s, 0, 0, 0, 0, yyvsp[-1].menuitem);
+ ;
+ break;}
+case 142:
+#line 996 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (yyvsp[-4].s, yyvsp[-3].il, 0, 0, 0, yyvsp[-1].menuitem);
+ ;
+ break;}
+case 143:
+#line 1000 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (yyvsp[-5].s, yyvsp[-4].il, yyvsp[-3].il, 0, 0, yyvsp[-1].menuitem);
+ ;
+ break;}
+case 144:
+#line 1005 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.menuitem = define_menuitem (yyvsp[-7].s, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-1].menuitem);
+ ;
+ break;}
+case 145:
+#line 1014 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_messagetable (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s);
+ ;
+ break;}
+case 146:
+#line 1023 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_rcdata (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].rcdata.first);
+ ;
+ break;}
+case 147:
+#line 1032 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ rcparse_rcdata ();
+ ;
+ break;}
+case 148:
+#line 1036 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ rcparse_normal ();
+ yyval.rcdata = yyvsp[0].rcdata;
+ ;
+ break;}
+case 149:
+#line 1044 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.rcdata.first = NULL;
+ yyval.rcdata.last = NULL;
+ ;
+ break;}
+case 150:
+#line 1049 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.rcdata = yyvsp[0].rcdata;
+ ;
+ break;}
+case 151:
+#line 1056 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ struct rcdata_item *ri;
+
+ ri = define_rcdata_string (yyvsp[0].ss.s, yyvsp[0].ss.length);
+ yyval.rcdata.first = ri;
+ yyval.rcdata.last = ri;
+ ;
+ break;}
+case 152:
+#line 1064 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ struct rcdata_item *ri;
+
+ ri = define_rcdata_number (yyvsp[0].i.val, yyvsp[0].i.dword);
+ yyval.rcdata.first = ri;
+ yyval.rcdata.last = ri;
+ ;
+ break;}
+case 153:
+#line 1072 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ struct rcdata_item *ri;
+
+ ri = define_rcdata_string (yyvsp[0].ss.s, yyvsp[0].ss.length);
+ yyval.rcdata.first = yyvsp[-2].rcdata.first;
+ yyvsp[-2].rcdata.last->next = ri;
+ yyval.rcdata.last = ri;
+ ;
+ break;}
+case 154:
+#line 1081 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ struct rcdata_item *ri;
+
+ ri = define_rcdata_number (yyvsp[0].i.val, yyvsp[0].i.dword);
+ yyval.rcdata.first = yyvsp[-2].rcdata.first;
+ yyvsp[-2].rcdata.last->next = ri;
+ yyval.rcdata.last = ri;
+ ;
+ break;}
+case 155:
+#line 1095 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{ sub_res_info = yyvsp[-1].res_info; ;
+ break;}
+case 158:
+#line 1102 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_stringtable (&sub_res_info, yyvsp[-1].il, yyvsp[0].s);
+ ;
+ break;}
+case 159:
+#line 1106 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_stringtable (&sub_res_info, yyvsp[-2].il, yyvsp[0].s);
+ ;
+ break;}
+case 160:
+#line 1116 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_user_data (yyvsp[-5].id, yyvsp[-4].id, &yyvsp[-3].res_info, yyvsp[-1].rcdata.first);
+ ;
+ break;}
+case 161:
+#line 1120 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_user_file (yyvsp[-3].id, yyvsp[-2].id, &yyvsp[-1].res_info, yyvsp[0].s);
+ ;
+ break;}
+case 162:
+#line 1129 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ define_versioninfo (yyvsp[-5].id, language, yyvsp[-3].fixver, yyvsp[-1].verinfo);
+ ;
+ break;}
+case 163:
+#line 1136 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.fixver = ((struct fixed_versioninfo *)
+ res_alloc (sizeof (struct fixed_versioninfo)));
+ memset (yyval.fixver, 0, sizeof (struct fixed_versioninfo));
+ ;
+ break;}
+case 164:
+#line 1142 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyvsp[-5].fixver->file_version_ms = (yyvsp[-3].il << 16) | yyvsp[-2].il;
+ yyvsp[-5].fixver->file_version_ls = (yyvsp[-1].il << 16) | yyvsp[0].il;
+ yyval.fixver = yyvsp[-5].fixver;
+ ;
+ break;}
+case 165:
+#line 1148 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyvsp[-5].fixver->product_version_ms = (yyvsp[-3].il << 16) | yyvsp[-2].il;
+ yyvsp[-5].fixver->product_version_ls = (yyvsp[-1].il << 16) | yyvsp[0].il;
+ yyval.fixver = yyvsp[-5].fixver;
+ ;
+ break;}
+case 166:
+#line 1154 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyvsp[-2].fixver->file_flags_mask = yyvsp[0].il;
+ yyval.fixver = yyvsp[-2].fixver;
+ ;
+ break;}
+case 167:
+#line 1159 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyvsp[-2].fixver->file_flags = yyvsp[0].il;
+ yyval.fixver = yyvsp[-2].fixver;
+ ;
+ break;}
+case 168:
+#line 1164 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyvsp[-2].fixver->file_os = yyvsp[0].il;
+ yyval.fixver = yyvsp[-2].fixver;
+ ;
+ break;}
+case 169:
+#line 1169 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyvsp[-2].fixver->file_type = yyvsp[0].il;
+ yyval.fixver = yyvsp[-2].fixver;
+ ;
+ break;}
+case 170:
+#line 1174 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyvsp[-2].fixver->file_subtype = yyvsp[0].il;
+ yyval.fixver = yyvsp[-2].fixver;
+ ;
+ break;}
+case 171:
+#line 1188 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.verinfo = NULL;
+ ;
+ break;}
+case 172:
+#line 1192 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.verinfo = append_ver_stringfileinfo (yyvsp[-7].verinfo, yyvsp[-4].s, yyvsp[-2].verstring);
+ ;
+ break;}
+case 173:
+#line 1196 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.verinfo = append_ver_varfileinfo (yyvsp[-6].verinfo, yyvsp[-2].s, yyvsp[-1].vervar);
+ ;
+ break;}
+case 174:
+#line 1203 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.verstring = NULL;
+ ;
+ break;}
+case 175:
+#line 1207 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.verstring = append_verval (yyvsp[-4].verstring, yyvsp[-2].s, yyvsp[0].s);
+ ;
+ break;}
+case 176:
+#line 1214 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.vervar = NULL;
+ ;
+ break;}
+case 177:
+#line 1218 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.vervar = append_vertrans (yyvsp[-2].vervar, yyvsp[-1].il, yyvsp[0].il);
+ ;
+ break;}
+case 178:
+#line 1227 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.id.named = 0;
+ yyval.id.u.id = yyvsp[0].il;
+ ;
+ break;}
+case 179:
+#line 1232 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ char *copy, *s;
+
+ /* It seems that resource ID's are forced to upper case. */
+ copy = xstrdup (yyvsp[0].s);
+ for (s = copy; *s != '\0'; s++)
+ if (islower (*s))
+ *s = toupper (*s);
+ res_string_to_id (&yyval.id, copy);
+ free (copy);
+ ;
+ break;}
+case 180:
+#line 1250 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ memset (&yyval.res_info, 0, sizeof (struct res_res_info));
+ yyval.res_info.language = language;
+ /* FIXME: Is this the right default? */
+ yyval.res_info.memflags = MEMFLAG_MOVEABLE;
+ ;
+ break;}
+case 181:
+#line 1257 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.res_info = yyvsp[-1].res_info;
+ yyval.res_info.memflags |= yyvsp[0].memflags.on;
+ yyval.res_info.memflags &=~ yyvsp[0].memflags.off;
+ ;
+ break;}
+case 182:
+#line 1263 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.res_info = yyvsp[-2].res_info;
+ yyval.res_info.characteristics = yyvsp[0].il;
+ ;
+ break;}
+case 183:
+#line 1268 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.res_info = yyvsp[-3].res_info;
+ yyval.res_info.language = yyvsp[-1].il | (yyvsp[0].il << 8);
+ ;
+ break;}
+case 184:
+#line 1273 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.res_info = yyvsp[-2].res_info;
+ yyval.res_info.version = yyvsp[0].il;
+ ;
+ break;}
+case 185:
+#line 1283 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ memset (&yyval.res_info, 0, sizeof (struct res_res_info));
+ yyval.res_info.language = language;
+ yyval.res_info.memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE;
+ ;
+ break;}
+case 186:
+#line 1289 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.res_info = yyvsp[-1].res_info;
+ yyval.res_info.memflags |= yyvsp[0].memflags.on;
+ yyval.res_info.memflags &=~ yyvsp[0].memflags.off;
+ ;
+ break;}
+case 187:
+#line 1300 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ memset (&yyval.res_info, 0, sizeof (struct res_res_info));
+ yyval.res_info.language = language;
+ yyval.res_info.memflags = MEMFLAG_MOVEABLE;
+ ;
+ break;}
+case 188:
+#line 1306 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.res_info = yyvsp[-1].res_info;
+ yyval.res_info.memflags |= yyvsp[0].memflags.on;
+ yyval.res_info.memflags &=~ yyvsp[0].memflags.off;
+ ;
+ break;}
+case 189:
+#line 1318 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.memflags.on = MEMFLAG_MOVEABLE;
+ yyval.memflags.off = 0;
+ ;
+ break;}
+case 190:
+#line 1323 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.memflags.on = 0;
+ yyval.memflags.off = MEMFLAG_MOVEABLE;
+ ;
+ break;}
+case 191:
+#line 1328 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.memflags.on = MEMFLAG_PURE;
+ yyval.memflags.off = 0;
+ ;
+ break;}
+case 192:
+#line 1333 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.memflags.on = 0;
+ yyval.memflags.off = MEMFLAG_PURE;
+ ;
+ break;}
+case 193:
+#line 1338 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.memflags.on = MEMFLAG_PRELOAD;
+ yyval.memflags.off = 0;
+ ;
+ break;}
+case 194:
+#line 1343 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.memflags.on = 0;
+ yyval.memflags.off = MEMFLAG_PRELOAD;
+ ;
+ break;}
+case 195:
+#line 1348 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.memflags.on = MEMFLAG_DISCARDABLE;
+ yyval.memflags.off = 0;
+ ;
+ break;}
+case 196:
+#line 1358 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.s = yyvsp[0].s;
+ ;
+ break;}
+case 197:
+#line 1362 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.s = yyvsp[0].s;
+ ;
+ break;}
+case 198:
+#line 1379 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ style |= yyvsp[0].il;
+ ;
+ break;}
+case 199:
+#line 1383 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ style &=~ yyvsp[0].il;
+ ;
+ break;}
+case 200:
+#line 1387 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ style |= yyvsp[0].il;
+ ;
+ break;}
+case 201:
+#line 1391 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ style &=~ yyvsp[0].il;
+ ;
+ break;}
+case 202:
+#line 1398 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = yyvsp[0].i.val;
+ ;
+ break;}
+case 203:
+#line 1402 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = yyvsp[-1].il;
+ ;
+ break;}
+case 204:
+#line 1411 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = 0;
+ ;
+ break;}
+case 205:
+#line 1415 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = yyvsp[0].il;
+ ;
+ break;}
+case 206:
+#line 1424 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = yyvsp[0].il;
+ ;
+ break;}
+case 207:
+#line 1433 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = yyvsp[0].i.val;
+ ;
+ break;}
+case 208:
+#line 1442 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i = yyvsp[0].i;
+ ;
+ break;}
+case 209:
+#line 1446 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i = yyvsp[-1].i;
+ ;
+ break;}
+case 210:
+#line 1450 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = ~ yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[0].i.dword;
+ ;
+ break;}
+case 211:
+#line 1455 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = - yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[0].i.dword;
+ ;
+ break;}
+case 212:
+#line 1460 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val * yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 213:
+#line 1465 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val / yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 214:
+#line 1470 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val % yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 215:
+#line 1475 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val + yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 216:
+#line 1480 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val - yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 217:
+#line 1485 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val & yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 218:
+#line 1490 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val ^ yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 219:
+#line 1495 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val | yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 220:
+#line 1506 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = yyvsp[0].il;
+ ;
+ break;}
+case 221:
+#line 1515 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.il = yyvsp[0].i.val;
+ ;
+ break;}
+case 222:
+#line 1526 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i = yyvsp[0].i;
+ ;
+ break;}
+case 223:
+#line 1530 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i = yyvsp[-1].i;
+ ;
+ break;}
+case 224:
+#line 1534 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = ~ yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[0].i.dword;
+ ;
+ break;}
+case 225:
+#line 1539 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val * yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 226:
+#line 1544 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val / yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 227:
+#line 1549 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val % yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 228:
+#line 1554 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val + yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 229:
+#line 1559 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val - yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 230:
+#line 1564 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val & yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 231:
+#line 1569 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val ^ yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+case 232:
+#line 1574 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+{
+ yyval.i.val = yyvsp[-2].i.val | yyvsp[0].i.val;
+ yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword;
+ ;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+#line 498 "/usr/cygnus/progressive-97r2/share/bison.simple"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
+
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTBASE];
+
+ goto yynewstate;
+
+yyerrlab: /* here on detecting error */
+
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
+ {
+ ++yynerrs;
+
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (yyn > YYFLAG && yyn < YYLAST)
+ {
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
+ {
+ strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
+ }
+ yyerror(msg);
+ free(msg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exceeded");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror("parse error");
+ }
+
+ goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
+
+ if (yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
+
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+yyerrdefault: /* current state does not do anything special for the error token. */
+
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
+
+yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+yyerrhandle:
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ yystate = yyn;
+ goto yynewstate;
+}
+#line 1580 "/5g/ian/binutils/release/copy/binutils/rcparse.y"
+
+
+/* Set the language from the command line. */
+
+void
+rcparse_set_language (lang)
+ int lang;
+{
+ language = lang;
+}
diff --git a/contrib/binutils/binutils/rcparse.h b/contrib/binutils/binutils/rcparse.h
new file mode 100644
index 0000000..dbf9c59
--- /dev/null
+++ b/contrib/binutils/binutils/rcparse.h
@@ -0,0 +1,124 @@
+typedef union
+{
+ struct accelerator acc;
+ struct accelerator *pacc;
+ struct dialog_control *dialog_control;
+ struct menuitem *menuitem;
+ struct
+ {
+ struct rcdata_item *first;
+ struct rcdata_item *last;
+ } rcdata;
+ struct rcdata_item *rcdata_item;
+ struct stringtable_data *stringtable;
+ struct fixed_versioninfo *fixver;
+ struct ver_info *verinfo;
+ struct ver_stringinfo *verstring;
+ struct ver_varinfo *vervar;
+ struct res_id id;
+ struct res_res_info res_info;
+ struct
+ {
+ unsigned short on;
+ unsigned short off;
+ } memflags;
+ struct
+ {
+ unsigned long val;
+ /* Nonzero if this number was explicitly specified as long. */
+ int dword;
+ } i;
+ unsigned long il;
+ unsigned short is;
+ const char *s;
+ struct
+ {
+ unsigned long length;
+ const char *s;
+ } ss;
+} YYSTYPE;
+#define BEG 258
+#define END 259
+#define ACCELERATORS 260
+#define VIRTKEY 261
+#define ASCII 262
+#define NOINVERT 263
+#define SHIFT 264
+#define CONTROL 265
+#define ALT 266
+#define BITMAP 267
+#define CURSOR 268
+#define DIALOG 269
+#define DIALOGEX 270
+#define EXSTYLE 271
+#define CAPTION 272
+#define CLASS 273
+#define STYLE 274
+#define AUTO3STATE 275
+#define AUTOCHECKBOX 276
+#define AUTORADIOBUTTON 277
+#define CHECKBOX 278
+#define COMBOBOX 279
+#define CTEXT 280
+#define DEFPUSHBUTTON 281
+#define EDITTEXT 282
+#define GROUPBOX 283
+#define LISTBOX 284
+#define LTEXT 285
+#define PUSHBOX 286
+#define PUSHBUTTON 287
+#define RADIOBUTTON 288
+#define RTEXT 289
+#define SCROLLBAR 290
+#define STATE3 291
+#define USERBUTTON 292
+#define BEDIT 293
+#define HEDIT 294
+#define IEDIT 295
+#define FONT 296
+#define ICON 297
+#define LANGUAGE 298
+#define CHARACTERISTICS 299
+#define VERSIONK 300
+#define MENU 301
+#define MENUEX 302
+#define MENUITEM 303
+#define SEPARATOR 304
+#define POPUP 305
+#define CHECKED 306
+#define GRAYED 307
+#define HELP 308
+#define INACTIVE 309
+#define MENUBARBREAK 310
+#define MENUBREAK 311
+#define MESSAGETABLE 312
+#define RCDATA 313
+#define STRINGTABLE 314
+#define VERSIONINFO 315
+#define FILEVERSION 316
+#define PRODUCTVERSION 317
+#define FILEFLAGSMASK 318
+#define FILEFLAGS 319
+#define FILEOS 320
+#define FILETYPE 321
+#define FILESUBTYPE 322
+#define BLOCKSTRINGFILEINFO 323
+#define BLOCKVARFILEINFO 324
+#define VALUE 325
+#define BLOCK 326
+#define MOVEABLE 327
+#define FIXED 328
+#define PURE 329
+#define IMPURE 330
+#define PRELOAD 331
+#define LOADONCALL 332
+#define DISCARDABLE 333
+#define NOT 334
+#define QUOTEDSTRING 335
+#define STRING 336
+#define NUMBER 337
+#define SIZEDSTRING 338
+#define NEG 339
+
+
+extern YYSTYPE yylval;
diff --git a/contrib/binutils/binutils/rcparse.y b/contrib/binutils/binutils/rcparse.y
new file mode 100644
index 0000000..7b2b06e
--- /dev/null
+++ b/contrib/binutils/binutils/rcparse.y
@@ -0,0 +1,1589 @@
+%{ /* rcparse.y -- parser for Windows rc files
+ Copyright 1997 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor, Cygnus Support.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/* This is a parser for Windows rc files. It is based on the parser
+ by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */
+
+#include "bfd.h"
+#include "bucomm.h"
+#include "libiberty.h"
+#include "windres.h"
+
+#include <ctype.h>
+
+/* The current language. */
+
+static unsigned short language;
+
+/* The resource information during a sub statement. */
+
+static struct res_res_info sub_res_info;
+
+/* Dialog information. This is built by the nonterminals styles and
+ controls. */
+
+static struct dialog dialog;
+
+/* This is used when building a style. It is modified by the
+ nonterminal styleexpr. */
+
+static unsigned long style;
+
+/* These are used when building a control. They are set before using
+ control_params. */
+
+static unsigned long base_style;
+static unsigned long default_style;
+static unsigned long class;
+
+%}
+
+%union
+{
+ struct accelerator acc;
+ struct accelerator *pacc;
+ struct dialog_control *dialog_control;
+ struct menuitem *menuitem;
+ struct
+ {
+ struct rcdata_item *first;
+ struct rcdata_item *last;
+ } rcdata;
+ struct rcdata_item *rcdata_item;
+ struct stringtable_data *stringtable;
+ struct fixed_versioninfo *fixver;
+ struct ver_info *verinfo;
+ struct ver_stringinfo *verstring;
+ struct ver_varinfo *vervar;
+ struct res_id id;
+ struct res_res_info res_info;
+ struct
+ {
+ unsigned short on;
+ unsigned short off;
+ } memflags;
+ struct
+ {
+ unsigned long val;
+ /* Nonzero if this number was explicitly specified as long. */
+ int dword;
+ } i;
+ unsigned long il;
+ unsigned short is;
+ const char *s;
+ struct
+ {
+ unsigned long length;
+ const char *s;
+ } ss;
+};
+
+%token BEG END
+%token ACCELERATORS VIRTKEY ASCII NOINVERT SHIFT CONTROL ALT
+%token BITMAP
+%token CURSOR
+%token DIALOG DIALOGEX EXSTYLE CAPTION CLASS STYLE
+%token AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON CHECKBOX COMBOBOX CTEXT
+%token DEFPUSHBUTTON EDITTEXT GROUPBOX LISTBOX LTEXT PUSHBOX PUSHBUTTON
+%token RADIOBUTTON RTEXT SCROLLBAR STATE3 USERBUTTON
+%token BEDIT HEDIT IEDIT
+%token FONT
+%token ICON
+%token LANGUAGE CHARACTERISTICS VERSIONK
+%token MENU MENUEX MENUITEM SEPARATOR POPUP CHECKED GRAYED HELP INACTIVE
+%token MENUBARBREAK MENUBREAK
+%token MESSAGETABLE
+%token RCDATA
+%token STRINGTABLE
+%token VERSIONINFO FILEVERSION PRODUCTVERSION FILEFLAGSMASK FILEFLAGS
+%token FILEOS FILETYPE FILESUBTYPE BLOCKSTRINGFILEINFO BLOCKVARFILEINFO
+%token VALUE
+%token <s> BLOCK
+%token MOVEABLE FIXED PURE IMPURE PRELOAD LOADONCALL DISCARDABLE
+%token NOT
+%token <s> QUOTEDSTRING STRING
+%token <i> NUMBER
+%token <ss> SIZEDSTRING
+
+%type <pacc> acc_entries
+%type <acc> acc_entry acc_event
+%type <dialog_control> control control_params
+%type <menuitem> menuitems menuitem menuexitems menuexitem
+%type <rcdata> optrcdata_data optrcdata_data_int rcdata_data
+%type <rcdata_item> opt_control_data
+%type <fixver> fixedverinfo
+%type <verinfo> verblocks
+%type <verstring> vervals
+%type <vervar> vertrans
+%type <res_info> suboptions memflags_move_discard memflags_move
+%type <memflags> memflag
+%type <id> id
+%type <il> exstyle parennumber
+%type <il> numexpr posnumexpr cnumexpr optcnumexpr cposnumexpr
+%type <is> acc_options acc_option menuitem_flags menuitem_flag
+%type <s> optstringc file_name
+%type <i> sizednumexpr sizedposnumexpr
+
+%left '|'
+%left '^'
+%left '&'
+%left '+' '-'
+%left '*' '/' '%'
+%right '~' NEG
+
+%%
+
+input:
+ /* empty */
+ | input newcmd accelerator
+ | input newcmd bitmap
+ | input newcmd cursor
+ | input newcmd dialog
+ | input newcmd font
+ | input newcmd icon
+ | input newcmd language
+ | input newcmd menu
+ | input newcmd menuex
+ | input newcmd messagetable
+ | input newcmd rcdata
+ | input newcmd stringtable
+ | input newcmd user
+ | input newcmd versioninfo
+ ;
+
+newcmd:
+ /* empty */
+ {
+ rcparse_discard_strings ();
+ }
+ ;
+
+/* Accelerator resources. */
+
+accelerator:
+ id ACCELERATORS suboptions BEG acc_entries END
+ {
+ define_accelerator ($1, &$3, $5);
+ }
+ ;
+
+acc_entries:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | acc_entries acc_entry
+ {
+ struct accelerator *a;
+
+ a = (struct accelerator *) res_alloc (sizeof *a);
+ *a = $2;
+ if ($1 == NULL)
+ $$ = a;
+ else
+ {
+ struct accelerator **pp;
+
+ for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = a;
+ $$ = $1;
+ }
+ }
+ ;
+
+acc_entry:
+ acc_event cposnumexpr
+ {
+ $$ = $1;
+ $$.id = $2;
+ }
+ | acc_event cposnumexpr ',' acc_options
+ {
+ $$ = $1;
+ $$.id = $2;
+ $$.flags |= $4;
+ if (($$.flags & ACC_VIRTKEY) == 0
+ && ($$.flags & (ACC_SHIFT | ACC_CONTROL | ACC_ALT)) != 0)
+ rcparse_warning ("inappropriate modifiers for non-VIRTKEY");
+ }
+ ;
+
+acc_event:
+ QUOTEDSTRING
+ {
+ const char *s = $1;
+ char ch;
+
+ $$.next = NULL;
+ $$.id = 0;
+ ch = *s;
+ if (ch != '^')
+ $$.flags = 0;
+ else
+ {
+ $$.flags = ACC_CONTROL | ACC_VIRTKEY;
+ ++s;
+ ch = *s;
+ ch = toupper ((unsigned char) ch);
+ }
+ $$.key = ch;
+ if (s[1] != '\0')
+ rcparse_warning ("accelerator should only be one character");
+ }
+ | posnumexpr
+ {
+ $$.next = NULL;
+ $$.flags = 0;
+ $$.id = 0;
+ $$.key = $1;
+ }
+ ;
+
+acc_options:
+ acc_option
+ {
+ $$ = $1;
+ }
+ | acc_options ',' acc_option
+ {
+ $$ = $1 | $3;
+ }
+ /* I've had one report that the comma is optional. */
+ | acc_options acc_option
+ {
+ $$ = $1 | $2;
+ }
+ ;
+
+acc_option:
+ VIRTKEY
+ {
+ $$ = ACC_VIRTKEY;
+ }
+ | ASCII
+ {
+ /* This is just the absence of VIRTKEY. */
+ $$ = 0;
+ }
+ | NOINVERT
+ {
+ $$ = ACC_NOINVERT;
+ }
+ | SHIFT
+ {
+ $$ = ACC_SHIFT;
+ }
+ | CONTROL
+ {
+ $$ = ACC_CONTROL;
+ }
+ | ALT
+ {
+ $$ = ACC_ALT;
+ }
+ ;
+
+/* Bitmap resources. */
+
+bitmap:
+ id BITMAP memflags_move file_name
+ {
+ define_bitmap ($1, &$3, $4);
+ }
+ ;
+
+/* Cursor resources. */
+
+cursor:
+ id CURSOR memflags_move_discard file_name
+ {
+ define_cursor ($1, &$3, $4);
+ }
+ ;
+
+/* Dialog resources. */
+
+dialog:
+ id DIALOG memflags_move exstyle posnumexpr cnumexpr cnumexpr
+ cnumexpr
+ {
+ memset (&dialog, 0, sizeof dialog);
+ dialog.x = $5;
+ dialog.y = $6;
+ dialog.width = $7;
+ dialog.height = $8;
+ dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU;
+ dialog.exstyle = $4;
+ dialog.menu.named = 1;
+ dialog.class.named = 1;
+ dialog.font = NULL;
+ dialog.ex = NULL;
+ dialog.controls = NULL;
+ sub_res_info = $3;
+ }
+ styles BEG controls END
+ {
+ define_dialog ($1, &sub_res_info, &dialog);
+ }
+ | id DIALOGEX memflags_move exstyle posnumexpr cnumexpr cnumexpr
+ cnumexpr
+ {
+ memset (&dialog, 0, sizeof dialog);
+ dialog.x = $5;
+ dialog.y = $6;
+ dialog.width = $7;
+ dialog.height = $8;
+ dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU;
+ dialog.exstyle = $4;
+ dialog.menu.named = 1;
+ dialog.class.named = 1;
+ dialog.font = NULL;
+ dialog.ex = ((struct dialog_ex *)
+ res_alloc (sizeof (struct dialog_ex)));
+ memset (dialog.ex, 0, sizeof (struct dialog_ex));
+ dialog.controls = NULL;
+ sub_res_info = $3;
+ }
+ styles BEG controls END
+ {
+ define_dialog ($1, &sub_res_info, &dialog);
+ }
+ | id DIALOGEX memflags_move exstyle posnumexpr cnumexpr cnumexpr
+ cnumexpr cnumexpr
+ {
+ memset (&dialog, 0, sizeof dialog);
+ dialog.x = $5;
+ dialog.y = $6;
+ dialog.width = $7;
+ dialog.height = $8;
+ dialog.style = WS_POPUP | WS_BORDER | WS_SYSMENU;
+ dialog.exstyle = $4;
+ dialog.menu.named = 1;
+ dialog.class.named = 1;
+ dialog.font = NULL;
+ dialog.ex = ((struct dialog_ex *)
+ res_alloc (sizeof (struct dialog_ex)));
+ memset (dialog.ex, 0, sizeof (struct dialog_ex));
+ dialog.ex->help = $9;
+ dialog.controls = NULL;
+ sub_res_info = $3;
+ }
+ styles BEG controls END
+ {
+ define_dialog ($1, &sub_res_info, &dialog);
+ }
+ ;
+
+exstyle:
+ /* empty */
+ {
+ $$ = 0;
+ }
+ | EXSTYLE '=' numexpr
+ {
+ $$ = $3;
+ }
+ ;
+
+styles:
+ /* empty */
+ | styles CAPTION QUOTEDSTRING
+ {
+ unicode_from_ascii ((int *) NULL, &dialog.caption, $3);
+ }
+ | styles CLASS id
+ {
+ dialog.class = $3;
+ }
+ | styles STYLE
+ { style = dialog.style; }
+ styleexpr
+ {
+ dialog.style = style;
+ }
+ | styles EXSTYLE numexpr
+ {
+ dialog.exstyle = $3;
+ }
+ | styles FONT numexpr ',' QUOTEDSTRING
+ {
+ dialog.style |= DS_SETFONT;
+ dialog.pointsize = $3;
+ unicode_from_ascii ((int *) NULL, &dialog.font, $5);
+ }
+ | styles FONT numexpr ',' QUOTEDSTRING cnumexpr cnumexpr
+ {
+ dialog.style |= DS_SETFONT;
+ dialog.pointsize = $3;
+ unicode_from_ascii ((int *) NULL, &dialog.font, $5);
+ if (dialog.ex == NULL)
+ rcparse_warning ("extended FONT requires DIALOGEX");
+ else
+ {
+ dialog.ex->weight = $6;
+ dialog.ex->italic = $7;
+ }
+ }
+ | styles MENU id
+ {
+ dialog.menu = $3;
+ }
+ | styles CHARACTERISTICS numexpr
+ {
+ sub_res_info.characteristics = $3;
+ }
+ | styles LANGUAGE numexpr cnumexpr
+ {
+ sub_res_info.language = $3 | ($4 << 8);
+ }
+ | styles VERSIONK numexpr
+ {
+ sub_res_info.version = $3;
+ }
+ ;
+
+controls:
+ /* empty */
+ | controls control
+ {
+ struct dialog_control **pp;
+
+ for (pp = &dialog.controls; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = $2;
+ }
+ ;
+
+control:
+ AUTO3STATE
+ {
+ default_style = BS_AUTO3STATE | WS_TABSTOP;
+ base_style = BS_AUTO3STATE;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | AUTOCHECKBOX
+ {
+ default_style = BS_AUTOCHECKBOX | WS_TABSTOP;
+ base_style = BS_AUTOCHECKBOX;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | AUTORADIOBUTTON
+ {
+ default_style = BS_AUTORADIOBUTTON | WS_TABSTOP;
+ base_style = BS_AUTORADIOBUTTON;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | BEDIT
+ {
+ default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ class = CTL_EDIT;
+ }
+ control_params
+ {
+ $$ = $3;
+ if (dialog.ex == NULL)
+ rcparse_warning ("IEDIT requires DIALOGEX");
+ res_string_to_id (&$$->class, "BEDIT");
+ }
+ | CHECKBOX
+ {
+ default_style = BS_CHECKBOX | WS_TABSTOP;
+ base_style = BS_CHECKBOX | WS_TABSTOP;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | COMBOBOX
+ {
+ default_style = CBS_SIMPLE | WS_TABSTOP;
+ base_style = 0;
+ class = CTL_COMBOBOX;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | CONTROL optstringc numexpr cnumexpr control_styleexpr cnumexpr
+ cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data
+ {
+ $$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10);
+ if ($11 != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ $$->data = $11;
+ }
+ }
+ | CONTROL optstringc numexpr cnumexpr control_styleexpr cnumexpr
+ cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr opt_control_data
+ {
+ $$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10);
+ if (dialog.ex == NULL)
+ rcparse_warning ("help ID requires DIALOGEX");
+ $$->help = $11;
+ $$->data = $12;
+ }
+ | CTEXT
+ {
+ default_style = SS_CENTER | WS_GROUP;
+ base_style = SS_CENTER;
+ class = CTL_STATIC;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | DEFPUSHBUTTON
+ {
+ default_style = BS_DEFPUSHBUTTON | WS_TABSTOP;
+ base_style = BS_DEFPUSHBUTTON | WS_TABSTOP;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | EDITTEXT
+ {
+ default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ class = CTL_EDIT;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | GROUPBOX
+ {
+ default_style = BS_GROUPBOX;
+ base_style = BS_GROUPBOX;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | HEDIT
+ {
+ default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ class = CTL_EDIT;
+ }
+ control_params
+ {
+ $$ = $3;
+ if (dialog.ex == NULL)
+ rcparse_warning ("IEDIT requires DIALOGEX");
+ res_string_to_id (&$$->class, "HEDIT");
+ }
+ | ICON optstringc numexpr cnumexpr cnumexpr opt_control_data
+ {
+ $$ = define_control ($2, $3, $4, $5, 0, 0, CTL_STATIC,
+ SS_ICON | WS_CHILD | WS_VISIBLE, 0);
+ if ($6 != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ $$->data = $6;
+ }
+ }
+ | ICON optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+ icon_styleexpr optcnumexpr opt_control_data
+ {
+ $$ = define_control ($2, $3, $4, $5, $6, $7, CTL_STATIC,
+ style, $9);
+ if ($10 != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ $$->data = $10;
+ }
+ }
+ | ICON optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+ icon_styleexpr cnumexpr cnumexpr opt_control_data
+ {
+ $$ = define_control ($2, $3, $4, $5, $6, $7, CTL_STATIC,
+ style, $9);
+ if (dialog.ex == NULL)
+ rcparse_warning ("help ID requires DIALOGEX");
+ $$->help = $10;
+ $$->data = $11;
+ }
+ | IEDIT
+ {
+ default_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ base_style = ES_LEFT | WS_BORDER | WS_TABSTOP;
+ class = CTL_EDIT;
+ }
+ control_params
+ {
+ $$ = $3;
+ if (dialog.ex == NULL)
+ rcparse_warning ("IEDIT requires DIALOGEX");
+ res_string_to_id (&$$->class, "IEDIT");
+ }
+ | LISTBOX
+ {
+ default_style = LBS_NOTIFY | WS_BORDER;
+ base_style = LBS_NOTIFY | WS_BORDER;
+ class = CTL_LISTBOX;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | LTEXT
+ {
+ default_style = SS_LEFT | WS_GROUP;
+ base_style = SS_LEFT;
+ class = CTL_STATIC;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | PUSHBOX
+ {
+ default_style = BS_PUSHBOX | WS_TABSTOP;
+ base_style = BS_PUSHBOX;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | PUSHBUTTON
+ {
+ default_style = BS_PUSHBUTTON | WS_TABSTOP;
+ base_style = BS_PUSHBUTTON | WS_TABSTOP;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | RADIOBUTTON
+ {
+ default_style = BS_RADIOBUTTON | WS_TABSTOP;
+ base_style = BS_RADIOBUTTON;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | RTEXT
+ {
+ default_style = SS_RIGHT | WS_GROUP;
+ base_style = SS_RIGHT;
+ class = CTL_STATIC;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | SCROLLBAR
+ {
+ default_style = SBS_HORZ;
+ base_style = 0;
+ class = CTL_SCROLLBAR;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | STATE3
+ {
+ default_style = BS_3STATE | WS_TABSTOP;
+ base_style = BS_3STATE;
+ class = CTL_BUTTON;
+ }
+ control_params
+ {
+ $$ = $3;
+ }
+ | USERBUTTON QUOTEDSTRING ',' numexpr ',' numexpr ',' numexpr ','
+ numexpr ',' numexpr ','
+ { style = WS_CHILD | WS_VISIBLE; }
+ styleexpr optcnumexpr
+ {
+ $$ = define_control ($2, $4, $6, $8, $10, $12, CTL_BUTTON,
+ style, $16);
+ }
+ ;
+
+/* Parameters for a control. The static variables DEFAULT_STYLE,
+ BASE_STYLE, and CLASS must be initialized before this nonterminal
+ is used. DEFAULT_STYLE is the style to use if no style expression
+ is specified. BASE_STYLE is the base style to use if a style
+ expression is specified; the style expression modifies the base
+ style. CLASS is the class of the control. */
+
+control_params:
+ optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+ opt_control_data
+ {
+ $$ = define_control ($1, $2, $3, $4, $5, $6, class,
+ default_style | WS_CHILD | WS_VISIBLE, 0);
+ if ($7 != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ $$->data = $7;
+ }
+ }
+ | optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+ control_params_styleexpr optcnumexpr opt_control_data
+ {
+ $$ = define_control ($1, $2, $3, $4, $5, $6, class, style, $8);
+ if ($9 != NULL)
+ {
+ if (dialog.ex == NULL)
+ rcparse_warning ("control data requires DIALOGEX");
+ $$->data = $9;
+ }
+ }
+ | optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+ control_params_styleexpr cnumexpr cnumexpr opt_control_data
+ {
+ $$ = define_control ($1, $2, $3, $4, $5, $6, class, style, $8);
+ if (dialog.ex == NULL)
+ rcparse_warning ("help ID requires DIALOGEX");
+ $$->help = $9;
+ $$->data = $10;
+ }
+ ;
+
+optstringc:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | QUOTEDSTRING ','
+ {
+ $$ = $1;
+ }
+ ;
+
+opt_control_data:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | BEG optrcdata_data END
+ {
+ $$ = $2.first;
+ }
+ ;
+
+/* These only exist to parse a reduction out of a common case. */
+
+control_styleexpr:
+ ','
+ { style = WS_CHILD | WS_VISIBLE; }
+ styleexpr
+ ;
+
+icon_styleexpr:
+ ','
+ { style = SS_ICON | WS_CHILD | WS_VISIBLE; }
+ styleexpr
+ ;
+
+control_params_styleexpr:
+ ','
+ { style = base_style | WS_CHILD | WS_VISIBLE; }
+ styleexpr
+ ;
+
+/* Font resources. */
+
+font:
+ id FONT memflags_move_discard file_name
+ {
+ define_font ($1, &$3, $4);
+ }
+ ;
+
+/* Icon resources. */
+
+icon:
+ id ICON memflags_move_discard file_name
+ {
+ define_icon ($1, &$3, $4);
+ }
+ ;
+
+/* Language command. This changes the static variable language, which
+ affects all subsequent resources. */
+
+language:
+ LANGUAGE numexpr cnumexpr
+ {
+ language = $2 | ($3 << 8);
+ }
+ ;
+
+/* Menu resources. */
+
+menu:
+ id MENU suboptions BEG menuitems END
+ {
+ define_menu ($1, &$3, $5);
+ }
+ ;
+
+menuitems:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | menuitems menuitem
+ {
+ if ($1 == NULL)
+ $$ = $2;
+ else
+ {
+ struct menuitem **pp;
+
+ for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = $2;
+ $$ = $1;
+ }
+ }
+ ;
+
+menuitem:
+ MENUITEM QUOTEDSTRING cnumexpr menuitem_flags
+ {
+ $$ = define_menuitem ($2, $3, $4, 0, 0, NULL);
+ }
+ | MENUITEM SEPARATOR
+ {
+ $$ = define_menuitem (NULL, 0, 0, 0, 0, NULL);
+ }
+ | POPUP QUOTEDSTRING menuitem_flags BEG menuitems END
+ {
+ $$ = define_menuitem ($2, 0, $3, 0, 0, $5);
+ }
+ ;
+
+menuitem_flags:
+ /* empty */
+ {
+ $$ = 0;
+ }
+ | menuitem_flags ',' menuitem_flag
+ {
+ $$ = $1 | $3;
+ }
+ | menuitem_flags menuitem_flag
+ {
+ $$ = $1 | $2;
+ }
+ ;
+
+menuitem_flag:
+ CHECKED
+ {
+ $$ = MENUITEM_CHECKED;
+ }
+ | GRAYED
+ {
+ $$ = MENUITEM_GRAYED;
+ }
+ | HELP
+ {
+ $$ = MENUITEM_HELP;
+ }
+ | INACTIVE
+ {
+ $$ = MENUITEM_INACTIVE;
+ }
+ | MENUBARBREAK
+ {
+ $$ = MENUITEM_MENUBARBREAK;
+ }
+ | MENUBREAK
+ {
+ $$ = MENUITEM_MENUBREAK;
+ }
+ ;
+
+/* Menuex resources. */
+
+menuex:
+ id MENUEX suboptions BEG menuexitems END
+ {
+ define_menu ($1, &$3, $5);
+ }
+ ;
+
+menuexitems:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | menuexitems menuexitem
+ {
+ if ($1 == NULL)
+ $$ = $2;
+ else
+ {
+ struct menuitem **pp;
+
+ for (pp = &$1->next; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = $2;
+ $$ = $1;
+ }
+ }
+ ;
+
+menuexitem:
+ MENUITEM QUOTEDSTRING
+ {
+ $$ = define_menuitem ($2, 0, 0, 0, 0, NULL);
+ }
+ | MENUITEM QUOTEDSTRING cnumexpr
+ {
+ $$ = define_menuitem ($2, $3, 0, 0, 0, NULL);
+ }
+ | MENUITEM QUOTEDSTRING cnumexpr cnumexpr optcnumexpr
+ {
+ $$ = define_menuitem ($2, $3, $4, $5, 0, NULL);
+ }
+ | POPUP QUOTEDSTRING BEG menuexitems END
+ {
+ $$ = define_menuitem ($2, 0, 0, 0, 0, $4);
+ }
+ | POPUP QUOTEDSTRING cnumexpr BEG menuexitems END
+ {
+ $$ = define_menuitem ($2, $3, 0, 0, 0, $5);
+ }
+ | POPUP QUOTEDSTRING cnumexpr cnumexpr BEG menuexitems END
+ {
+ $$ = define_menuitem ($2, $3, $4, 0, 0, $6);
+ }
+ | POPUP QUOTEDSTRING cnumexpr cnumexpr cnumexpr optcnumexpr
+ BEG menuexitems END
+ {
+ $$ = define_menuitem ($2, $3, $4, $5, $6, $8);
+ }
+ ;
+
+/* Messagetable resources. */
+
+messagetable:
+ id MESSAGETABLE memflags_move file_name
+ {
+ define_messagetable ($1, &$3, $4);
+ }
+ ;
+
+/* Rcdata resources. */
+
+rcdata:
+ id RCDATA suboptions BEG optrcdata_data END
+ {
+ define_rcdata ($1, &$3, $5.first);
+ }
+ ;
+
+/* We use a different lexing algorithm, because rcdata strings may
+ contain embedded null bytes, and we need to know the length to use. */
+
+optrcdata_data:
+ {
+ rcparse_rcdata ();
+ }
+ optrcdata_data_int
+ {
+ rcparse_normal ();
+ $$ = $2;
+ }
+ ;
+
+optrcdata_data_int:
+ /* empty */
+ {
+ $$.first = NULL;
+ $$.last = NULL;
+ }
+ | rcdata_data
+ {
+ $$ = $1;
+ }
+ ;
+
+rcdata_data:
+ SIZEDSTRING
+ {
+ struct rcdata_item *ri;
+
+ ri = define_rcdata_string ($1.s, $1.length);
+ $$.first = ri;
+ $$.last = ri;
+ }
+ | sizednumexpr
+ {
+ struct rcdata_item *ri;
+
+ ri = define_rcdata_number ($1.val, $1.dword);
+ $$.first = ri;
+ $$.last = ri;
+ }
+ | rcdata_data ',' SIZEDSTRING
+ {
+ struct rcdata_item *ri;
+
+ ri = define_rcdata_string ($3.s, $3.length);
+ $$.first = $1.first;
+ $1.last->next = ri;
+ $$.last = ri;
+ }
+ | rcdata_data ',' sizednumexpr
+ {
+ struct rcdata_item *ri;
+
+ ri = define_rcdata_number ($3.val, $3.dword);
+ $$.first = $1.first;
+ $1.last->next = ri;
+ $$.last = ri;
+ }
+ ;
+
+/* Stringtable resources. */
+
+stringtable:
+ STRINGTABLE suboptions BEG
+ { sub_res_info = $2; }
+ string_data END
+ ;
+
+string_data:
+ /* empty */
+ | string_data numexpr QUOTEDSTRING
+ {
+ define_stringtable (&sub_res_info, $2, $3);
+ }
+ | string_data numexpr ',' QUOTEDSTRING
+ {
+ define_stringtable (&sub_res_info, $2, $4);
+ }
+ ;
+
+/* User defined resources. We accept general suboptions in the
+ file_name case to keep the parser happy. */
+
+user:
+ id id suboptions BEG optrcdata_data END
+ {
+ define_user_data ($1, $2, &$3, $5.first);
+ }
+ | id id suboptions file_name
+ {
+ define_user_file ($1, $2, &$3, $4);
+ }
+ ;
+
+/* Versioninfo resources. */
+
+versioninfo:
+ id VERSIONINFO fixedverinfo BEG verblocks END
+ {
+ define_versioninfo ($1, language, $3, $5);
+ }
+ ;
+
+fixedverinfo:
+ /* empty */
+ {
+ $$ = ((struct fixed_versioninfo *)
+ res_alloc (sizeof (struct fixed_versioninfo)));
+ memset ($$, 0, sizeof (struct fixed_versioninfo));
+ }
+ | fixedverinfo FILEVERSION numexpr cnumexpr cnumexpr cnumexpr
+ {
+ $1->file_version_ms = ($3 << 16) | $4;
+ $1->file_version_ls = ($5 << 16) | $6;
+ $$ = $1;
+ }
+ | fixedverinfo PRODUCTVERSION numexpr cnumexpr cnumexpr cnumexpr
+ {
+ $1->product_version_ms = ($3 << 16) | $4;
+ $1->product_version_ls = ($5 << 16) | $6;
+ $$ = $1;
+ }
+ | fixedverinfo FILEFLAGSMASK numexpr
+ {
+ $1->file_flags_mask = $3;
+ $$ = $1;
+ }
+ | fixedverinfo FILEFLAGS numexpr
+ {
+ $1->file_flags = $3;
+ $$ = $1;
+ }
+ | fixedverinfo FILEOS numexpr
+ {
+ $1->file_os = $3;
+ $$ = $1;
+ }
+ | fixedverinfo FILETYPE numexpr
+ {
+ $1->file_type = $3;
+ $$ = $1;
+ }
+ | fixedverinfo FILESUBTYPE numexpr
+ {
+ $1->file_subtype = $3;
+ $$ = $1;
+ }
+ ;
+
+/* To handle verblocks successfully, the lexer handles BLOCK
+ specially. A BLOCK "StringFileInfo" is returned as
+ BLOCKSTRINGFILEINFO. A BLOCK "VarFileInfo" is returned as
+ BLOCKVARFILEINFO. A BLOCK with some other string returns BLOCK
+ with the string as the value. */
+
+verblocks:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | verblocks BLOCKSTRINGFILEINFO BEG BLOCK BEG vervals END END
+ {
+ $$ = append_ver_stringfileinfo ($1, $4, $6);
+ }
+ | verblocks BLOCKVARFILEINFO BEG VALUE QUOTEDSTRING vertrans END
+ {
+ $$ = append_ver_varfileinfo ($1, $5, $6);
+ }
+ ;
+
+vervals:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | vervals VALUE QUOTEDSTRING ',' QUOTEDSTRING
+ {
+ $$ = append_verval ($1, $3, $5);
+ }
+ ;
+
+vertrans:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | vertrans cnumexpr cnumexpr
+ {
+ $$ = append_vertrans ($1, $2, $3);
+ }
+ ;
+
+/* A resource ID. */
+
+id:
+ posnumexpr
+ {
+ $$.named = 0;
+ $$.u.id = $1;
+ }
+ | STRING
+ {
+ char *copy, *s;
+
+ /* It seems that resource ID's are forced to upper case. */
+ copy = xstrdup ($1);
+ for (s = copy; *s != '\0'; s++)
+ if (islower (*s))
+ *s = toupper (*s);
+ res_string_to_id (&$$, copy);
+ free (copy);
+ }
+ ;
+
+/* Generic suboptions. These may appear before the BEGIN in any
+ multiline statement. */
+
+suboptions:
+ /* empty */
+ {
+ memset (&$$, 0, sizeof (struct res_res_info));
+ $$.language = language;
+ /* FIXME: Is this the right default? */
+ $$.memflags = MEMFLAG_MOVEABLE;
+ }
+ | suboptions memflag
+ {
+ $$ = $1;
+ $$.memflags |= $2.on;
+ $$.memflags &=~ $2.off;
+ }
+ | suboptions CHARACTERISTICS numexpr
+ {
+ $$ = $1;
+ $$.characteristics = $3;
+ }
+ | suboptions LANGUAGE numexpr cnumexpr
+ {
+ $$ = $1;
+ $$.language = $3 | ($4 << 8);
+ }
+ | suboptions VERSIONK numexpr
+ {
+ $$ = $1;
+ $$.version = $3;
+ }
+ ;
+
+/* Memory flags which default to MOVEABLE and DISCARDABLE. */
+
+memflags_move_discard:
+ /* empty */
+ {
+ memset (&$$, 0, sizeof (struct res_res_info));
+ $$.language = language;
+ $$.memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE;
+ }
+ | memflags_move_discard memflag
+ {
+ $$ = $1;
+ $$.memflags |= $2.on;
+ $$.memflags &=~ $2.off;
+ }
+ ;
+
+/* Memory flags which default to MOVEABLE. */
+
+memflags_move:
+ /* empty */
+ {
+ memset (&$$, 0, sizeof (struct res_res_info));
+ $$.language = language;
+ $$.memflags = MEMFLAG_MOVEABLE;
+ }
+ | memflags_move_discard memflag
+ {
+ $$ = $1;
+ $$.memflags |= $2.on;
+ $$.memflags &=~ $2.off;
+ }
+ ;
+
+/* Memory flags. This returns a struct with two integers, because we
+ sometimes want to set bits and we sometimes want to clear them. */
+
+memflag:
+ MOVEABLE
+ {
+ $$.on = MEMFLAG_MOVEABLE;
+ $$.off = 0;
+ }
+ | FIXED
+ {
+ $$.on = 0;
+ $$.off = MEMFLAG_MOVEABLE;
+ }
+ | PURE
+ {
+ $$.on = MEMFLAG_PURE;
+ $$.off = 0;
+ }
+ | IMPURE
+ {
+ $$.on = 0;
+ $$.off = MEMFLAG_PURE;
+ }
+ | PRELOAD
+ {
+ $$.on = MEMFLAG_PRELOAD;
+ $$.off = 0;
+ }
+ | LOADONCALL
+ {
+ $$.on = 0;
+ $$.off = MEMFLAG_PRELOAD;
+ }
+ | DISCARDABLE
+ {
+ $$.on = MEMFLAG_DISCARDABLE;
+ $$.off = 0;
+ }
+ ;
+
+/* A file name. */
+
+file_name:
+ QUOTEDSTRING
+ {
+ $$ = $1;
+ }
+ | STRING
+ {
+ $$ = $1;
+ }
+ ;
+
+/* A style expression. This changes the static variable STYLE. We do
+ it this way because rc appears to permit a style to be set to
+ something like
+ WS_GROUP | NOT WS_TABSTOP
+ to mean that a default of WS_TABSTOP should be removed. Anything
+ which wants to accept a style must first set STYLE to the default
+ value. The styleexpr nonterminal will change STYLE as specified by
+ the user. Note that we do not accept arbitrary expressions here,
+ just numbers separated by '|'. */
+
+styleexpr:
+ parennumber
+ {
+ style |= $1;
+ }
+ | NOT parennumber
+ {
+ style &=~ $2;
+ }
+ | styleexpr '|' parennumber
+ {
+ style |= $3;
+ }
+ | styleexpr '|' NOT parennumber
+ {
+ style &=~ $4;
+ }
+ ;
+
+parennumber:
+ NUMBER
+ {
+ $$ = $1.val;
+ }
+ | '(' numexpr ')'
+ {
+ $$ = $2;
+ }
+ ;
+
+/* An optional expression with a leading comma. */
+
+optcnumexpr:
+ /* empty */
+ {
+ $$ = 0;
+ }
+ | cnumexpr
+ {
+ $$ = $1;
+ }
+ ;
+
+/* An expression with a leading comma. */
+
+cnumexpr:
+ ',' numexpr
+ {
+ $$ = $2;
+ }
+ ;
+
+/* A possibly negated numeric expression. */
+
+numexpr:
+ sizednumexpr
+ {
+ $$ = $1.val;
+ }
+ ;
+
+/* A possibly negated expression with a size. */
+
+sizednumexpr:
+ NUMBER
+ {
+ $$ = $1;
+ }
+ | '(' sizednumexpr ')'
+ {
+ $$ = $2;
+ }
+ | '~' sizednumexpr %prec '~'
+ {
+ $$.val = ~ $2.val;
+ $$.dword = $2.dword;
+ }
+ | '-' sizednumexpr %prec NEG
+ {
+ $$.val = - $2.val;
+ $$.dword = $2.dword;
+ }
+ | sizednumexpr '*' sizednumexpr
+ {
+ $$.val = $1.val * $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizednumexpr '/' sizednumexpr
+ {
+ $$.val = $1.val / $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizednumexpr '%' sizednumexpr
+ {
+ $$.val = $1.val % $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizednumexpr '+' sizednumexpr
+ {
+ $$.val = $1.val + $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizednumexpr '-' sizednumexpr
+ {
+ $$.val = $1.val - $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizednumexpr '&' sizednumexpr
+ {
+ $$.val = $1.val & $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizednumexpr '^' sizednumexpr
+ {
+ $$.val = $1.val ^ $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizednumexpr '|' sizednumexpr
+ {
+ $$.val = $1.val | $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ ;
+
+/* An expression with a leading comma which does not use unary
+ negation. */
+
+cposnumexpr:
+ ',' posnumexpr
+ {
+ $$ = $2;
+ }
+ ;
+
+/* An expression which does not use unary negation. */
+
+posnumexpr:
+ sizedposnumexpr
+ {
+ $$ = $1.val;
+ }
+ ;
+
+/* An expression which does not use unary negation. We separate unary
+ negation to avoid parsing conflicts when two numeric expressions
+ appear consecutively. */
+
+sizedposnumexpr:
+ NUMBER
+ {
+ $$ = $1;
+ }
+ | '(' sizednumexpr ')'
+ {
+ $$ = $2;
+ }
+ | '~' sizednumexpr %prec '~'
+ {
+ $$.val = ~ $2.val;
+ $$.dword = $2.dword;
+ }
+ | sizedposnumexpr '*' sizednumexpr
+ {
+ $$.val = $1.val * $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizedposnumexpr '/' sizednumexpr
+ {
+ $$.val = $1.val / $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizedposnumexpr '%' sizednumexpr
+ {
+ $$.val = $1.val % $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizedposnumexpr '+' sizednumexpr
+ {
+ $$.val = $1.val + $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizedposnumexpr '-' sizednumexpr
+ {
+ $$.val = $1.val - $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizedposnumexpr '&' sizednumexpr
+ {
+ $$.val = $1.val & $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizedposnumexpr '^' sizednumexpr
+ {
+ $$.val = $1.val ^ $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ | sizedposnumexpr '|' sizednumexpr
+ {
+ $$.val = $1.val | $3.val;
+ $$.dword = $1.dword || $3.dword;
+ }
+ ;
+
+%%
+
+/* Set the language from the command line. */
+
+void
+rcparse_set_language (lang)
+ int lang;
+{
+ language = lang;
+}
diff --git a/contrib/binutils/binutils/resbin.c b/contrib/binutils/binutils/resbin.c
new file mode 100644
index 0000000..6f87a77
--- /dev/null
+++ b/contrib/binutils/binutils/resbin.c
@@ -0,0 +1,2376 @@
+/* resbin.c -- manipulate the Windows binary resource format.
+ Copyright 1997 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor, Cygnus Support.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/* This file contains functions to convert between the binary resource
+ format and the internal structures that we want to use. The same
+ binary resource format is used in both res and COFF files. */
+
+#include "bfd.h"
+#include "bucomm.h"
+#include "libiberty.h"
+#include "windres.h"
+
+/* Macros to swap in values. */
+
+#define get_16(be, s) ((be) ? bfd_getb16 (s) : bfd_getl16 (s))
+#define get_32(be, s) ((be) ? bfd_getb32 (s) : bfd_getl32 (s))
+
+/* Local functions. */
+
+static void toosmall PARAMS ((const char *));
+static unichar *get_unicode
+ PARAMS ((const unsigned char *, unsigned long, int, int *));
+static int get_resid
+ PARAMS ((struct res_id *, const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_generic
+ PARAMS ((enum res_type, const unsigned char *, unsigned long));
+static struct res_resource *bin_to_res_cursor
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_menu
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct menuitem *bin_to_res_menuitems
+ PARAMS ((const unsigned char *, unsigned long, int, int *));
+static struct menuitem *bin_to_res_menuexitems
+ PARAMS ((const unsigned char *, unsigned long, int, int *));
+static struct res_resource *bin_to_res_dialog
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_string
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_fontdir
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_accelerators
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_rcdata
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_group_cursor
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_group_icon
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_version
+ PARAMS ((const unsigned char *, unsigned long, int));
+static struct res_resource *bin_to_res_userdata
+ PARAMS ((const unsigned char *, unsigned long, int));
+
+/* Given a resource type ID, a pointer to data, a length, return a
+ res_resource structure which represents that resource. The caller
+ is responsible for initializing the res_info and coff_info fields
+ of the returned structure. */
+
+struct res_resource *
+bin_to_res (type, data, length, big_endian)
+ struct res_id type;
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ if (type.named)
+ return bin_to_res_userdata (data, length, big_endian);
+ else
+ {
+ switch (type.u.id)
+ {
+ default:
+ return bin_to_res_userdata (data, length, big_endian);
+ case RT_CURSOR:
+ return bin_to_res_cursor (data, length, big_endian);
+ case RT_BITMAP:
+ return bin_to_res_generic (RES_TYPE_BITMAP, data, length);
+ case RT_ICON:
+ return bin_to_res_generic (RES_TYPE_ICON, data, length);
+ case RT_MENU:
+ return bin_to_res_menu (data, length, big_endian);
+ case RT_DIALOG:
+ return bin_to_res_dialog (data, length, big_endian);
+ case RT_STRING:
+ return bin_to_res_string (data, length, big_endian);
+ case RT_FONTDIR:
+ return bin_to_res_fontdir (data, length, big_endian);
+ case RT_FONT:
+ return bin_to_res_generic (RES_TYPE_FONT, data, length);
+ case RT_ACCELERATORS:
+ return bin_to_res_accelerators (data, length, big_endian);
+ case RT_RCDATA:
+ return bin_to_res_rcdata (data, length, big_endian);
+ case RT_MESSAGETABLE:
+ return bin_to_res_generic (RES_TYPE_MESSAGETABLE, data, length);
+ case RT_GROUP_CURSOR:
+ return bin_to_res_group_cursor (data, length, big_endian);
+ case RT_GROUP_ICON:
+ return bin_to_res_group_icon (data, length, big_endian);
+ case RT_VERSION:
+ return bin_to_res_version (data, length, big_endian);
+ }
+ }
+}
+
+/* Give an error if the binary data is too small. */
+
+static void
+toosmall (msg)
+ const char *msg;
+{
+ fatal ("%s: not enough binary data", msg);
+}
+
+/* Swap in a NULL terminated unicode string. */
+
+static unichar *
+get_unicode (data, length, big_endian, retlen)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+ int *retlen;
+{
+ int c, i;
+ unichar *ret;
+
+ c = 0;
+ while (1)
+ {
+ if (length < c * 2 + 2)
+ toosmall ("null terminated unicode string");
+ if (get_16 (big_endian, data + c * 2) == 0)
+ break;
+ ++c;
+ }
+
+ ret = (unichar *) res_alloc ((c + 1) * sizeof (unichar));
+
+ for (i = 0; i < c; i++)
+ ret[i] = get_16 (big_endian, data + i * 2);
+ ret[i] = 0;
+
+ if (retlen != NULL)
+ *retlen = c;
+
+ return ret;
+}
+
+/* Get a resource identifier. This returns the number of bytes used. */
+
+static int
+get_resid (id, data, length, big_endian)
+ struct res_id *id;
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ int first;
+
+ if (length < 2)
+ toosmall ("resource ID");
+
+ first = get_16 (big_endian, data);
+ if (first == 0xffff)
+ {
+ if (length < 4)
+ toosmall ("resource ID");
+ id->named = 0;
+ id->u.id = get_16 (big_endian, data + 2);
+ return 4;
+ }
+ else
+ {
+ id->named = 1;
+ id->u.n.name = get_unicode (data, length, big_endian, &id->u.n.length);
+ return id->u.n.length * 2 + 2;
+ }
+}
+
+/* Convert a resource which just stores uninterpreted data from
+ binary. */
+
+struct res_resource *
+bin_to_res_generic (type, data, length)
+ enum res_type type;
+ const unsigned char *data;
+ unsigned long length;
+{
+ struct res_resource *r;
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = type;
+ r->u.data.data = data;
+ r->u.data.length = length;
+
+ return r;
+}
+
+/* Convert a cursor resource from binary. */
+
+struct res_resource *
+bin_to_res_cursor (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ struct cursor *c;
+ struct res_resource *r;
+
+ if (length < 4)
+ toosmall ("cursor");
+
+ c = (struct cursor *) res_alloc (sizeof *c);
+ c->xhotspot = get_16 (big_endian, data);
+ c->yhotspot = get_16 (big_endian, data + 2);
+ c->length = length - 4;
+ c->data = data + 4;
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_CURSOR;
+ r->u.cursor = c;
+
+ return r;
+}
+
+/* Convert a menu resource from binary. */
+
+struct res_resource *
+bin_to_res_menu (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ struct res_resource *r;
+ struct menu *m;
+ int version, read;
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_MENU;
+
+ m = (struct menu *) res_alloc (sizeof *m);
+ r->u.menu = m;
+
+ if (length < 2)
+ toosmall ("menu header");
+
+ version = get_16 (big_endian, data);
+
+ if (version == 0)
+ {
+ if (length < 4)
+ toosmall ("menu header");
+ m->help = 0;
+ m->items = bin_to_res_menuitems (data + 4, length - 4, big_endian,
+ &read);
+ }
+ else if (version == 1)
+ {
+ int offset;
+
+ if (length < 8)
+ toosmall ("menuex header");
+ m->help = get_32 (big_endian, data + 4);
+ offset = get_16 (big_endian, data + 2);
+ if (offset + 4 >= length)
+ toosmall ("menuex offset");
+ m->items = bin_to_res_menuexitems (data + 4 + offset,
+ length - (4 + offset),
+ big_endian,
+ &read);
+ }
+ else
+ fatal ("unsupported menu version %d", version);
+
+ return r;
+}
+
+/* Convert menu items from binary. */
+
+static struct menuitem *
+bin_to_res_menuitems (data, length, big_endian, read)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+ int *read;
+{
+ struct menuitem *first, **pp;
+
+ first = NULL;
+ pp = &first;
+
+ *read = 0;
+
+ while (length > 0)
+ {
+ int flags, stroff, slen, itemlen;
+ struct menuitem *mi;
+
+ if (length < 4)
+ toosmall ("menuitem header");
+
+ mi = (struct menuitem *) res_alloc (sizeof *mi);
+ mi->state = 0;
+ mi->help = 0;
+
+ flags = get_16 (big_endian, data);
+ mi->type = flags &~ (MENUITEM_POPUP | MENUITEM_ENDMENU);
+
+ if ((flags & MENUITEM_POPUP) == 0)
+ stroff = 4;
+ else
+ stroff = 2;
+
+ if (length < stroff + 2)
+ toosmall ("menuitem header");
+
+ if (get_16 (big_endian, data + stroff) == 0)
+ {
+ slen = 0;
+ mi->text = NULL;
+ }
+ else
+ mi->text = get_unicode (data + stroff, length - stroff, big_endian,
+ &slen);
+
+ itemlen = stroff + slen * 2 + 2;
+
+ if ((flags & MENUITEM_POPUP) == 0)
+ {
+ mi->popup = NULL;
+ mi->id = get_16 (big_endian, data + 2);
+ }
+ else
+ {
+ int subread;
+
+ mi->id = 0;
+ mi->popup = bin_to_res_menuitems (data + itemlen, length - itemlen,
+ big_endian, &subread);
+ itemlen += subread;
+ }
+
+ mi->next = NULL;
+ *pp = mi;
+ pp = &mi->next;
+
+ data += itemlen;
+ length -= itemlen;
+ *read += itemlen;
+
+ if ((flags & MENUITEM_ENDMENU) != 0)
+ return first;
+ }
+
+ return first;
+}
+
+/* Convert menuex items from binary. */
+
+static struct menuitem *
+bin_to_res_menuexitems (data, length, big_endian, read)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+ int *read;
+{
+ struct menuitem *first, **pp;
+
+ first = NULL;
+ pp = &first;
+
+ *read = 0;
+
+ while (length > 0)
+ {
+ int flags, slen, itemlen;
+ struct menuitem *mi;
+
+ if (length < 14)
+ toosmall ("menuitem header");
+
+ mi = (struct menuitem *) res_alloc (sizeof *mi);
+ mi->type = get_32 (big_endian, data);
+ mi->state = get_32 (big_endian, data + 4);
+ mi->id = get_16 (big_endian, data + 8);
+
+ flags = get_16 (big_endian, data + 10);
+
+ if (get_16 (big_endian, data + 12) == 0)
+ {
+ slen = 0;
+ mi->text = NULL;
+ }
+ else
+ mi->text = get_unicode (data + 12, length - 12, big_endian, &slen);
+
+ itemlen = 12 + slen * 2 + 2;
+ itemlen = (itemlen + 3) &~ 3;
+
+ if ((flags & 1) == 0)
+ {
+ mi->popup = NULL;
+ mi->help = 0;
+ }
+ else
+ {
+ int subread;
+
+ if (length < itemlen + 4)
+ toosmall ("menuitem");
+ mi->help = get_32 (big_endian, data + itemlen);
+ itemlen += 4;
+
+ mi->popup = bin_to_res_menuexitems (data + itemlen,
+ length - itemlen,
+ big_endian, &subread);
+ itemlen += subread;
+ }
+
+ mi->next = NULL;
+ *pp = mi;
+ pp = &mi->next;
+
+ data += itemlen;
+ length -= itemlen;
+ *read += itemlen;
+
+ if ((flags & 0x80) != 0)
+ return first;
+ }
+
+ return first;
+}
+
+/* Convert a dialog resource from binary. */
+
+static struct res_resource *
+bin_to_res_dialog (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ int version;
+ struct dialog *d;
+ int c, sublen, off, i;
+ struct dialog_control **pp;
+ struct res_resource *r;
+
+ if (length < 18)
+ toosmall ("dialog header");
+
+ d = (struct dialog *) res_alloc (sizeof *d);
+
+ version = get_16 (big_endian, data);
+ if (version != 0xffff)
+ {
+ d->ex = NULL;
+ d->style = get_32 (big_endian, data);
+ d->exstyle = get_32 (big_endian, data + 4);
+ off = 8;
+ }
+ else
+ {
+ int signature;
+
+ signature = get_16 (big_endian, data + 2);
+ if (signature != 1)
+ fatal ("unexpected dialog signature %d", signature);
+
+ d->ex = (struct dialog_ex *) res_alloc (sizeof (struct dialog_ex));
+ d->ex->help = get_32 (big_endian, data + 4);
+ d->exstyle = get_32 (big_endian, data + 8);
+ d->style = get_32 (big_endian, data + 12);
+ off = 16;
+ }
+
+ if (length < off + 10)
+ toosmall ("dialog header");
+
+ c = get_16 (big_endian, data + off);
+ d->x = get_16 (big_endian, data + off + 2);
+ d->y = get_16 (big_endian, data + off + 4);
+ d->width = get_16 (big_endian, data + off + 6);
+ d->height = get_16 (big_endian, data + off + 8);
+
+ off += 10;
+
+ sublen = get_resid (&d->menu, data + off, length - off, big_endian);
+ off += sublen;
+
+ sublen = get_resid (&d->class, data + off, length - off, big_endian);
+ off += sublen;
+
+ d->caption = get_unicode (data + off, length - off, big_endian, &sublen);
+ off += sublen * 2 + 2;
+
+ if ((d->style & DS_SETFONT) == 0)
+ {
+ d->pointsize = 0;
+ d->font = NULL;
+ if (d->ex != NULL)
+ {
+ d->ex->weight = 0;
+ d->ex->italic = 0;
+ }
+ }
+ else
+ {
+ if (length < off + 2)
+ toosmall ("dialog font point size");
+
+ d->pointsize = get_16 (big_endian, data + off);
+ off += 2;
+
+ if (d->ex != NULL)
+ {
+ if (length < off + 4)
+ toosmall ("dialogex font information");
+ d->ex->weight = get_16 (big_endian, data + off);
+ d->ex->italic = get_16 (big_endian, data + off + 2);
+ off += 4;
+ }
+
+ d->font = get_unicode (data + off, length - off, big_endian, &sublen);
+ off += sublen * 2 + 2;
+ }
+
+ d->controls = NULL;
+ pp = &d->controls;
+
+ for (i = 0; i < c; i++)
+ {
+ struct dialog_control *dc;
+ int datalen;
+
+ off = (off + 3) &~ 3;
+
+ dc = (struct dialog_control *) res_alloc (sizeof *dc);
+
+ if (d->ex == NULL)
+ {
+ if (length < off + 8)
+ toosmall ("dialog control");
+
+ dc->style = get_32 (big_endian, data + off);
+ dc->exstyle = get_32 (big_endian, data + off + 4);
+ dc->help = 0;
+ off += 8;
+ }
+ else
+ {
+ if (length < off + 12)
+ toosmall ("dialogex control");
+ dc->help = get_32 (big_endian, data + off);
+ dc->exstyle = get_32 (big_endian, data + off + 4);
+ dc->style = get_32 (big_endian, data + off + 18);
+ off += 12;
+ }
+
+ if (length < off + 10)
+ toosmall ("dialog control");
+
+ dc->x = get_16 (big_endian, data + off);
+ dc->y = get_16 (big_endian, data + off + 2);
+ dc->width = get_16 (big_endian, data + off + 4);
+ dc->height = get_16 (big_endian, data + off + 6);
+ dc->id = get_16 (big_endian, data + off + 8);
+
+ off += 10;
+
+ sublen = get_resid (&dc->class, data + off, length - off, big_endian);
+ off += sublen;
+
+ sublen = get_resid (&dc->text, data + off, length - off, big_endian);
+ off += sublen;
+
+ if (length < off + 2)
+ toosmall ("dialog control end");
+
+ datalen = get_16 (big_endian, data + off);
+ off += 2;
+
+ if (datalen == 0)
+ dc->data = NULL;
+ else
+ {
+ off = (off + 3) &~ 3;
+
+ if (length < off + datalen)
+ toosmall ("dialog control data");
+
+ dc->data = ((struct rcdata_item *)
+ res_alloc (sizeof (struct rcdata_item)));
+ dc->data->next = NULL;
+ dc->data->type = RCDATA_BUFFER;
+ dc->data->u.buffer.length = datalen;
+ dc->data->u.buffer.data = data + off;
+
+ off += datalen;
+ }
+
+ dc->next = NULL;
+ *pp = dc;
+ pp = &dc->next;
+ }
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_DIALOG;
+ r->u.dialog = d;
+
+ return r;
+}
+
+/* Convert a stringtable resource from binary. */
+
+static struct res_resource *
+bin_to_res_string (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ struct stringtable *st;
+ int i;
+ struct res_resource *r;
+
+ st = (struct stringtable *) res_alloc (sizeof *st);
+
+ for (i = 0; i < 16; i++)
+ {
+ int slen;
+
+ if (length < 2)
+ toosmall ("stringtable string length");
+ slen = get_16 (big_endian, data);
+ st->strings[i].length = slen;
+
+ if (slen > 0)
+ {
+ unichar *s;
+ int j;
+
+ if (length < 2 + 2 * slen)
+ toosmall ("stringtable string");
+
+ s = (unichar *) res_alloc (slen * sizeof (unichar));
+ st->strings[i].string = s;
+
+ for (j = 0; j < slen; j++)
+ s[j] = get_16 (big_endian, data + 2 + j * 2);
+ }
+
+ data += 2 + 2 * slen;
+ length -= 2 + 2 * slen;
+ }
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_STRINGTABLE;
+ r->u.stringtable = st;
+
+ return r;
+}
+
+/* Convert a fontdir resource from binary. */
+
+static struct res_resource *
+bin_to_res_fontdir (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ int c, i;
+ struct fontdir *first, **pp;
+ struct res_resource *r;
+
+ if (length < 2)
+ toosmall ("fontdir header");
+
+ c = get_16 (big_endian, data);
+
+ first = NULL;
+ pp = &first;
+
+ for (i = 0; i < c; i++)
+ {
+ struct fontdir *fd;
+ int off;
+
+ if (length < 56)
+ toosmall ("fontdir");
+
+ fd = (struct fontdir *) res_alloc (sizeof *fd);
+ fd->index = get_16 (big_endian, data);
+
+ /* To work out the length of the fontdir data, we must get the
+ length of the device name and face name strings, even though
+ we don't store them in the fontdir structure. The
+ documentation says that these are NULL terminated char
+ strings, not Unicode strings. */
+
+ off = 56;
+
+ while (off < length && data[off] != '\0')
+ ++off;
+ if (off >= length)
+ toosmall ("fontdir device name");
+ ++off;
+
+ while (off < length && data[off] != '\0')
+ ++off;
+ if (off >= length)
+ toosmall ("fontdir face name");
+ ++off;
+
+ fd->length = off;
+ fd->data = data;
+
+ fd->next = NULL;
+ *pp = fd;
+ pp = &fd->next;
+
+ /* The documentation does not indicate that any rounding is
+ required. */
+
+ data += off;
+ length -= off;
+ }
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_FONTDIR;
+ r->u.fontdir = first;
+
+ return r;
+}
+
+/* Convert an accelerators resource from binary. */
+
+static struct res_resource *
+bin_to_res_accelerators (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ struct accelerator *first, **pp;
+ struct res_resource *r;
+
+ first = NULL;
+ pp = &first;
+
+ while (1)
+ {
+ struct accelerator *a;
+
+ if (length < 8)
+ toosmall ("accelerator");
+
+ a = (struct accelerator *) res_alloc (sizeof *a);
+
+ a->flags = get_16 (big_endian, data);
+ a->key = get_16 (big_endian, data + 2);
+ a->id = get_16 (big_endian, data + 4);
+
+ a->next = NULL;
+ *pp = a;
+ pp = &a->next;
+
+ if ((a->flags & ACC_LAST) != 0)
+ break;
+
+ data += 8;
+ length -= 8;
+ }
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_ACCELERATOR;
+ r->u.acc = first;
+
+ return r;
+}
+
+/* Convert an rcdata resource from binary. */
+
+static struct res_resource *
+bin_to_res_rcdata (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ struct rcdata_item *ri;
+ struct res_resource *r;
+
+ ri = (struct rcdata_item *) res_alloc (sizeof *ri);
+
+ ri->next = NULL;
+ ri->type = RCDATA_BUFFER;
+ ri->u.buffer.length = length;
+ ri->u.buffer.data = data;
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_RCDATA;
+ r->u.rcdata = ri;
+
+ return r;
+}
+
+/* Convert a group cursor resource from binary. */
+
+static struct res_resource *
+bin_to_res_group_cursor (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ int type, c, i;
+ struct group_cursor *first, **pp;
+ struct res_resource *r;
+
+ if (length < 6)
+ toosmall ("group cursor header");
+
+ type = get_16 (big_endian, data + 2);
+ if (type != 2)
+ fatal ("unexpected group cursor type %d", type);
+
+ c = get_16 (big_endian, data + 4);
+
+ data += 6;
+ length -= 6;
+
+ first = NULL;
+ pp = &first;
+
+ for (i = 0; i < c; i++)
+ {
+ struct group_cursor *gc;
+
+ if (length < 14)
+ toosmall ("group cursor");
+
+ gc = (struct group_cursor *) res_alloc (sizeof *gc);
+
+ gc->width = get_16 (big_endian, data);
+ gc->height = get_16 (big_endian, data + 2);
+ gc->planes = get_16 (big_endian, data + 4);
+ gc->bits = get_16 (big_endian, data + 6);
+ gc->bytes = get_32 (big_endian, data + 8);
+ gc->index = get_16 (big_endian, data + 12);
+
+ gc->next = NULL;
+ *pp = gc;
+ pp = &gc->next;
+
+ data += 14;
+ length -= 14;
+ }
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_GROUP_CURSOR;
+ r->u.group_cursor = first;
+
+ return r;
+}
+
+/* Convert a group icon resource from binary. */
+
+static struct res_resource *
+bin_to_res_group_icon (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ int type, c, i;
+ struct group_icon *first, **pp;
+ struct res_resource *r;
+
+ if (length < 6)
+ toosmall ("group icon header");
+
+ type = get_16 (big_endian, data + 2);
+ if (type != 1)
+ fatal ("unexpected group icon type %d", type);
+
+ c = get_16 (big_endian, data + 4);
+
+ data += 6;
+ length -= 6;
+
+ first = NULL;
+ pp = &first;
+
+ for (i = 0; i < c; i++)
+ {
+ struct group_icon *gi;
+
+ if (length < 14)
+ toosmall ("group icon");
+
+ gi = (struct group_icon *) res_alloc (sizeof *gi);
+
+ gi->width = data[0];
+ gi->height = data[1];
+ gi->colors = data[2];
+ gi->planes = get_16 (big_endian, data + 4);
+ gi->bits = get_16 (big_endian, data + 6);
+ gi->bytes = get_32 (big_endian, data + 8);
+ gi->index = get_16 (big_endian, data + 12);
+
+ gi->next = NULL;
+ *pp = gi;
+ pp = &gi->next;
+
+ data += 14;
+ length -= 14;
+ }
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_GROUP_ICON;
+ r->u.group_icon = first;
+
+ return r;
+}
+
+/* Extract data from a version header. If KEY is not NULL, then the
+ key must be KEY; otherwise, the key is returned in *PKEY. This
+ sets *LEN to the total length, *VALLEN to the value length, *TYPE
+ to the type, and *OFF to the offset to the children. */
+
+static void
+get_version_header (data, length, big_endian, key, pkey, len, vallen, type,
+ off)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+ const char *key;
+ unichar **pkey;
+ int *len;
+ int *vallen;
+ int *type;
+ int *off;
+{
+ if (length < 8)
+ toosmall (key);
+
+ *len = get_16 (big_endian, data);
+ *vallen = get_16 (big_endian, data + 2);
+ *type = get_16 (big_endian, data + 4);
+
+ *off = 6;
+
+ length -= 6;
+ data += 6;
+
+ if (key == NULL)
+ {
+ int sublen;
+
+ *pkey = get_unicode (data, length, big_endian, &sublen);
+ *off += sublen * 2 + 2;
+ }
+ else
+ {
+ while (1)
+ {
+ if (length < 2)
+ toosmall (key);
+ if (get_16 (big_endian, data) != *key)
+ fatal ("unexpected version string");
+
+ *off += 2;
+ length -= 2;
+ data += 2;
+
+ if (*key == '\0')
+ break;
+
+ ++key;
+ }
+ }
+
+ *off = (*off + 3) &~ 3;
+}
+
+/* Convert a version resource from binary. */
+
+static struct res_resource *
+bin_to_res_version (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ int verlen, vallen, type, off;
+ struct fixed_versioninfo *fi;
+ struct ver_info *first, **pp;
+ struct versioninfo *v;
+ struct res_resource *r;
+
+ get_version_header (data, length, big_endian, "VS_VERSION_INFO",
+ (unichar *) NULL, &verlen, &vallen, &type, &off);
+
+ if (verlen != length)
+ fatal ("version length %d does not match resource length %lu",
+ verlen, length);
+
+ if (type != 0)
+ fatal ("unexpected version type %d", type);
+
+ data += off;
+ length -= off;
+
+ if (vallen == 0)
+ fi = NULL;
+ else
+ {
+ unsigned long signature, fiv;
+
+ if (vallen != 52)
+ fatal ("unexpected fixed version information length %d", vallen);
+
+ if (length < 52)
+ toosmall ("fixed version info");
+
+ signature = get_32 (big_endian, data);
+ if (signature != 0xfeef04bd)
+ fatal ("unexpected fixed version signature %lu", signature);
+
+ fiv = get_32 (big_endian, data + 4);
+ if (fiv != 0 && fiv != 0x10000)
+ fatal ("unexpected fixed version info version %lu", fiv);
+
+ fi = (struct fixed_versioninfo *) res_alloc (sizeof *fi);
+
+ fi->file_version_ms = get_32 (big_endian, data + 8);
+ fi->file_version_ls = get_32 (big_endian, data + 12);
+ fi->product_version_ms = get_32 (big_endian, data + 16);
+ fi->product_version_ls = get_32 (big_endian, data + 20);
+ fi->file_flags_mask = get_32 (big_endian, data + 24);
+ fi->file_flags = get_32 (big_endian, data + 28);
+ fi->file_os = get_32 (big_endian, data + 32);
+ fi->file_type = get_32 (big_endian, data + 36);
+ fi->file_subtype = get_32 (big_endian, data + 40);
+ fi->file_date_ms = get_32 (big_endian, data + 44);
+ fi->file_date_ls = get_32 (big_endian, data + 48);
+
+ data += 52;
+ length -= 52;
+ }
+
+ first = NULL;
+ pp = &first;
+
+ while (length > 0)
+ {
+ struct ver_info *vi;
+ int ch;
+
+ if (length < 8)
+ toosmall ("version var info");
+
+ vi = (struct ver_info *) res_alloc (sizeof *vi);
+
+ ch = get_16 (big_endian, data + 6);
+
+ if (ch == 'S')
+ {
+ struct ver_stringinfo **ppvs;
+
+ vi->type = VERINFO_STRING;
+
+ get_version_header (data, length, big_endian, "StringFileInfo",
+ (unichar *) NULL, &verlen, &vallen, &type,
+ &off);
+
+ if (vallen != 0)
+ fatal ("unexpected stringfileinfo value length %d", vallen);
+
+ data += off;
+ length -= off;
+
+ get_version_header (data, length, big_endian, (const char *) NULL,
+ &vi->u.string.language, &verlen, &vallen,
+ &type, &off);
+
+ if (vallen != 0)
+ fatal ("unexpected version stringtable value length %d", vallen);
+
+ data += off;
+ length -= off;
+ verlen -= off;
+
+ vi->u.string.strings = NULL;
+ ppvs = &vi->u.string.strings;
+
+ /* It's convenient to round verlen to a 4 byte alignment,
+ since we round the subvariables in the loop. */
+ verlen = (verlen + 3) &~ 3;
+
+ while (verlen > 0)
+ {
+ struct ver_stringinfo *vs;
+ int subverlen, vslen, valoff;
+
+ vs = (struct ver_stringinfo *) res_alloc (sizeof *vs);
+
+ get_version_header (data, length, big_endian,
+ (const char *) NULL, &vs->key, &subverlen,
+ &vallen, &type, &off);
+
+ subverlen = (subverlen + 3) &~ 3;
+
+ data += off;
+ length -= off;
+
+ vs->value = get_unicode (data, length, big_endian, &vslen);
+ valoff = vslen * 2 + 2;
+ valoff = (valoff + 3) &~ 3;
+
+ if (off + valoff != subverlen)
+ fatal ("unexpected version string length %d != %d + %d",
+ subverlen, off, valoff);
+
+ vs->next = NULL;
+ *ppvs = vs;
+ ppvs = &vs->next;
+
+ data += valoff;
+ length -= valoff;
+
+ if (verlen < subverlen)
+ fatal ("unexpected version string length %d < %d",
+ verlen, subverlen);
+
+ verlen -= subverlen;
+ }
+ }
+ else if (ch == 'V')
+ {
+ struct ver_varinfo **ppvv;
+
+ vi->type = VERINFO_VAR;
+
+ get_version_header (data, length, big_endian, "VarFileInfo",
+ (unichar *) NULL, &verlen, &vallen, &type,
+ &off);
+
+ if (vallen != 0)
+ fatal ("unexpected varfileinfo value length %d", vallen);
+
+ data += off;
+ length -= off;
+
+ get_version_header (data, length, big_endian, (const char *) NULL,
+ &vi->u.var.key, &verlen, &vallen, &type, &off);
+
+ data += off;
+ length -= off;
+
+ vi->u.var.var = NULL;
+ ppvv = &vi->u.var.var;
+
+ while (vallen > 0)
+ {
+ struct ver_varinfo *vv;
+
+ if (length < 4)
+ toosmall ("version varfileinfo");
+
+ vv = (struct ver_varinfo *) res_alloc (sizeof *vv);
+
+ vv->language = get_16 (big_endian, data);
+ vv->charset = get_16 (big_endian, data + 2);
+
+ vv->next = NULL;
+ *ppvv = vv;
+ ppvv = &vv->next;
+
+ data += 4;
+ length -= 4;
+
+ if (vallen < 4)
+ fatal ("unexpected version value length %d", vallen);
+
+ vallen -= 4;
+ }
+ }
+ else
+ fatal ("unexpected version string");
+
+ vi->next = NULL;
+ *pp = vi;
+ pp = &vi->next;
+ }
+
+ v = (struct versioninfo *) res_alloc (sizeof *v);
+ v->fixed = fi;
+ v->var = first;
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_VERSIONINFO;
+ r->u.versioninfo = v;
+
+ return r;
+}
+
+/* Convert an arbitrary user defined resource from binary. */
+
+static struct res_resource *
+bin_to_res_userdata (data, length, big_endian)
+ const unsigned char *data;
+ unsigned long length;
+ int big_endian;
+{
+ struct rcdata_item *ri;
+ struct res_resource *r;
+
+ ri = (struct rcdata_item *) res_alloc (sizeof *ri);
+
+ ri->next = NULL;
+ ri->type = RCDATA_BUFFER;
+ ri->u.buffer.length = length;
+ ri->u.buffer.data = data;
+
+ r = (struct res_resource *) res_alloc (sizeof *r);
+ r->type = RES_TYPE_USERDATA;
+ r->u.rcdata = ri;
+
+ return r;
+}
+
+/* Macros to swap out values. */
+
+#define put_16(be, v, s) ((be) ? bfd_putb16 ((v), (s)) : bfd_putl16 ((v), (s)))
+#define put_32(be, v, s) ((be) ? bfd_putb32 ((v), (s)) : bfd_putl32 ((v), (s)))
+
+/* Local functions used to convert resources to binary format. */
+
+static void dword_align_bin PARAMS ((struct bindata ***, unsigned long *));
+static struct bindata *resid_to_bin PARAMS ((struct res_id, int));
+static struct bindata *unicode_to_bin PARAMS ((const unichar *, int));
+static struct bindata *res_to_bin_accelerator
+ PARAMS ((const struct accelerator *, int));
+static struct bindata *res_to_bin_cursor
+ PARAMS ((const struct cursor *, int));
+static struct bindata *res_to_bin_group_cursor
+ PARAMS ((const struct group_cursor *, int));
+static struct bindata *res_to_bin_dialog
+ PARAMS ((const struct dialog *, int));
+static struct bindata *res_to_bin_fontdir
+ PARAMS ((const struct fontdir *, int));
+static struct bindata *res_to_bin_group_icon
+ PARAMS ((const struct group_icon *, int));
+static struct bindata *res_to_bin_menu
+ PARAMS ((const struct menu *, int));
+static struct bindata *res_to_bin_menuitems
+ PARAMS ((const struct menuitem *, int));
+static struct bindata *res_to_bin_menuexitems
+ PARAMS ((const struct menuitem *, int));
+static struct bindata *res_to_bin_rcdata
+ PARAMS ((const struct rcdata_item *, int));
+static struct bindata *res_to_bin_stringtable
+ PARAMS ((const struct stringtable *, int));
+static struct bindata *string_to_unicode_bin PARAMS ((const char *, int));
+static struct bindata *res_to_bin_versioninfo
+ PARAMS ((const struct versioninfo *, int));
+static struct bindata *res_to_bin_generic
+ PARAMS ((unsigned long, const unsigned char *));
+
+/* Convert a resource to binary. */
+
+struct bindata *
+res_to_bin (res, big_endian)
+ const struct res_resource *res;
+ int big_endian;
+{
+ switch (res->type)
+ {
+ default:
+ abort ();
+ case RES_TYPE_BITMAP:
+ case RES_TYPE_FONT:
+ case RES_TYPE_ICON:
+ case RES_TYPE_MESSAGETABLE:
+ return res_to_bin_generic (res->u.data.length, res->u.data.data);
+ case RES_TYPE_ACCELERATOR:
+ return res_to_bin_accelerator (res->u.acc, big_endian);
+ case RES_TYPE_CURSOR:
+ return res_to_bin_cursor (res->u.cursor, big_endian);
+ case RES_TYPE_GROUP_CURSOR:
+ return res_to_bin_group_cursor (res->u.group_cursor, big_endian);
+ case RES_TYPE_DIALOG:
+ return res_to_bin_dialog (res->u.dialog, big_endian);
+ case RES_TYPE_FONTDIR:
+ return res_to_bin_fontdir (res->u.fontdir, big_endian);
+ case RES_TYPE_GROUP_ICON:
+ return res_to_bin_group_icon (res->u.group_icon, big_endian);
+ case RES_TYPE_MENU:
+ return res_to_bin_menu (res->u.menu, big_endian);
+ case RES_TYPE_RCDATA:
+ return res_to_bin_rcdata (res->u.rcdata, big_endian);
+ case RES_TYPE_STRINGTABLE:
+ return res_to_bin_stringtable (res->u.stringtable, big_endian);
+ case RES_TYPE_USERDATA:
+ return res_to_bin_rcdata (res->u.rcdata, big_endian);
+ case RES_TYPE_VERSIONINFO:
+ return res_to_bin_versioninfo (res->u.versioninfo, big_endian);
+ }
+}
+
+/* Align to a 32 bit boundary. PPP points to the of a list of bindata
+ structures. LENGTH points to the length of the structures. If
+ necessary, this adds a new bindata to bring length up to a 32 bit
+ boundary. It updates *PPP and *LENGTH. */
+
+static void
+dword_align_bin (ppp, length)
+ struct bindata ***ppp;
+ unsigned long *length;
+{
+ int add;
+ struct bindata *d;
+
+ if ((*length & 3) == 0)
+ return;
+
+ add = 4 - (*length & 3);
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = add;
+ d->data = (unsigned char *) reswr_alloc (add);
+ memset (d->data, 0, add);
+
+ d->next = NULL;
+ **ppp = d;
+ *ppp = &(**ppp)->next;
+
+ *length += add;
+}
+
+/* Convert a resource ID to binary. This always returns exactly one
+ bindata structure. */
+
+static struct bindata *
+resid_to_bin (id, big_endian)
+ struct res_id id;
+ int big_endian;
+{
+ struct bindata *d;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+
+ if (! id.named)
+ {
+ d->length = 4;
+ d->data = (unsigned char *) reswr_alloc (4);
+ put_16 (big_endian, 0xffff, d->data);
+ put_16 (big_endian, id.u.id, d->data + 2);
+ }
+ else
+ {
+ int i;
+
+ d->length = id.u.n.length * 2 + 2;
+ d->data = (unsigned char *) reswr_alloc (d->length);
+ for (i = 0; i < id.u.n.length; i++)
+ put_16 (big_endian, id.u.n.name[i], d->data + i * 2);
+ put_16 (big_endian, 0, d->data + i * 2);
+ }
+
+ d->next = NULL;
+
+ return d;
+}
+
+/* Convert a null terminated unicode string to binary. This always
+ returns exactly one bindata structure. */
+
+static struct bindata *
+unicode_to_bin (str, big_endian)
+ const unichar *str;
+ int big_endian;
+{
+ int len;
+ struct bindata *d;
+
+ len = 0;
+ if (str != NULL)
+ {
+ const unichar *s;
+
+ for (s = str; *s != 0; s++)
+ ++len;
+ }
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = len * 2 + 2;
+ d->data = (unsigned char *) reswr_alloc (d->length);
+
+ if (str == NULL)
+ put_16 (big_endian, 0, d->data);
+ else
+ {
+ const unichar *s;
+ int i;
+
+ for (s = str, i = 0; *s != 0; s++, i++)
+ put_16 (big_endian, *s, d->data + i * 2);
+ put_16 (big_endian, 0, d->data + i * 2);
+ }
+
+ d->next = NULL;
+
+ return d;
+}
+
+/* Convert an accelerator resource to binary. */
+
+static struct bindata *
+res_to_bin_accelerator (accelerators, big_endian)
+ const struct accelerator *accelerators;
+ int big_endian;
+{
+ struct bindata *first, **pp;
+ const struct accelerator *a;
+
+ first = NULL;
+ pp = &first;
+
+ for (a = accelerators; a != NULL; a = a->next)
+ {
+ struct bindata *d;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 8;
+ d->data = (unsigned char *) reswr_alloc (8);
+
+ put_16 (big_endian,
+ a->flags | (a->next != NULL ? 0 : ACC_LAST),
+ d->data);
+ put_16 (big_endian, a->key, d->data + 2);
+ put_16 (big_endian, a->id, d->data + 4);
+ put_16 (big_endian, 0, d->data + 8);
+
+ d->next = NULL;
+ *pp = d;
+ pp = &d->next;
+ }
+
+ return first;
+}
+
+/* Convert a cursor resource to binary. */
+
+static struct bindata *
+res_to_bin_cursor (c, big_endian)
+ const struct cursor *c;
+ int big_endian;
+{
+ struct bindata *d;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 4;
+ d->data = (unsigned char *) reswr_alloc (4);
+
+ put_16 (big_endian, c->xhotspot, d->data);
+ put_16 (big_endian, c->yhotspot, d->data + 2);
+
+ d->next = (struct bindata *) reswr_alloc (sizeof *d);
+ d->next->length = c->length;
+ d->next->data = (unsigned char *) c->data;
+ d->next->next = NULL;
+
+ return d;
+}
+
+/* Convert a group cursor resource to binary. */
+
+static struct bindata *
+res_to_bin_group_cursor (group_cursors, big_endian)
+ const struct group_cursor *group_cursors;
+ int big_endian;
+{
+ struct bindata *first, **pp;
+ int c;
+ const struct group_cursor *gc;
+
+ first = (struct bindata *) reswr_alloc (sizeof *first);
+ first->length = 6;
+ first->data = (unsigned char *) reswr_alloc (6);
+
+ put_16 (big_endian, 0, first->data);
+ put_16 (big_endian, 2, first->data + 2);
+
+ first->next = NULL;
+ pp = &first->next;
+
+ c = 0;
+ for (gc = group_cursors; gc != NULL; gc = gc->next)
+ {
+ struct bindata *d;
+
+ ++c;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 14;
+ d->data = (unsigned char *) reswr_alloc (14);
+
+ put_16 (big_endian, gc->width, d->data);
+ put_16 (big_endian, gc->height, d->data + 2);
+ put_16 (big_endian, gc->planes, d->data + 4);
+ put_16 (big_endian, gc->bits, d->data + 6);
+ put_32 (big_endian, gc->bytes, d->data + 8);
+ put_16 (big_endian, gc->index, d->data + 12);
+
+ d->next = NULL;
+ *pp = d;
+ pp = &d->next;
+ }
+
+ put_16 (big_endian, c, first->data + 4);
+
+ return first;
+}
+
+/* Convert a dialog resource to binary. */
+
+static struct bindata *
+res_to_bin_dialog (dialog, big_endian)
+ const struct dialog *dialog;
+ int big_endian;
+{
+ int dialogex;
+ struct bindata *first, **pp;
+ unsigned long length;
+ int off, c;
+ struct dialog_control *dc;
+
+ dialogex = extended_dialog (dialog);
+
+ first = (struct bindata *) reswr_alloc (sizeof *first);
+ first->length = dialogex ? 26 : 18;
+ first->data = (unsigned char *) reswr_alloc (first->length);
+
+ length = first->length;
+
+ if (! dialogex)
+ {
+ put_32 (big_endian, dialog->style, first->data);
+ put_32 (big_endian, dialog->exstyle, first->data + 4);
+ off = 8;
+ }
+ else
+ {
+ put_16 (big_endian, 0xffff, first->data);
+ put_16 (big_endian, 1, first->data + 2);
+ if (dialog->ex == NULL)
+ put_32 (big_endian, 0, first->data + 4);
+ else
+ put_32 (big_endian, dialog->ex->help, first->data + 4);
+ put_32 (big_endian, dialog->exstyle, first->data + 8);
+ put_32 (big_endian, dialog->style, first->data + 12);
+ off = 16;
+ }
+
+ put_16 (big_endian, dialog->x, first->data + off + 2);
+ put_16 (big_endian, dialog->y, first->data + off + 4);
+ put_16 (big_endian, dialog->width, first->data + off + 6);
+ put_16 (big_endian, dialog->height, first->data + off + 8);
+
+ pp = &first->next;
+
+ *pp = resid_to_bin (dialog->menu, big_endian);
+ length += (*pp)->length;
+ pp = &(*pp)->next;
+
+ *pp = resid_to_bin (dialog->class, big_endian);
+ length += (*pp)->length;
+ pp = &(*pp)->next;
+
+ *pp = unicode_to_bin (dialog->caption, big_endian);
+ length += (*pp)->length;
+ pp = &(*pp)->next;
+
+ if ((dialog->style & DS_SETFONT) != 0)
+ {
+ struct bindata *d;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = dialogex ? 6 : 2;
+ d->data = (unsigned char *) reswr_alloc (d->length);
+
+ length += d->length;
+
+ put_16 (big_endian, dialog->pointsize, d->data);
+
+ if (dialogex)
+ {
+ if (dialog->ex == NULL)
+ {
+ put_16 (big_endian, 0, d->data + 2);
+ put_16 (big_endian, 0, d->data + 4);
+ }
+ else
+ {
+ put_16 (big_endian, dialog->ex->weight, d->data + 2);
+ put_16 (big_endian, dialog->ex->italic, d->data + 4);
+ }
+ }
+
+ *pp = d;
+ pp = &d->next;
+
+ *pp = unicode_to_bin (dialog->font, big_endian);
+ length += (*pp)->length;
+ pp = &(*pp)->next;
+ }
+
+ c = 0;
+ for (dc = dialog->controls; dc != NULL; dc = dc->next)
+ {
+ struct bindata *d;
+ int dcoff;
+
+ ++c;
+
+ dword_align_bin (&pp, &length);
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = dialogex ? 22 : 18;
+ d->data = (unsigned char *) reswr_alloc (d->length);
+
+ length += d->length;
+
+ if (! dialogex)
+ {
+ put_32 (big_endian, dc->style, d->data);
+ put_32 (big_endian, dc->exstyle, d->data + 4);
+ dcoff = 8;
+ }
+ else
+ {
+ put_32 (big_endian, dc->help, d->data);
+ put_32 (big_endian, dc->exstyle, d->data + 4);
+ put_32 (big_endian, dc->style, d->data + 8);
+ dcoff = 12;
+ }
+
+ put_16 (big_endian, dc->x, d->data + dcoff);
+ put_16 (big_endian, dc->y, d->data + dcoff + 2);
+ put_16 (big_endian, dc->width, d->data + dcoff + 4);
+ put_16 (big_endian, dc->height, d->data + dcoff + 6);
+ put_16 (big_endian, dc->id, d->data + dcoff + 8);
+
+ *pp = d;
+ pp = &d->next;
+
+ *pp = resid_to_bin (dc->class, big_endian);
+ length += (*pp)->length;
+ pp = &(*pp)->next;
+
+ *pp = resid_to_bin (dc->text, big_endian);
+ length += (*pp)->length;
+ pp = &(*pp)->next;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 2;
+ d->data = (unsigned char *) reswr_alloc (2);
+
+ length += 2;
+
+ d->next = NULL;
+ *pp = d;
+ pp = &d->next;
+
+ if (dc->data == NULL)
+ put_16 (big_endian, 0, d->data);
+ else
+ {
+ unsigned long sublen;
+
+ dword_align_bin (&pp, &length);
+
+ *pp = res_to_bin_rcdata (dc->data, big_endian);
+ sublen = 0;
+ while (*pp != NULL)
+ {
+ sublen += (*pp)->length;
+ pp = &(*pp)->next;
+ }
+
+ put_16 (big_endian, sublen, d->data);
+
+ length += sublen;
+ }
+ }
+
+ put_16 (big_endian, c, first->data + off);
+
+ return first;
+}
+
+/* Convert a fontdir resource to binary. */
+
+static struct bindata *
+res_to_bin_fontdir (fontdirs, big_endian)
+ const struct fontdir *fontdirs;
+ int big_endian;
+{
+ struct bindata *first, **pp;
+ int c;
+ const struct fontdir *fd;
+
+ first = (struct bindata *) reswr_alloc (sizeof *first);
+ first->length = 2;
+ first->data = (unsigned char *) reswr_alloc (2);
+
+ first->next = NULL;
+ pp = &first->next;
+
+ c = 0;
+ for (fd = fontdirs; fd != NULL; fd = fd->next)
+ {
+ struct bindata *d;
+
+ ++c;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 2;
+ d->data = (unsigned char *) reswr_alloc (2);
+
+ put_16 (big_endian, fd->index, d->data);
+
+ *pp = d;
+ pp = &d->next;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = fd->length;
+ d->data = (unsigned char *) fd->data;
+
+ d->next = NULL;
+ *pp = d;
+ pp = &d->next;
+ }
+
+ put_16 (big_endian, c, first->data);
+
+ return first;
+}
+
+/* Convert a group icon resource to binary. */
+
+static struct bindata *
+res_to_bin_group_icon (group_icons, big_endian)
+ const struct group_icon *group_icons;
+ int big_endian;
+{
+ struct bindata *first, **pp;
+ int c;
+ const struct group_icon *gi;
+
+ first = (struct bindata *) reswr_alloc (sizeof *first);
+ first->length = 6;
+ first->data = (unsigned char *) reswr_alloc (6);
+
+ put_16 (big_endian, 0, first->data);
+ put_16 (big_endian, 1, first->data + 2);
+
+ first->next = NULL;
+ pp = &first->next;
+
+ c = 0;
+ for (gi = group_icons; gi != NULL; gi = gi->next)
+ {
+ struct bindata *d;
+
+ ++c;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 14;
+ d->data = (unsigned char *) reswr_alloc (14);
+
+ d->data[0] = gi->width;
+ d->data[1] = gi->height;
+ d->data[2] = gi->colors;
+ d->data[3] = 0;
+ put_16 (big_endian, gi->planes, d->data + 4);
+ put_16 (big_endian, gi->bits, d->data + 6);
+ put_32 (big_endian, gi->bytes, d->data + 8);
+ put_16 (big_endian, gi->index, d->data + 12);
+
+ d->next = NULL;
+ *pp = d;
+ pp = &d->next;
+ }
+
+ put_16 (big_endian, c, first->data + 4);
+
+ return first;
+}
+
+/* Convert a menu resource to binary. */
+
+static struct bindata *
+res_to_bin_menu (menu, big_endian)
+ const struct menu *menu;
+ int big_endian;
+{
+ int menuex;
+ struct bindata *d;
+
+ menuex = extended_menu (menu);
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = menuex ? 8 : 4;
+ d->data = (unsigned char *) reswr_alloc (d->length);
+
+ if (! menuex)
+ {
+ put_16 (big_endian, 0, d->data);
+ put_16 (big_endian, 0, d->data + 2);
+
+ d->next = res_to_bin_menuitems (menu->items, big_endian);
+ }
+ else
+ {
+ put_16 (big_endian, 1, d->data);
+ put_16 (big_endian, 4, d->data + 2);
+ put_32 (big_endian, menu->help, d->data + 4);
+
+ d->next = res_to_bin_menuexitems (menu->items, big_endian);
+ }
+
+ return d;
+}
+
+/* Convert menu items to binary. */
+
+static struct bindata *
+res_to_bin_menuitems (items, big_endian)
+ const struct menuitem *items;
+ int big_endian;
+{
+ struct bindata *first, **pp;
+ const struct menuitem *mi;
+
+ first = NULL;
+ pp = &first;
+
+ for (mi = items; mi != NULL; mi = mi->next)
+ {
+ struct bindata *d;
+ int flags;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = mi->popup == NULL ? 4 : 2;
+ d->data = (unsigned char *) reswr_alloc (d->length);
+
+ flags = mi->type;
+ if (mi->next == NULL)
+ flags |= MENUITEM_ENDMENU;
+ if (mi->popup != NULL)
+ flags |= MENUITEM_POPUP;
+
+ put_16 (big_endian, flags, d->data);
+
+ if (mi->popup == NULL)
+ put_16 (big_endian, mi->id, d->data + 2);
+
+ *pp = d;
+ pp = &d->next;
+
+ *pp = unicode_to_bin (mi->text, big_endian);
+ pp = &(*pp)->next;
+
+ if (mi->popup != NULL)
+ {
+ *pp = res_to_bin_menuitems (mi->popup, big_endian);
+ while (*pp != NULL)
+ pp = &(*pp)->next;
+ }
+ }
+
+ return first;
+}
+
+/* Convert menuex items to binary. */
+
+static struct bindata *
+res_to_bin_menuexitems (items, big_endian)
+ const struct menuitem *items;
+ int big_endian;
+{
+ struct bindata *first, **pp;
+ unsigned long length;
+ const struct menuitem *mi;
+
+ first = NULL;
+ pp = &first;
+
+ length = 0;
+
+ for (mi = items; mi != NULL; mi = mi->next)
+ {
+ struct bindata *d;
+ int flags;
+
+ dword_align_bin (&pp, &length);
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 12;
+ d->data = (unsigned char *) reswr_alloc (12);
+
+ length += 12;
+
+ put_32 (big_endian, mi->type, d->data);
+ put_32 (big_endian, mi->state, d->data + 4);
+ put_16 (big_endian, mi->id, d->data + 8);
+
+ flags = 0;
+ if (mi->next == NULL)
+ flags |= 0x80;
+ if (mi->popup != NULL)
+ flags |= 1;
+ put_16 (big_endian, flags, d->data + 10);
+
+ *pp = d;
+ pp = &d->next;
+
+ *pp = unicode_to_bin (mi->text, big_endian);
+ length += (*pp)->length;
+ pp = &(*pp)->next;
+
+ if (mi->popup != NULL)
+ {
+ dword_align_bin (&pp, &length);
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 4;
+ d->data = (unsigned char *) reswr_alloc (4);
+
+ put_32 (big_endian, mi->help, d->data);
+
+ *pp = d;
+ pp = &d->next;
+
+ *pp = res_to_bin_menuexitems (mi->popup, big_endian);
+ while (*pp != NULL)
+ {
+ length += (*pp)->length;
+ pp = &(*pp)->next;
+ }
+ }
+ }
+
+ return first;
+}
+
+/* Convert an rcdata resource to binary. This is also used to convert
+ other information which happens to be stored in rcdata_item lists
+ to binary. */
+
+static struct bindata *
+res_to_bin_rcdata (items, big_endian)
+ const struct rcdata_item *items;
+ int big_endian;
+{
+ struct bindata *first, **pp;
+ const struct rcdata_item *ri;
+
+ first = NULL;
+ pp = &first;
+
+ for (ri = items; ri != NULL; ri = ri->next)
+ {
+ struct bindata *d;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+
+ switch (ri->type)
+ {
+ default:
+ abort ();
+
+ case RCDATA_WORD:
+ d->length = 2;
+ d->data = (unsigned char *) reswr_alloc (2);
+ put_16 (big_endian, ri->u.word, d->data);
+ break;
+
+ case RCDATA_DWORD:
+ d->length = 4;
+ d->data = (unsigned char *) reswr_alloc (4);
+ put_32 (big_endian, ri->u.dword, d->data);
+ break;
+
+ case RCDATA_STRING:
+ d->length = ri->u.string.length;
+ d->data = (unsigned char *) ri->u.string.s;
+ break;
+
+ case RCDATA_WSTRING:
+ {
+ unsigned long i;
+
+ d->length = ri->u.wstring.length * 2;
+ d->data = (unsigned char *) reswr_alloc (d->length);
+ for (i = 0; i < ri->u.wstring.length; i++)
+ put_16 (big_endian, ri->u.wstring.w[i], d->data + i * 2);
+ break;
+ }
+
+ case RCDATA_BUFFER:
+ d->length = ri->u.buffer.length;
+ d->data = (unsigned char *) ri->u.buffer.data;
+ break;
+ }
+
+ d->next = NULL;
+ *pp = d;
+ pp = &d->next;
+ }
+
+ return first;
+}
+
+/* Convert a stringtable resource to binary. */
+
+static struct bindata *
+res_to_bin_stringtable (st, big_endian)
+ const struct stringtable *st;
+ int big_endian;
+{
+ struct bindata *first, **pp;
+ int i;
+
+ first = NULL;
+ pp = &first;
+
+ for (i = 0; i < 16; i++)
+ {
+ int slen, j;
+ struct bindata *d;
+ unichar *s;
+
+ slen = st->strings[i].length;
+ s = st->strings[i].string;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 2 + slen * 2;
+ d->data = (unsigned char *) reswr_alloc (d->length);
+
+ put_16 (big_endian, slen, d->data);
+
+ for (j = 0; j < slen; j++)
+ put_16 (big_endian, s[j], d->data + 2 + j * 2);
+
+ d->next = NULL;
+ *pp = d;
+ pp = &d->next;
+ }
+
+ return first;
+}
+
+/* Convert an ASCII string to a unicode binary string. This always
+ returns exactly one bindata structure. */
+
+static struct bindata *
+string_to_unicode_bin (s, big_endian)
+ const char *s;
+ int big_endian;
+{
+ size_t len, i;
+ struct bindata *d;
+
+ len = strlen (s);
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = len * 2 + 2;
+ d->data = (unsigned char *) reswr_alloc (d->length);
+
+ for (i = 0; i < len; i++)
+ put_16 (big_endian, s[i], d->data + i * 2);
+ put_16 (big_endian, 0, d->data + i * 2);
+
+ d->next = NULL;
+
+ return d;
+}
+
+/* Convert a versioninfo resource to binary. */
+
+static struct bindata *
+res_to_bin_versioninfo (versioninfo, big_endian)
+ const struct versioninfo *versioninfo;
+ int big_endian;
+{
+ struct bindata *first, **pp;
+ unsigned long length;
+ struct ver_info *vi;
+
+ first = (struct bindata *) reswr_alloc (sizeof *first);
+ first->length = 6;
+ first->data = (unsigned char *) reswr_alloc (6);
+
+ length = 6;
+
+ if (versioninfo->fixed == NULL)
+ put_16 (big_endian, 0, first->data + 2);
+ else
+ put_16 (big_endian, 52, first->data + 2);
+
+ put_16 (big_endian, 0, first->data + 4);
+
+ pp = &first->next;
+
+ *pp = string_to_unicode_bin ("VS_VERSION_INFO", big_endian);
+ length += (*pp)->length;
+ pp = &(*pp)->next;
+
+ dword_align_bin (&pp, &length);
+
+ if (versioninfo->fixed != NULL)
+ {
+ const struct fixed_versioninfo *fi;
+ struct bindata *d;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = 52;
+ d->data = (unsigned char *) reswr_alloc (52);
+
+ length += 52;
+
+ fi = versioninfo->fixed;
+
+ put_32 (big_endian, 0xfeef04bd, d->data);
+ put_32 (big_endian, 0x10000, d->data + 4);
+ put_32 (big_endian, fi->file_version_ms, d->data + 8);
+ put_32 (big_endian, fi->file_version_ls, d->data + 12);
+ put_32 (big_endian, fi->product_version_ms, d->data + 16);
+ put_32 (big_endian, fi->product_version_ls, d->data + 20);
+ put_32 (big_endian, fi->file_flags_mask, d->data + 24);
+ put_32 (big_endian, fi->file_flags, d->data + 28);
+ put_32 (big_endian, fi->file_os, d->data + 32);
+ put_32 (big_endian, fi->file_type, d->data + 36);
+ put_32 (big_endian, fi->file_subtype, d->data + 40);
+ put_32 (big_endian, fi->file_date_ms, d->data + 44);
+ put_32 (big_endian, fi->file_date_ls, d->data + 48);
+
+ d->next = NULL;
+ *pp = d;
+ pp = &d->next;
+ }
+
+ for (vi = versioninfo->var; vi != NULL; vi = vi->next)
+ {
+ struct bindata *vid;
+ unsigned long vilen;
+
+ dword_align_bin (&pp, &length);
+
+ vid = (struct bindata *) reswr_alloc (sizeof *vid);
+ vid->length = 6;
+ vid->data = (unsigned char *) reswr_alloc (6);
+
+ length += 6;
+ vilen = 6;
+
+ put_16 (big_endian, 0, vid->data + 2);
+ put_16 (big_endian, 0, vid->data + 4);
+
+ *pp = vid;
+ pp = &vid->next;
+
+ switch (vi->type)
+ {
+ default:
+ abort ();
+
+ case VERINFO_STRING:
+ {
+ unsigned long hold, vslen;
+ struct bindata *vsd;
+ const struct ver_stringinfo *vs;
+
+ *pp = string_to_unicode_bin ("StringFileInfo", big_endian);
+ length += (*pp)->length;
+ vilen += (*pp)->length;
+ pp = &(*pp)->next;
+
+ hold = length;
+ dword_align_bin (&pp, &length);
+ vilen += length - hold;
+
+ vsd = (struct bindata *) reswr_alloc (sizeof *vsd);
+ vsd->length = 6;
+ vsd->data = (unsigned char *) reswr_alloc (6);
+
+ length += 6;
+ vilen += 6;
+ vslen = 6;
+
+ put_16 (big_endian, 0, vsd->data + 2);
+ put_16 (big_endian, 0, vsd->data + 4);
+
+ *pp = vsd;
+ pp = &vsd->next;
+
+ *pp = unicode_to_bin (vi->u.string.language, big_endian);
+ length += (*pp)->length;
+ vilen += (*pp)->length;
+ vslen += (*pp)->length;
+ pp = &(*pp)->next;
+
+ for (vs = vi->u.string.strings; vs != NULL; vs = vs->next)
+ {
+ struct bindata *vssd;
+ unsigned long vsslen;
+
+ hold = length;
+ dword_align_bin (&pp, &length);
+ vilen += length - hold;
+ vslen += length - hold;
+
+ vssd = (struct bindata *) reswr_alloc (sizeof *vssd);
+ vssd->length = 6;
+ vssd->data = (unsigned char *) reswr_alloc (6);
+
+ length += 6;
+ vilen += 6;
+ vslen += 6;
+ vsslen = 6;
+
+ put_16 (big_endian, 0, vssd->data + 2);
+ put_16 (big_endian, 1, vssd->data + 4);
+
+ *pp = vssd;
+ pp = &vssd->next;
+
+ *pp = unicode_to_bin (vs->key, big_endian);
+ length += (*pp)->length;
+ vilen += (*pp)->length;
+ vslen += (*pp)->length;
+ vsslen += (*pp)->length;
+ pp = &(*pp)->next;
+
+ hold = length;
+ dword_align_bin (&pp, &length);
+ vilen += length - hold;
+ vslen += length - hold;
+ vsslen += length - hold;
+
+ *pp = unicode_to_bin (vs->value, big_endian);
+ length += (*pp)->length;
+ vilen += (*pp)->length;
+ vslen += (*pp)->length;
+ vsslen += (*pp)->length;
+ pp = &(*pp)->next;
+
+ put_16 (big_endian, vsslen, vssd->data);
+ }
+
+ put_16 (big_endian, vslen, vsd->data);
+
+ break;
+ }
+
+ case VERINFO_VAR:
+ {
+ unsigned long hold, vvlen, vvvlen;
+ struct bindata *vvd;
+ const struct ver_varinfo *vv;
+
+ *pp = string_to_unicode_bin ("VarFileInfo", big_endian);
+ length += (*pp)->length;
+ vilen += (*pp)->length;
+ pp = &(*pp)->next;
+
+ hold = length;
+ dword_align_bin (&pp, &length);
+ vilen += length - hold;
+
+ vvd = (struct bindata *) reswr_alloc (sizeof *vvd);
+ vvd->length = 6;
+ vvd->data = (unsigned char *) reswr_alloc (6);
+
+ length += 6;
+ vilen += 6;
+ vvlen = 6;
+
+ put_16 (big_endian, 0, vvd->data + 4);
+
+ *pp = vvd;
+ pp = &vvd->next;
+
+ *pp = unicode_to_bin (vi->u.var.key, big_endian);
+ length += (*pp)->length;
+ vilen += (*pp)->length;
+ vvlen += (*pp)->length;
+ pp = &(*pp)->next;
+
+ hold = length;
+ dword_align_bin (&pp, &length);
+ vilen += length - hold;
+ vvlen += length - hold;
+
+ vvvlen = 0;
+
+ for (vv = vi->u.var.var; vv != NULL; vv = vv->next)
+ {
+ struct bindata *vvsd;
+
+ vvsd = (struct bindata *) reswr_alloc (sizeof *vvsd);
+ vvsd->length = 4;
+ vvsd->data = (unsigned char *) reswr_alloc (4);
+
+ length += 4;
+ vilen += 4;
+ vvlen += 4;
+ vvvlen += 4;
+
+ put_16 (big_endian, vv->language, vvsd->data);
+ put_16 (big_endian, vv->charset, vvsd->data + 2);
+
+ vvsd->next = NULL;
+ *pp = vvsd;
+ pp = &vvsd->next;
+ }
+
+ put_16 (big_endian, vvlen, vvd->data);
+ put_16 (big_endian, vvvlen, vvd->data + 2);
+
+ break;
+ }
+ }
+
+ put_16 (big_endian, vilen, vid->data);
+ }
+
+ put_16 (big_endian, length, first->data);
+
+ return first;
+}
+
+/* Convert a generic resource to binary. */
+
+static struct bindata *
+res_to_bin_generic (length, data)
+ unsigned long length;
+ const unsigned char *data;
+{
+ struct bindata *d;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+ d->length = length;
+ d->data = (unsigned char *) data;
+
+ d->next = NULL;
+
+ return d;
+}
diff --git a/contrib/binutils/binutils/rescoff.c b/contrib/binutils/binutils/rescoff.c
new file mode 100644
index 0000000..b7fd9c3
--- /dev/null
+++ b/contrib/binutils/binutils/rescoff.c
@@ -0,0 +1,776 @@
+/* rescoff.c -- read and write resources in Windows COFF files.
+ Copyright 1997 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor, Cygnus Support.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/* This file contains function that read and write Windows resources
+ in COFF files. */
+
+#include "bfd.h"
+#include "bucomm.h"
+#include "libiberty.h"
+#include "windres.h"
+
+#include <assert.h>
+
+/* In order to use the address of a resource data entry, we need to
+ get the image base of the file. Right now we extract it from
+ internal BFD information. FIXME. */
+
+#include "coff/internal.h"
+#include "libcoff.h"
+
+/* Information we extract from the file. */
+
+struct coff_file_info
+{
+ /* File name. */
+ const char *filename;
+ /* Data read from the file. */
+ const bfd_byte *data;
+ /* End of data read from file. */
+ const bfd_byte *data_end;
+ /* Address of the resource section minus the image base of the file. */
+ bfd_vma secaddr;
+ /* Non-zero if the file is big endian. */
+ int big_endian;
+};
+
+/* A resource directory table in a COFF file. */
+
+struct extern_res_directory
+{
+ /* Characteristics. */
+ bfd_byte characteristics[4];
+ /* Time stamp. */
+ bfd_byte time[4];
+ /* Major version number. */
+ bfd_byte major[2];
+ /* Minor version number. */
+ bfd_byte minor[2];
+ /* Number of named directory entries. */
+ bfd_byte name_count[2];
+ /* Number of directory entries with IDs. */
+ bfd_byte id_count[2];
+};
+
+/* A resource directory entry in a COFF file. */
+
+struct extern_res_entry
+{
+ /* Name or ID. */
+ bfd_byte name[4];
+ /* Address of resource entry or subdirectory. */
+ bfd_byte rva[4];
+};
+
+/* A resource data entry in a COFF file. */
+
+struct extern_res_data
+{
+ /* Address of resource data. This is apparently a file relative
+ address, rather than a section offset. */
+ bfd_byte rva[4];
+ /* Size of resource data. */
+ bfd_byte size[4];
+ /* Code page. */
+ bfd_byte codepage[4];
+ /* Reserved. */
+ bfd_byte reserved[4];
+};
+
+/* Macros to swap in values. */
+
+#define getfi_16(fi, s) ((fi)->big_endian ? bfd_getb16 (s) : bfd_getl16 (s))
+#define getfi_32(fi, s) ((fi)->big_endian ? bfd_getb32 (s) : bfd_getl32 (s))
+
+/* Local functions. */
+
+static void overrun PARAMS ((const struct coff_file_info *, const char *));
+static struct res_directory *read_coff_res_dir
+ PARAMS ((const bfd_byte *, const struct coff_file_info *,
+ const struct res_id *, int));
+static struct res_resource *read_coff_data_entry
+ PARAMS ((const bfd_byte *, const struct coff_file_info *,
+ const struct res_id *));
+
+/* Read the resources in a COFF file. */
+
+struct res_directory *
+read_coff_rsrc (filename, target)
+ const char *filename;
+ const char *target;
+{
+ bfd *abfd;
+ char **matching;
+ asection *sec;
+ bfd_size_type size;
+ bfd_byte *data;
+ struct coff_file_info finfo;
+
+ if (filename == NULL)
+ fatal ("filename required for COFF input");
+
+ abfd = bfd_openr (filename, target);
+ if (abfd == NULL)
+ bfd_fatal (filename);
+
+ if (! bfd_check_format_matches (abfd, bfd_object, &matching))
+ {
+ bfd_nonfatal (bfd_get_filename (abfd));
+ if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
+ list_matching_formats (matching);
+ xexit (1);
+ }
+
+ sec = bfd_get_section_by_name (abfd, ".rsrc");
+ if (sec == NULL)
+ {
+ fprintf (stderr, "%s: %s: no resource section\n", program_name,
+ filename);
+ xexit (1);
+ }
+
+ size = bfd_section_size (abfd, sec);
+ data = (bfd_byte *) res_alloc (size);
+
+ if (! bfd_get_section_contents (abfd, sec, data, 0, size))
+ bfd_fatal ("can't read resource section");
+
+ finfo.filename = filename;
+ finfo.data = data;
+ finfo.data_end = data + size;
+ finfo.secaddr = (bfd_get_section_vma (abfd, sec)
+ - pe_data (abfd)->pe_opthdr.ImageBase);
+ finfo.big_endian = bfd_big_endian (abfd);
+
+ bfd_close (abfd);
+
+ /* Now just read in the top level resource directory. Note that we
+ don't free data, since we create resource entries that point into
+ it. If we ever want to free up the resource information we read,
+ this will have to be cleaned up. */
+
+ return read_coff_res_dir (data, &finfo, (const struct res_id *) NULL, 0);
+}
+
+/* Give an error if we are out of bounds. */
+
+static void
+overrun (finfo, msg)
+ const struct coff_file_info *finfo;
+ const char *msg;
+{
+ fatal ("%s: %s: address out of bounds", finfo->filename, msg);
+}
+
+/* Read a resource directory. */
+
+static struct res_directory *
+read_coff_res_dir (data, finfo, type, level)
+ const bfd_byte *data;
+ const struct coff_file_info *finfo;
+ const struct res_id *type;
+ int level;
+{
+ const struct extern_res_directory *erd;
+ struct res_directory *rd;
+ int name_count, id_count, i;
+ struct res_entry **pp;
+ const struct extern_res_entry *ere;
+
+ if (finfo->data_end - data < sizeof (struct extern_res_directory))
+ overrun (finfo, "directory");
+
+ erd = (const struct extern_res_directory *) data;
+
+ rd = (struct res_directory *) res_alloc (sizeof *rd);
+ rd->characteristics = getfi_32 (finfo, erd->characteristics);
+ rd->time = getfi_32 (finfo, erd->time);
+ rd->major = getfi_16 (finfo, erd->major);
+ rd->minor = getfi_16 (finfo, erd->minor);
+ rd->entries = NULL;
+
+ name_count = getfi_16 (finfo, erd->name_count);
+ id_count = getfi_16 (finfo, erd->id_count);
+
+ pp = &rd->entries;
+
+ /* The resource directory entries immediately follow the directory
+ table. */
+ ere = (const struct extern_res_entry *) (erd + 1);
+
+ for (i = 0; i < name_count; i++, ere++)
+ {
+ unsigned long name, rva;
+ struct res_entry *re;
+ const bfd_byte *ers;
+ int length, j;
+
+ if ((const bfd_byte *) ere >= finfo->data_end)
+ overrun (finfo, "named directory entry");
+
+ name = getfi_32 (finfo, ere->name);
+ rva = getfi_32 (finfo, ere->rva);
+
+ /* For some reason the high bit in NAME is set. */
+ name &=~ 0x80000000;
+
+ if (name > finfo->data_end - finfo->data)
+ overrun (finfo, "directory entry name");
+
+ ers = finfo->data + name;
+
+ re = (struct res_entry *) res_alloc (sizeof *re);
+ re->next = NULL;
+ re->id.named = 1;
+ length = getfi_16 (finfo, ers);
+ re->id.u.n.length = length;
+ re->id.u.n.name = (unichar *) res_alloc (length * sizeof (unichar));
+ for (j = 0; j < length; j++)
+ re->id.u.n.name[j] = getfi_16 (finfo, ers + j * 2 + 2);
+
+ if (level == 0)
+ type = &re->id;
+
+ if ((rva & 0x80000000) != 0)
+ {
+ rva &=~ 0x80000000;
+ if (rva >= finfo->data_end - finfo->data)
+ overrun (finfo, "named subdirectory");
+ re->subdir = 1;
+ re->u.dir = read_coff_res_dir (finfo->data + rva, finfo, type,
+ level + 1);
+ }
+ else
+ {
+ if (rva >= finfo->data_end - finfo->data)
+ overrun (finfo, "named resource");
+ re->subdir = 0;
+ re->u.res = read_coff_data_entry (finfo->data + rva, finfo, type);
+ }
+
+ *pp = re;
+ pp = &re->next;
+ }
+
+ for (i = 0; i < id_count; i++, ere++)
+ {
+ unsigned long name, rva;
+ struct res_entry *re;
+
+ if ((const bfd_byte *) ere >= finfo->data_end)
+ overrun (finfo, "ID directory entry");
+
+ name = getfi_32 (finfo, ere->name);
+ rva = getfi_32 (finfo, ere->rva);
+
+ re = (struct res_entry *) res_alloc (sizeof *re);
+ re->next = NULL;
+ re->id.named = 0;
+ re->id.u.id = name;
+
+ if (level == 0)
+ type = &re->id;
+
+ if ((rva & 0x80000000) != 0)
+ {
+ rva &=~ 0x80000000;
+ if (rva >= finfo->data_end - finfo->data)
+ overrun (finfo, "ID subdirectory");
+ re->subdir = 1;
+ re->u.dir = read_coff_res_dir (finfo->data + rva, finfo, type,
+ level + 1);
+ }
+ else
+ {
+ if (rva >= finfo->data_end - finfo->data)
+ overrun (finfo, "ID resource");
+ re->subdir = 0;
+ re->u.res = read_coff_data_entry (finfo->data + rva, finfo, type);
+ }
+
+ *pp = re;
+ pp = &re->next;
+ }
+
+ return rd;
+}
+
+/* Read a resource data entry. */
+
+static struct res_resource *
+read_coff_data_entry (data, finfo, type)
+ const bfd_byte *data;
+ const struct coff_file_info *finfo;
+ const struct res_id *type;
+{
+ const struct extern_res_data *erd;
+ struct res_resource *r;
+ unsigned long size, rva;
+ const bfd_byte *resdata;
+
+ if (type == NULL)
+ fatal ("resource type unknown");
+
+ if (finfo->data_end - data < sizeof (struct extern_res_data))
+ overrun (finfo, "data entry");
+
+ erd = (const struct extern_res_data *) data;
+
+ size = getfi_32 (finfo, erd->size);
+ rva = getfi_32 (finfo, erd->rva);
+ if (rva < finfo->secaddr
+ || rva - finfo->secaddr >= finfo->data_end - finfo->data)
+ overrun (finfo, "resource data");
+
+ resdata = finfo->data + (rva - finfo->secaddr);
+
+ if (size > finfo->data_end - resdata)
+ overrun (finfo, "resource data size");
+
+ r = bin_to_res (*type, resdata, size, finfo->big_endian);
+
+ memset (&r->res_info, 0, sizeof (struct res_res_info));
+ r->coff_info.codepage = getfi_32 (finfo, erd->codepage);
+ r->coff_info.reserved = getfi_32 (finfo, erd->reserved);
+
+ return r;
+}
+
+/* This structure is used to build a list of bindata structures. */
+
+struct bindata_build
+{
+ /* The data. */
+ struct bindata *d;
+ /* The last structure we have added to the list. */
+ struct bindata *last;
+ /* The size of the list as a whole. */
+ unsigned long length;
+};
+
+/* This structure keeps track of information as we build the directory
+ tree. */
+
+struct coff_write_info
+{
+ /* These fields are based on the BFD. */
+ /* The BFD itself. */
+ bfd *abfd;
+ /* Non-zero if the file is big endian. */
+ int big_endian;
+ /* Pointer to section symbol used to build RVA relocs. */
+ asymbol **sympp;
+
+ /* These fields are computed initially, and then not changed. */
+ /* Length of directory tables and entries. */
+ unsigned long dirsize;
+ /* Length of directory entry strings. */
+ unsigned long dirstrsize;
+ /* Length of resource data entries. */
+ unsigned long dataentsize;
+
+ /* These fields are updated as we add data. */
+ /* Directory tables and entries. */
+ struct bindata_build dirs;
+ /* Directory entry strings. */
+ struct bindata_build dirstrs;
+ /* Resource data entries. */
+ struct bindata_build dataents;
+ /* Actual resource data. */
+ struct bindata_build resources;
+ /* Relocations. */
+ arelent **relocs;
+ /* Number of relocations. */
+ unsigned int reloc_count;
+};
+
+/* Macros to swap out values. */
+
+#define putcwi_16(cwi, v, s) \
+ ((cwi->big_endian) ? bfd_putb16 ((v), (s)) : bfd_putl16 ((v), (s)))
+#define putcwi_32(cwi, v, s) \
+ ((cwi->big_endian) ? bfd_putb32 ((v), (s)) : bfd_putl32 ((v), (s)))
+
+static void coff_bin_sizes
+ PARAMS ((const struct res_directory *, struct coff_write_info *));
+static unsigned char *coff_alloc PARAMS ((struct bindata_build *, size_t));
+static void coff_to_bin
+ PARAMS ((const struct res_directory *, struct coff_write_info *));
+static void coff_res_to_bin
+ PARAMS ((const struct res_resource *, struct coff_write_info *));
+
+/* Write resources to a COFF file. RESOURCES should already be
+ sorted.
+
+ Right now we always create a new file. Someday we should also
+ offer the ability to merge resources into an existing file. This
+ would require doing the basic work of objcopy, just modifying or
+ adding the .rsrc section. */
+
+void
+write_coff_file (filename, target, resources)
+ const char *filename;
+ const char *target;
+ const struct res_directory *resources;
+{
+ bfd *abfd;
+ asection *sec;
+ struct coff_write_info cwi;
+ struct bindata *d;
+ unsigned long length, offset;
+
+ if (filename == NULL)
+ fatal ("filename required for COFF output");
+
+ abfd = bfd_openw (filename, target);
+ if (abfd == NULL)
+ bfd_fatal (filename);
+
+ if (! bfd_set_format (abfd, bfd_object))
+ bfd_fatal ("bfd_set_format");
+
+ /* FIXME: This is obviously i386 specific. */
+ if (! bfd_set_arch_mach (abfd, bfd_arch_i386, 0))
+ bfd_fatal ("bfd_set_arch_mach");
+
+ if (! bfd_set_file_flags (abfd, HAS_SYMS | HAS_RELOC))
+ bfd_fatal ("bfd_set_file_flags");
+
+ sec = bfd_make_section (abfd, ".rsrc");
+ if (sec == NULL)
+ bfd_fatal ("bfd_make_section");
+
+ if (! bfd_set_section_flags (abfd, sec,
+ (SEC_HAS_CONTENTS | SEC_ALLOC
+ | SEC_LOAD | SEC_DATA)))
+ bfd_fatal ("bfd_set_section_flags");
+
+ if (! bfd_set_symtab (abfd, sec->symbol_ptr_ptr, 1))
+ bfd_fatal ("bfd_set_symtab");
+
+ /* Requiring this is probably a bug in BFD. */
+ sec->output_section = sec;
+
+ /* The order of data in the .rsrc section is
+ resource directory tables and entries
+ resource directory strings
+ resource data entries
+ actual resource data
+
+ We build these different types of data in different lists. */
+
+ cwi.abfd = abfd;
+ cwi.big_endian = bfd_big_endian (abfd);
+ cwi.sympp = sec->symbol_ptr_ptr;
+ cwi.dirsize = 0;
+ cwi.dirstrsize = 0;
+ cwi.dataentsize = 0;
+ cwi.dirs.d = NULL;
+ cwi.dirs.last = NULL;
+ cwi.dirs.length = 0;
+ cwi.dirstrs.d = NULL;
+ cwi.dirstrs.last = NULL;
+ cwi.dirstrs.length = 0;
+ cwi.dataents.d = NULL;
+ cwi.dataents.last = NULL;
+ cwi.dataents.length = 0;
+ cwi.resources.d = NULL;
+ cwi.resources.last = NULL;
+ cwi.resources.length = 0;
+ cwi.relocs = NULL;
+ cwi.reloc_count = 0;
+
+ /* Work out the sizes of the resource directory entries, so that we
+ know the various offsets we will need. */
+ coff_bin_sizes (resources, &cwi);
+
+ /* Force the directory strings to be 32 bit aligned. Every other
+ structure is 32 bit aligned anyhow. */
+ cwi.dirstrsize = (cwi.dirstrsize + 3) &~ 3;
+
+ /* Actually convert the resources to binary. */
+ coff_to_bin (resources, &cwi);
+
+ /* Add another 2 bytes to the directory strings if needed for
+ alignment. */
+ if ((cwi.dirstrs.length & 3) != 0)
+ {
+ unsigned char *ex;
+
+ ex = coff_alloc (&cwi.dirstrs, 2);
+ ex[0] = 0;
+ ex[1] = 0;
+ }
+
+ /* Make sure that the data we built came out to the same size as we
+ calculated initially. */
+ assert (cwi.dirs.length == cwi.dirsize);
+ assert (cwi.dirstrs.length == cwi.dirstrsize);
+ assert (cwi.dataents.length == cwi.dataentsize);
+
+ length = (cwi.dirsize
+ + cwi.dirstrsize
+ + cwi.dataentsize
+ + cwi.resources.length);
+
+ if (! bfd_set_section_size (abfd, sec, length))
+ bfd_fatal ("bfd_set_section_size");
+
+ bfd_set_reloc (abfd, sec, cwi.relocs, cwi.reloc_count);
+
+ offset = 0;
+ for (d = cwi.dirs.d; d != NULL; d = d->next)
+ {
+ if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
+ bfd_fatal ("bfd_set_section_contents");
+ offset += d->length;
+ }
+ for (d = cwi.dirstrs.d; d != NULL; d = d->next)
+ {
+ if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
+ bfd_fatal ("bfd_set_section_contents");
+ offset += d->length;
+ }
+ for (d = cwi.dataents.d; d != NULL; d = d->next)
+ {
+ if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
+ bfd_fatal ("bfd_set_section_contents");
+ offset += d->length;
+ }
+ for (d = cwi.resources.d; d != NULL; d = d->next)
+ {
+ if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
+ bfd_fatal ("bfd_set_section_contents");
+ offset += d->length;
+ }
+
+ assert (offset == length);
+
+ if (! bfd_close (abfd))
+ bfd_fatal ("bfd_close");
+
+ /* We allocated the relocs array using malloc. */
+ free (cwi.relocs);
+}
+
+/* Work out the sizes of the various fixed size resource directory
+ entries. This updates fields in CWI. */
+
+static void
+coff_bin_sizes (resdir, cwi)
+ const struct res_directory *resdir;
+ struct coff_write_info *cwi;
+{
+ const struct res_entry *re;
+
+ cwi->dirsize += sizeof (struct extern_res_directory);
+
+ for (re = resdir->entries; re != NULL; re = re->next)
+ {
+ cwi->dirsize += sizeof (struct extern_res_entry);
+
+ if (re->id.named)
+ cwi->dirstrsize += re->id.u.n.length * 2 + 2;
+
+ if (re->subdir)
+ coff_bin_sizes (re->u.dir, cwi);
+ else
+ cwi->dataentsize += sizeof (struct extern_res_data);
+ }
+}
+
+/* Allocate data for a particular list. */
+
+static unsigned char *
+coff_alloc (bb, size)
+ struct bindata_build *bb;
+ size_t size;
+{
+ struct bindata *d;
+
+ d = (struct bindata *) reswr_alloc (sizeof *d);
+
+ d->next = NULL;
+ d->data = (unsigned char *) reswr_alloc (size);
+ d->length = size;
+
+ if (bb->d == NULL)
+ bb->d = d;
+ else
+ bb->last->next = d;
+ bb->last = d;
+ bb->length += size;
+
+ return d->data;
+}
+
+/* Convert the resource directory RESDIR to binary. */
+
+static void
+coff_to_bin (resdir, cwi)
+ const struct res_directory *resdir;
+ struct coff_write_info *cwi;
+{
+ struct extern_res_directory *erd;
+ int ci, cn;
+ const struct res_entry *e;
+ struct extern_res_entry *ere;
+
+ /* Write out the directory table. */
+
+ erd = ((struct extern_res_directory *)
+ coff_alloc (&cwi->dirs, sizeof (*erd)));
+
+ putcwi_32 (cwi, resdir->characteristics, erd->characteristics);
+ putcwi_32 (cwi, resdir->time, erd->time);
+ putcwi_16 (cwi, resdir->major, erd->major);
+ putcwi_16 (cwi, resdir->minor, erd->minor);
+
+ ci = 0;
+ cn = 0;
+ for (e = resdir->entries; e != NULL; e = e->next)
+ {
+ if (e->id.named)
+ ++cn;
+ else
+ ++ci;
+ }
+
+ putcwi_16 (cwi, cn, erd->name_count);
+ putcwi_16 (cwi, ci, erd->id_count);
+
+ /* Write out the data entries. Note that we allocate space for all
+ the entries before writing them out. That permits a recursive
+ call to work correctly when writing out subdirectories. */
+
+ ere = ((struct extern_res_entry *)
+ coff_alloc (&cwi->dirs, (ci + cn) * sizeof (*ere)));
+ for (e = resdir->entries; e != NULL; e = e->next, ere++)
+ {
+ if (! e->id.named)
+ putcwi_32 (cwi, e->id.u.id, ere->name);
+ else
+ {
+ unsigned char *str;
+ int i;
+
+ /* For some reason existing files seem to have the high bit
+ set on the address of the name, although that is not
+ documented. */
+ putcwi_32 (cwi,
+ 0x80000000 | (cwi->dirsize + cwi->dirstrs.length),
+ ere->name);
+
+ str = coff_alloc (&cwi->dirstrs, e->id.u.n.length * 2 + 2);
+ putcwi_16 (cwi, e->id.u.n.length, str);
+ for (i = 0; i < e->id.u.n.length; i++)
+ putcwi_16 (cwi, e->id.u.n.name[i], str + i * 2 + 2);
+ }
+
+ if (e->subdir)
+ {
+ putcwi_32 (cwi, 0x80000000 | cwi->dirs.length, ere->rva);
+ coff_to_bin (e->u.dir, cwi);
+ }
+ else
+ {
+ putcwi_32 (cwi,
+ cwi->dirsize + cwi->dirstrsize + cwi->dataents.length,
+ ere->rva);
+
+ coff_res_to_bin (e->u.res, cwi);
+ }
+ }
+}
+
+/* Convert the resource RES to binary. */
+
+static void
+coff_res_to_bin (res, cwi)
+ const struct res_resource *res;
+ struct coff_write_info *cwi;
+{
+ arelent *r;
+ struct extern_res_data *erd;
+ struct bindata *d;
+ unsigned long length;
+
+ /* For some reason, although every other address is a section
+ offset, the address of the resource data itself is an RVA. That
+ means that we need to generate a relocation for it. We allocate
+ the relocs array using malloc so that we can use realloc. FIXME:
+ This relocation handling is correct for the i386, but probably
+ not for any other target. */
+
+ r = (arelent *) reswr_alloc (sizeof (arelent));
+ r->sym_ptr_ptr = cwi->sympp;
+ r->address = cwi->dirsize + cwi->dirstrsize + cwi->dataents.length;
+ r->addend = 0;
+ r->howto = bfd_reloc_type_lookup (cwi->abfd, BFD_RELOC_RVA);
+ if (r->howto == NULL)
+ bfd_fatal ("can't get BFD_RELOC_RVA relocation type");
+
+ cwi->relocs = xrealloc (cwi->relocs,
+ (cwi->reloc_count + 2) * sizeof (arelent *));
+ cwi->relocs[cwi->reloc_count] = r;
+ cwi->relocs[cwi->reloc_count + 1] = NULL;
+ ++cwi->reloc_count;
+
+ erd = (struct extern_res_data *) coff_alloc (&cwi->dataents, sizeof (*erd));
+
+ putcwi_32 (cwi,
+ (cwi->dirsize
+ + cwi->dirstrsize
+ + cwi->dataentsize
+ + cwi->resources.length),
+ erd->rva);
+ putcwi_32 (cwi, res->coff_info.codepage, erd->codepage);
+ putcwi_32 (cwi, res->coff_info.reserved, erd->reserved);
+
+ d = res_to_bin (res, cwi->big_endian);
+
+ if (cwi->resources.d == NULL)
+ cwi->resources.d = d;
+ else
+ cwi->resources.last->next = d;
+
+ length = 0;
+ for (; d->next != NULL; d = d->next)
+ length += d->length;
+ length += d->length;
+ cwi->resources.last = d;
+ cwi->resources.length += length;
+
+ putcwi_32 (cwi, length, erd->size);
+
+ /* Force the next resource to have 32 bit alignment. */
+
+ if ((length & 3) != 0)
+ {
+ int add;
+ unsigned char *ex;
+
+ add = 4 - (length & 3);
+
+ ex = coff_alloc (&cwi->resources, add);
+ memset (ex, 0, add);
+ }
+}
diff --git a/contrib/binutils/binutils/resrc.c b/contrib/binutils/binutils/resrc.c
new file mode 100644
index 0000000..a836780
--- /dev/null
+++ b/contrib/binutils/binutils/resrc.c
@@ -0,0 +1,2260 @@
+/* resrc.c -- read and write Windows rc files.
+ Copyright 1997, 1998 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor, Cygnus Support.
+
+ This file is part of GNU Binutils.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/* This file contains functions that read and write Windows rc files.
+ These are text files that represent resources. */
+
+#include "bfd.h"
+#include "bucomm.h"
+#include "libiberty.h"
+#include "windres.h"
+
+#include <assert.h>
+#include <ctype.h>
+#include <sys/stat.h>
+
+#if defined (_WIN32) && ! defined (__CYGWIN32__)
+#define popen _popen
+#define pclose _pclose
+#endif
+
+/* The default preprocessor. */
+
+#define DEFAULT_PREPROCESSOR "gcc -E -xc-header -DRC_INVOKED"
+
+/* We read the directory entries in a cursor or icon file into
+ instances of this structure. */
+
+struct icondir
+{
+ /* Width of image. */
+ unsigned char width;
+ /* Height of image. */
+ unsigned char height;
+ /* Number of colors in image. */
+ unsigned char colorcount;
+ union
+ {
+ struct
+ {
+ /* Color planes. */
+ unsigned short planes;
+ /* Bits per pixel. */
+ unsigned short bits;
+ } icon;
+ struct
+ {
+ /* X coordinate of hotspot. */
+ unsigned short xhotspot;
+ /* Y coordinate of hotspot. */
+ unsigned short yhotspot;
+ } cursor;
+ } u;
+ /* Bytes in image. */
+ unsigned long bytes;
+ /* File offset of image. */
+ unsigned long offset;
+};
+
+/* The name of the rc file we are reading. */
+
+char *rc_filename;
+
+/* The line number in the rc file. */
+
+int rc_lineno;
+
+/* The pipe we are reading from, so that we can close it if we exit. */
+
+static FILE *cpp_pipe;
+
+/* As we read the rc file, we attach information to this structure. */
+
+static struct res_directory *resources;
+
+/* The number of cursor resources we have written out. */
+
+static int cursors;
+
+/* The number of font resources we have written out. */
+
+static int fonts;
+
+/* Font directory information. */
+
+struct fontdir *fontdirs;
+
+/* Resource info to use for fontdirs. */
+
+struct res_res_info fontdirs_resinfo;
+
+/* The number of icon resources we have written out. */
+
+static int icons;
+
+/* Local functions. */
+
+static void close_pipe PARAMS ((void));
+static void unexpected_eof PARAMS ((const char *));
+static int get_word PARAMS ((FILE *, const char *));
+static unsigned long get_long PARAMS ((FILE *, const char *));
+static void get_data
+ PARAMS ((FILE *, unsigned char *, unsigned long, const char *));
+static void define_fontdirs PARAMS ((void));
+
+/* Read an rc file. */
+
+struct res_directory *
+read_rc_file (filename, preprocessor, preprocargs, language)
+ const char *filename;
+ const char *preprocessor;
+ const char *preprocargs;
+ int language;
+{
+ char *cmd;
+
+ if (preprocessor == NULL)
+ preprocessor = DEFAULT_PREPROCESSOR;
+
+ if (preprocargs == NULL)
+ preprocargs = "";
+ if (filename == NULL)
+ filename = "-";
+
+ cmd = xmalloc (strlen (preprocessor)
+ + strlen (preprocargs)
+ + strlen (filename)
+ + 10);
+ sprintf (cmd, "%s %s %s", preprocessor, preprocargs, filename);
+
+ cpp_pipe = popen (cmd, FOPEN_RT);
+ if (cpp_pipe == NULL)
+ fatal ("can't popen `%s': %s", cmd, strerror (errno));
+ free (cmd);
+
+ xatexit (close_pipe);
+
+ rc_filename = xstrdup (filename);
+ rc_lineno = 1;
+ if (language != -1)
+ rcparse_set_language (language);
+ yyin = cpp_pipe;
+ yyparse ();
+
+ if (pclose (cpp_pipe) != 0)
+ fprintf (stderr, "%s: warning: preprocessor failed\n", program_name);
+ cpp_pipe = NULL;
+
+ if (fontdirs != NULL)
+ define_fontdirs ();
+
+ free (rc_filename);
+ rc_filename = NULL;
+
+ return resources;
+}
+
+/* Close the pipe if it is open. This is called via xatexit. */
+
+void
+close_pipe ()
+{
+ if (cpp_pipe != NULL)
+ pclose (cpp_pipe);
+}
+
+/* Report an error while reading an rc file. */
+
+void
+yyerror (msg)
+ const char *msg;
+{
+ fatal ("%s:%d: %s", rc_filename, rc_lineno, msg);
+}
+
+/* Issue a warning while reading an rc file. */
+
+void
+rcparse_warning (msg)
+ const char *msg;
+{
+ fprintf (stderr, "%s:%d: %s\n", rc_filename, rc_lineno, msg);
+}
+
+/* Die if we get an unexpected end of file. */
+
+static void
+unexpected_eof (msg)
+ const char *msg;
+{
+ fatal ("%s: unexpected EOF", msg);
+}
+
+/* Read a 16 bit word from a file. The data is assumed to be little
+ endian. */
+
+static int
+get_word (e, msg)
+ FILE *e;
+ const char *msg;
+{
+ int b1, b2;
+
+ b1 = getc (e);
+ b2 = getc (e);
+ if (feof (e))
+ unexpected_eof (msg);
+ return ((b2 & 0xff) << 8) | (b1 & 0xff);
+}
+
+/* Read a 32 bit word from a file. The data is assumed to be little
+ endian. */
+
+static unsigned long
+get_long (e, msg)
+ FILE *e;
+ const char *msg;
+{
+ int b1, b2, b3, b4;
+
+ b1 = getc (e);
+ b2 = getc (e);
+ b3 = getc (e);
+ b4 = getc (e);
+ if (feof (e))
+ unexpected_eof (msg);
+ return (((((((b4 & 0xff) << 8)
+ | (b3 & 0xff)) << 8)
+ | (b2 & 0xff)) << 8)
+ | (b1 & 0xff));
+}
+
+/* Read data from a file. This is a wrapper to do error checking. */
+
+static void
+get_data (e, p, c, msg)
+ FILE *e;
+ unsigned char *p;
+ unsigned long c;
+ const char *msg;
+{
+ unsigned long got;
+
+ got = fread (p, 1, c, e);
+ if (got == c)
+ return;
+
+ fatal ("%s: read of %lu returned %lu", msg, c, got);
+}
+
+/* Define an accelerator resource. */
+
+void
+define_accelerator (id, resinfo, data)
+ struct res_id id;
+ const struct res_res_info *resinfo;
+ struct accelerator *data;
+{
+ struct res_resource *r;
+
+ r = define_standard_resource (&resources, RT_ACCELERATORS, id,
+ resinfo->language, 0);
+ r->type = RES_TYPE_ACCELERATOR;
+ r->u.acc = data;
+ r->res_info = *resinfo;
+}
+
+/* Define a bitmap resource. Bitmap data is stored in a file. The
+ first 14 bytes of the file are a standard header, which is not
+ included in the resource data. */
+
+#define BITMAP_SKIP (14)
+
+void
+define_bitmap (id, resinfo, filename)
+ struct res_id id;
+ const struct res_res_info *resinfo;
+ const char *filename;
+{
+ FILE *e;
+ char *real_filename;
+ struct stat s;
+ unsigned char *data;
+ int i;
+ struct res_resource *r;
+
+ e = open_file_search (filename, FOPEN_RB, "bitmap file", &real_filename);
+
+ if (stat (real_filename, &s) < 0)
+ fatal ("stat failed on bitmap file `%s': %s", real_filename,
+ strerror (errno));
+
+ data = (unsigned char *) res_alloc (s.st_size - BITMAP_SKIP);
+
+ for (i = 0; i < BITMAP_SKIP; i++)
+ getc (e);
+
+ get_data (e, data, s.st_size - BITMAP_SKIP, real_filename);
+
+ fclose (e);
+ free (real_filename);
+
+ r = define_standard_resource (&resources, RT_BITMAP, id,
+ resinfo->language, 0);
+
+ r->type = RES_TYPE_BITMAP;
+ r->u.data.length = s.st_size - BITMAP_SKIP;
+ r->u.data.data = data;
+ r->res_info = *resinfo;
+}
+
+/* Define a cursor resource. A cursor file may contain a set of
+ bitmaps, each representing the same cursor at various different
+ resolutions. They each get written out with a different ID. The
+ real cursor resource is then a group resource which can be used to
+ select one of the actual cursors. */
+
+void
+define_cursor (id, resinfo, filename)
+ struct res_id id;
+ const struct res_res_info *resinfo;
+ const char *filename;
+{
+ FILE *e;
+ char *real_filename;
+ int type, count, i;
+ struct icondir *icondirs;
+ int first_cursor;
+ struct res_resource *r;
+ struct group_cursor *first, **pp;
+
+ e = open_file_search (filename, FOPEN_RB, "cursor file", &real_filename);
+
+ /* A cursor file is basically an icon file. The start of the file
+ is a three word structure. The first word is ignored. The
+ second word is the type of data. The third word is the number of
+ entries. */
+
+ get_word (e, real_filename);
+ type = get_word (e, real_filename);
+ count = get_word (e, real_filename);
+ if (type != 2)
+ fatal ("cursor file `%s' does not contain cursor data", real_filename);
+
+ /* Read in the icon directory entries. */
+
+ icondirs = (struct icondir *) xmalloc (count * sizeof *icondirs);
+
+ for (i = 0; i < count; i++)
+ {
+ icondirs[i].width = getc (e);
+ icondirs[i].height = getc (e);
+ icondirs[i].colorcount = getc (e);
+ getc (e);
+ icondirs[i].u.cursor.xhotspot = get_word (e, real_filename);
+ icondirs[i].u.cursor.yhotspot = get_word (e, real_filename);
+ icondirs[i].bytes = get_long (e, real_filename);
+ icondirs[i].offset = get_long (e, real_filename);
+
+ if (feof (e))
+ unexpected_eof (real_filename);
+ }
+
+ /* Define each cursor as a unique resource. */
+
+ first_cursor = cursors;
+
+ for (i = 0; i < count; i++)
+ {
+ unsigned char *data;
+ struct res_id name;
+ struct cursor *c;
+
+ if (fseek (e, icondirs[i].offset, SEEK_SET) != 0)
+ fatal ("%s: fseek to %lu failed: %s", real_filename,
+ icondirs[i].offset, strerror (errno));
+
+ data = (unsigned char *) res_alloc (icondirs[i].bytes);
+
+ get_data (e, data, icondirs[i].bytes, real_filename);
+
+ c = (struct cursor *) res_alloc (sizeof *c);
+ c->xhotspot = icondirs[i].u.cursor.xhotspot;
+ c->yhotspot = icondirs[i].u.cursor.yhotspot;
+ c->length = icondirs[i].bytes;
+ c->data = data;
+
+ ++cursors;
+
+ name.named = 0;
+ name.u.id = cursors;
+
+ r = define_standard_resource (&resources, RT_CURSOR, name,
+ resinfo->language, 0);
+ r->type = RES_TYPE_CURSOR;
+ r->u.cursor = c;
+ r->res_info = *resinfo;
+ }
+
+ fclose (e);
+ free (real_filename);
+
+ /* Define a cursor group resource. */
+
+ first = NULL;
+ pp = &first;
+ for (i = 0; i < count; i++)
+ {
+ struct group_cursor *cg;
+
+ cg = (struct group_cursor *) res_alloc (sizeof *cg);
+ cg->next = NULL;
+ cg->width = icondirs[i].width;
+ cg->height = 2 * icondirs[i].height;
+
+ /* FIXME: What should these be set to? */
+ cg->planes = 1;
+ cg->bits = 1;
+
+ cg->bytes = icondirs[i].bytes + 4;
+ cg->index = first_cursor + i + 1;
+
+ *pp = cg;
+ pp = &(*pp)->next;
+ }
+
+ free (icondirs);
+
+ r = define_standard_resource (&resources, RT_GROUP_CURSOR, id,
+ resinfo->language, 0);
+ r->type = RES_TYPE_GROUP_CURSOR;
+ r->u.group_cursor = first;
+ r->res_info = *resinfo;
+}
+
+/* Define a dialog resource. */
+
+void
+define_dialog (id, resinfo, dialog)
+ struct res_id id;
+ const struct res_res_info *resinfo;
+ const struct dialog *dialog;
+{
+ struct dialog *copy;
+ struct res_resource *r;
+
+ copy = (struct dialog *) res_alloc (sizeof *copy);
+ *copy = *dialog;
+
+ r = define_standard_resource (&resources, RT_DIALOG, id,
+ resinfo->language, 0);
+ r->type = RES_TYPE_DIALOG;
+ r->u.dialog = copy;
+ r->res_info = *resinfo;
+}
+
+/* Define a dialog control. This does not define a resource, but
+ merely allocates and fills in a structure. */
+
+struct dialog_control *
+define_control (text, id, x, y, width, height, class, style, exstyle)
+ const char *text;
+ unsigned long id;
+ unsigned long x;
+ unsigned long y;
+ unsigned long width;
+ unsigned long height;
+ unsigned long class;
+ unsigned long style;
+ unsigned long exstyle;
+{
+ struct dialog_control *n;
+
+ n = (struct dialog_control *) res_alloc (sizeof *n);
+ n->next = NULL;
+ n->id = id;
+ n->style = style;
+ n->exstyle = exstyle;
+ n->x = x;
+ n->y = y;
+ n->width = width;
+ n->height = height;
+ n->class.named = 0;
+ n->class.u.id = class;
+ if (text != NULL)
+ res_string_to_id (&n->text, text);
+ else
+ {
+ n->text.named = 0;
+ n->text.u.id = 0;
+ }
+ n->data = NULL;
+ n->help = 0;
+
+ return n;
+}
+
+/* Define a font resource. */
+
+void
+define_font (id, resinfo, filename)
+ struct res_id id;
+ const struct res_res_info *resinfo;
+ const char *filename;
+{
+ FILE *e;
+ char *real_filename;
+ struct stat s;
+ unsigned char *data;
+ struct res_resource *r;
+ long offset;
+ long fontdatalength;
+ unsigned char *fontdata;
+ struct fontdir *fd;
+ const char *device, *face;
+ struct fontdir **pp;
+
+ e = open_file_search (filename, FOPEN_RB, "font file", &real_filename);
+
+ if (stat (real_filename, &s) < 0)
+ fatal ("stat failed on bitmap file `%s': %s", real_filename,
+ strerror (errno));
+
+ data = (unsigned char *) res_alloc (s.st_size);
+
+ get_data (e, data, s.st_size, real_filename);
+
+ fclose (e);
+ free (real_filename);
+
+ r = define_standard_resource (&resources, RT_FONT, id,
+ resinfo->language, 0);
+
+ r->type = RES_TYPE_FONT;
+ r->u.data.length = s.st_size;
+ r->u.data.data = data;
+ r->res_info = *resinfo;
+
+ /* For each font resource, we must add an entry in the FONTDIR
+ resource. The FONTDIR resource includes some strings in the font
+ file. To find them, we have to do some magic on the data we have
+ read. */
+
+ offset = ((((((data[47] << 8)
+ | data[46]) << 8)
+ | data[45]) << 8)
+ | data[44]);
+ if (offset > 0 && offset < s.st_size)
+ device = (char *) data + offset;
+ else
+ device = "";
+
+ offset = ((((((data[51] << 8)
+ | data[50]) << 8)
+ | data[49]) << 8)
+ | data[48]);
+ if (offset > 0 && offset < s.st_size)
+ face = (char *) data + offset;
+ else
+ face = "";
+
+ ++fonts;
+
+ fontdatalength = 58 + strlen (device) + strlen (face);
+ fontdata = (unsigned char *) res_alloc (fontdatalength);
+ memcpy (fontdata, data, 56);
+ strcpy ((char *) fontdata + 56, device);
+ strcpy ((char *) fontdata + 57 + strlen (device), face);
+
+ fd = (struct fontdir *) res_alloc (sizeof *fd);
+ fd->next = NULL;
+ fd->index = fonts;
+ fd->length = fontdatalength;
+ fd->data = fontdata;
+
+ for (pp = &fontdirs; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = fd;
+
+ /* For the single fontdirs resource, we always use the resource
+ information of the last font. I don't know what else to do. */
+ fontdirs_resinfo = *resinfo;
+}
+
+/* Define the fontdirs resource. This is called after the entire rc
+ file has been parsed, if any font resources were seen. */
+
+static void
+define_fontdirs ()
+{
+ struct res_resource *r;
+ struct res_id id;
+
+ id.named = 0;
+ id.u.id = 1;
+
+ r = define_standard_resource (&resources, RT_FONTDIR, id, 0x409, 0);
+
+ r->type = RES_TYPE_FONTDIR;
+ r->u.fontdir = fontdirs;
+ r->res_info = fontdirs_resinfo;
+}
+
+/* Define an icon resource. An icon file may contain a set of
+ bitmaps, each representing the same icon at various different
+ resolutions. They each get written out with a different ID. The
+ real icon resource is then a group resource which can be used to
+ select one of the actual icon bitmaps. */
+
+void
+define_icon (id, resinfo, filename)
+ struct res_id id;
+ const struct res_res_info *resinfo;
+ const char *filename;
+{
+ FILE *e;
+ char *real_filename;
+ int type, count, i;
+ struct icondir *icondirs;
+ int first_icon;
+ struct res_resource *r;
+ struct group_icon *first, **pp;
+
+ e = open_file_search (filename, FOPEN_RB, "icon file", &real_filename);
+
+ /* The start of an icon file is a three word structure. The first
+ word is ignored. The second word is the type of data. The third
+ word is the number of entries. */
+
+ get_word (e, real_filename);
+ type = get_word (e, real_filename);
+ count = get_word (e, real_filename);
+ if (type != 1)
+ fatal ("icon file `%s' does not contain icon data", real_filename);
+
+ /* Read in the icon directory entries. */
+
+ icondirs = (struct icondir *) xmalloc (count * sizeof *icondirs);
+
+ for (i = 0; i < count; i++)
+ {
+ icondirs[i].width = getc (e);
+ icondirs[i].height = getc (e);
+ icondirs[i].colorcount = getc (e);
+ getc (e);
+ icondirs[i].u.icon.planes = get_word (e, real_filename);
+ icondirs[i].u.icon.bits = get_word (e, real_filename);
+ icondirs[i].bytes = get_long (e, real_filename);
+ icondirs[i].offset = get_long (e, real_filename);
+
+ if (feof (e))
+ unexpected_eof (real_filename);
+ }
+
+ /* Define each icon as a unique resource. */
+
+ first_icon = icons;
+
+ for (i = 0; i < count; i++)
+ {
+ unsigned char *data;
+ struct res_id name;
+
+ if (fseek (e, icondirs[i].offset, SEEK_SET) != 0)
+ fatal ("%s: fseek to %lu failed: %s", real_filename,
+ icondirs[i].offset, strerror (errno));
+
+ data = (unsigned char *) res_alloc (icondirs[i].bytes);
+
+ get_data (e, data, icondirs[i].bytes, real_filename);
+
+ ++icons;
+
+ name.named = 0;
+ name.u.id = icons;
+
+ r = define_standard_resource (&resources, RT_ICON, name,
+ resinfo->language, 0);
+ r->type = RES_TYPE_ICON;
+ r->u.data.length = icondirs[i].bytes;
+ r->u.data.data = data;
+ r->res_info = *resinfo;
+ }
+
+ fclose (e);
+ free (real_filename);
+
+ /* Define an icon group resource. */
+
+ first = NULL;
+ pp = &first;
+ for (i = 0; i < count; i++)
+ {
+ struct group_icon *cg;
+
+ /* For some reason, at least in some files the planes and bits
+ are zero. We instead set them from the color. This is
+ copied from rcl. */
+
+ cg = (struct group_icon *) res_alloc (sizeof *cg);
+ cg->next = NULL;
+ cg->width = icondirs[i].width;
+ cg->height = icondirs[i].height;
+ cg->colors = icondirs[i].colorcount;
+
+ cg->planes = 1;
+ cg->bits = 0;
+ while ((1 << cg->bits) < cg->colors)
+ ++cg->bits;
+
+ cg->bytes = icondirs[i].bytes;
+ cg->index = first_icon + i + 1;
+
+ *pp = cg;
+ pp = &(*pp)->next;
+ }
+
+ free (icondirs);
+
+ r = define_standard_resource (&resources, RT_GROUP_ICON, id,
+ resinfo->language, 0);
+ r->type = RES_TYPE_GROUP_ICON;
+ r->u.group_icon = first;
+ r->res_info = *resinfo;
+}
+
+/* Define a menu resource. */
+
+void
+define_menu (id, resinfo, menuitems)
+ struct res_id id;
+ const struct res_res_info *resinfo;
+ struct menuitem *menuitems;
+{
+ struct menu *m;
+ struct res_resource *r;
+
+ m = (struct menu *) res_alloc (sizeof *m);
+ m->items = menuitems;
+ m->help = 0;
+
+ r = define_standard_resource (&resources, RT_MENU, id, resinfo->language, 0);
+ r->type = RES_TYPE_MENU;
+ r->u.menu = m;
+ r->res_info = *resinfo;
+}
+
+/* Define a menu item. This does not define a resource, but merely
+ allocates and fills in a structure. */
+
+struct menuitem *
+define_menuitem (text, menuid, type, state, help, menuitems)
+ const char *text;
+ int menuid;
+ unsigned long type;
+ unsigned long state;
+ unsigned long help;
+ struct menuitem *menuitems;
+{
+ struct menuitem *mi;
+
+ mi = (struct menuitem *) res_alloc (sizeof *mi);
+ mi->next = NULL;
+ mi->type = type;
+ mi->state = state;
+ mi->id = menuid;
+ if (text == NULL)
+ mi->text = NULL;
+ else
+ unicode_from_ascii ((int *) NULL, &mi->text, text);
+ mi->help = help;
+ mi->popup = menuitems;
+ return mi;
+}
+
+/* Define a messagetable resource. */
+
+void
+define_messagetable (id, resinfo, filename)
+ struct res_id id;
+ const struct res_res_info *resinfo;
+ const char *filename;
+{
+ FILE *e;
+ char *real_filename;
+ struct stat s;
+ unsigned char *data;
+ struct res_resource *r;
+
+ e = open_file_search (filename, FOPEN_RB, "messagetable file",
+ &real_filename);
+
+ if (stat (real_filename, &s) < 0)
+ fatal ("stat failed on bitmap file `%s': %s", real_filename,
+ strerror (errno));
+
+ data = (unsigned char *) res_alloc (s.st_size);
+
+ get_data (e, data, s.st_size, real_filename);
+
+ fclose (e);
+ free (real_filename);
+
+ r = define_standard_resource (&resources, RT_MESSAGETABLE, id,
+ resinfo->language, 0);
+
+ r->type = RES_TYPE_MESSAGETABLE;
+ r->u.data.length = s.st_size;
+ r->u.data.data = data;
+ r->res_info = *resinfo;
+}
+
+/* Define an rcdata resource. */
+
+void
+define_rcdata (id, resinfo, data)
+ struct res_id id;
+ const struct res_res_info *resinfo;
+ struct rcdata_item *data;
+{
+ struct res_resource *r;
+
+ r = define_standard_resource (&resources, RT_RCDATA, id,
+ resinfo->language, 0);
+ r->type = RES_TYPE_RCDATA;
+ r->u.rcdata = data;
+ r->res_info = *resinfo;
+}
+
+/* Create an rcdata item holding a string. */
+
+struct rcdata_item *
+define_rcdata_string (string, len)
+ const char *string;
+ unsigned long len;
+{
+ struct rcdata_item *ri;
+ char *s;
+
+ ri = (struct rcdata_item *) res_alloc (sizeof *ri);
+ ri->next = NULL;
+ ri->type = RCDATA_STRING;
+ ri->u.string.length = len;
+ s = (char *) res_alloc (len);
+ memcpy (s, string, len);
+ ri->u.string.s = s;
+
+ return ri;
+}
+
+/* Create an rcdata item holding a number. */
+
+struct rcdata_item *
+define_rcdata_number (val, dword)
+ unsigned long val;
+ int dword;
+{
+ struct rcdata_item *ri;
+
+ ri = (struct rcdata_item *) res_alloc (sizeof *ri);
+ ri->next = NULL;
+ ri->type = dword ? RCDATA_DWORD : RCDATA_WORD;
+ ri->u.word = val;
+
+ return ri;
+}
+
+/* Define a stringtable resource. This is called for each string
+ which appears in a STRINGTABLE statement. */
+
+void
+define_stringtable (resinfo, stringid, string)
+ const struct res_res_info *resinfo;
+ unsigned long stringid;
+ const char *string;
+{
+ struct res_id id;
+ struct res_resource *r;
+
+ id.named = 0;
+ id.u.id = (stringid >> 4) + 1;
+ r = define_standard_resource (&resources, RT_STRING, id,
+ resinfo->language, 1);
+
+ if (r->type == RES_TYPE_UNINITIALIZED)
+ {
+ int i;
+
+ r->type = RES_TYPE_STRINGTABLE;
+ r->u.stringtable = ((struct stringtable *)
+ res_alloc (sizeof (struct stringtable)));
+ for (i = 0; i < 16; i++)
+ {
+ r->u.stringtable->strings[i].length = 0;
+ r->u.stringtable->strings[i].string = NULL;
+ }
+
+ r->res_info = *resinfo;
+ }
+
+ unicode_from_ascii (&r->u.stringtable->strings[stringid & 0xf].length,
+ &r->u.stringtable->strings[stringid & 0xf].string,
+ string);
+}
+
+/* Define a user data resource where the data is in the rc file. */
+
+void
+define_user_data (id, type, resinfo, data)
+ struct res_id id;
+ struct res_id type;
+ const struct res_res_info *resinfo;
+ struct rcdata_item *data;
+{
+ struct res_id ids[3];
+ struct res_resource *r;
+
+ ids[0] = type;
+ ids[1] = id;
+ ids[2].named = 0;
+ ids[2].u.id = resinfo->language;
+
+ r = define_resource (&resources, 3, ids, 0);
+ r->type = RES_TYPE_USERDATA;
+ r->u.userdata = data;
+ r->res_info = *resinfo;
+}
+
+/* Define a user data resource where the data is in a file. */
+
+void
+define_user_file (id, type, resinfo, filename)
+ struct res_id id;
+ struct res_id type;
+ const struct res_res_info *resinfo;
+ const char *filename;
+{
+ FILE *e;
+ char *real_filename;
+ struct stat s;
+ unsigned char *data;
+ struct res_id ids[3];
+ struct res_resource *r;
+
+ e = open_file_search (filename, FOPEN_RB, "font file", &real_filename);
+
+ if (stat (real_filename, &s) < 0)
+ fatal ("stat failed on bitmap file `%s': %s", real_filename,
+ strerror (errno));
+
+ data = (unsigned char *) res_alloc (s.st_size);
+
+ get_data (e, data, s.st_size, real_filename);
+
+ fclose (e);
+ free (real_filename);
+
+ ids[0] = type;
+ ids[1] = id;
+ ids[2].named = 0;
+ ids[2].u.id = resinfo->language;
+
+ r = define_resource (&resources, 3, ids, 0);
+ r->type = RES_TYPE_USERDATA;
+ r->u.userdata = ((struct rcdata_item *)
+ res_alloc (sizeof (struct rcdata_item)));
+ r->u.userdata->next = NULL;
+ r->u.userdata->type = RCDATA_BUFFER;
+ r->u.userdata->u.buffer.length = s.st_size;
+ r->u.userdata->u.buffer.data = data;
+ r->res_info = *resinfo;
+}
+
+/* Define a versioninfo resource. */
+
+void
+define_versioninfo (id, language, fixedverinfo, verinfo)
+ struct res_id id;
+ int language;
+ struct fixed_versioninfo *fixedverinfo;
+ struct ver_info *verinfo;
+{
+ struct res_resource *r;
+
+ r = define_standard_resource (&resources, RT_VERSION, id, language, 0);
+ r->type = RES_TYPE_VERSIONINFO;
+ r->u.versioninfo = ((struct versioninfo *)
+ res_alloc (sizeof (struct versioninfo)));
+ r->u.versioninfo->fixed = fixedverinfo;
+ r->u.versioninfo->var = verinfo;
+ r->res_info.language = language;
+}
+
+/* Add string version info to a list of version information. */
+
+struct ver_info *
+append_ver_stringfileinfo (verinfo, language, strings)
+ struct ver_info *verinfo;
+ const char *language;
+ struct ver_stringinfo *strings;
+{
+ struct ver_info *vi, **pp;
+
+ vi = (struct ver_info *) res_alloc (sizeof *vi);
+ vi->next = NULL;
+ vi->type = VERINFO_STRING;
+ unicode_from_ascii ((int *) NULL, &vi->u.string.language, language);
+ vi->u.string.strings = strings;
+
+ for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = vi;
+
+ return verinfo;
+}
+
+/* Add variable version info to a list of version information. */
+
+struct ver_info *
+append_ver_varfileinfo (verinfo, key, var)
+ struct ver_info *verinfo;
+ const char *key;
+ struct ver_varinfo *var;
+{
+ struct ver_info *vi, **pp;
+
+ vi = (struct ver_info *) res_alloc (sizeof *vi);
+ vi->next = NULL;
+ vi->type = VERINFO_VAR;
+ unicode_from_ascii ((int *) NULL, &vi->u.var.key, key);
+ vi->u.var.var = var;
+
+ for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = vi;
+
+ return verinfo;
+}
+
+/* Append version string information to a list. */
+
+struct ver_stringinfo *
+append_verval (strings, key, value)
+ struct ver_stringinfo *strings;
+ const char *key;
+ const char *value;
+{
+ struct ver_stringinfo *vs, **pp;
+
+ vs = (struct ver_stringinfo *) res_alloc (sizeof *vs);
+ vs->next = NULL;
+ unicode_from_ascii ((int *) NULL, &vs->key, key);
+ unicode_from_ascii ((int *) NULL, &vs->value, value);
+
+ for (pp = &strings; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = vs;
+
+ return strings;
+}
+
+/* Append version variable information to a list. */
+
+struct ver_varinfo *
+append_vertrans (var, language, charset)
+ struct ver_varinfo *var;
+ unsigned long language;
+ unsigned long charset;
+{
+ struct ver_varinfo *vv, **pp;
+
+ vv = (struct ver_varinfo *) res_alloc (sizeof *vv);
+ vv->next = NULL;
+ vv->language = language;
+ vv->charset = charset;
+
+ for (pp = &var; *pp != NULL; pp = &(*pp)->next)
+ ;
+ *pp = vv;
+
+ return var;
+}
+
+/* Local functions used to write out an rc file. */
+
+static void indent PARAMS ((FILE *, int));
+static void write_rc_directory
+ PARAMS ((FILE *, const struct res_directory *, const struct res_id *,
+ const struct res_id *, int *, int));
+static void write_rc_subdir
+ PARAMS ((FILE *, const struct res_entry *, const struct res_id *,
+ const struct res_id *, int *, int));
+static void write_rc_resource
+ PARAMS ((FILE *, const struct res_id *, const struct res_id *,
+ const struct res_resource *, int *));
+static void write_rc_accelerators
+ PARAMS ((FILE *, const struct accelerator *));
+static void write_rc_cursor PARAMS ((FILE *, const struct cursor *));
+static void write_rc_group_cursor
+ PARAMS ((FILE *, const struct group_cursor *));
+static void write_rc_dialog PARAMS ((FILE *, const struct dialog *));
+static void write_rc_dialog_control
+ PARAMS ((FILE *, const struct dialog_control *));
+static void write_rc_fontdir PARAMS ((FILE *, const struct fontdir *));
+static void write_rc_group_icon PARAMS ((FILE *, const struct group_icon *));
+static void write_rc_menu PARAMS ((FILE *, const struct menu *, int));
+static void write_rc_menuitems
+ PARAMS ((FILE *, const struct menuitem *, int, int));
+static void write_rc_rcdata PARAMS ((FILE *, const struct rcdata_item *, int));
+static void write_rc_stringtable
+ PARAMS ((FILE *, const struct res_id *, const struct stringtable *));
+static void write_rc_versioninfo PARAMS ((FILE *, const struct versioninfo *));
+static void write_rc_filedata
+ PARAMS ((FILE *, unsigned long, const unsigned char *));
+
+/* Indent a given number of spaces. */
+
+static void
+indent (e, c)
+ FILE *e;
+ int c;
+{
+ int i;
+
+ for (i = 0; i < c; i++)
+ putc (' ', e);
+}
+
+/* Dump the resources we have read in the format of an rc file.
+
+ Actually, we don't use the format of an rc file, because it's way
+ too much of a pain--for example, we'd have to write icon resources
+ into a file and refer to that file. We just generate a readable
+ format that kind of looks like an rc file, and is useful for
+ understanding the contents of a resource file. Someday we may want
+ to generate an rc file which the rc compiler can read; if that day
+ comes, this code will have to be fixed up. */
+
+void
+write_rc_file (filename, resources)
+ const char *filename;
+ const struct res_directory *resources;
+{
+ FILE *e;
+ int language;
+
+ if (filename == NULL)
+ e = stdout;
+ else
+ {
+ e = fopen (filename, FOPEN_WT);
+ if (e == NULL)
+ fatal ("can't open `%s' for output: %s", filename, strerror (errno));
+ }
+
+ language = -1;
+ write_rc_directory (e, resources, (const struct res_id *) NULL,
+ (const struct res_id *) NULL, &language, 1);
+}
+
+/* Write out a directory. E is the file to write to. RD is the
+ directory. TYPE is a pointer to the level 1 ID which serves as the
+ resource type. NAME is a pointer to the level 2 ID which serves as
+ an individual resource name. LANGUAGE is a pointer to the current
+ language. LEVEL is the level in the tree. */
+
+static void
+write_rc_directory (e, rd, type, name, language, level)
+ FILE *e;
+ const struct res_directory *rd;
+ const struct res_id *type;
+ const struct res_id *name;
+ int *language;
+ int level;
+{
+ const struct res_entry *re;
+
+ /* Print out some COFF information that rc files can't represent. */
+
+ if (rd->time != 0)
+ fprintf (e, "// Time stamp: %lu\n", rd->time);
+ if (rd->characteristics != 0)
+ fprintf (e, "// Characteristics: %lu\n", rd->characteristics);
+ if (rd->major != 0 || rd->minor != 0)
+ fprintf (e, "// Version: %d %d\n", rd->major, rd->minor);
+
+ for (re = rd->entries; re != NULL; re = re->next)
+ {
+ switch (level)
+ {
+ case 1:
+ /* If we're at level 1, the key of this resource is the
+ type. This normally duplicates the information we have
+ stored with the resource itself, but we need to remember
+ the type if this is a user define resource type. */
+ type = &re->id;
+ break;
+
+ case 2:
+ /* If we're at level 2, the key of this resource is the name
+ we are going to use in the rc printout. */
+ name = &re->id;
+ break;
+
+ case 3:
+ /* If we're at level 3, then this key represents a language.
+ Use it to update the current language. */
+ if (! re->id.named
+ && re->id.u.id != *language
+ && (re->id.u.id & 0xffff) == re->id.u.id)
+ {
+ fprintf (e, "LANGUAGE %lu, %lu\n",
+ re->id.u.id & 0xff, (re->id.u.id >> 8) & 0xff);
+ *language = re->id.u.id;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (re->subdir)
+ write_rc_subdir (e, re, type, name, language, level);
+ else
+ {
+ if (level == 3)
+ {
+ /* This is the normal case: the three levels are
+ TYPE/NAME/LANGUAGE. NAME will have been set at level
+ 2, and represents the name to use. We probably just
+ set LANGUAGE, and it will probably match what the
+ resource itself records if anything. */
+ write_rc_resource (e, type, name, re->u.res, language);
+ }
+ else
+ {
+ fprintf (e, "// Resource at unexpected level %d\n", level);
+ write_rc_resource (e, type, (struct res_id *) NULL, re->u.res,
+ language);
+ }
+ }
+ }
+}
+
+/* Write out a subdirectory entry. E is the file to write to. RE is
+ the subdirectory entry. TYPE and NAME are pointers to higher level
+ IDs, or NULL. LANGUAGE is a pointer to the current language.
+ LEVEL is the level in the tree. */
+
+static void
+write_rc_subdir (e, re, type, name, language, level)
+ FILE *e;
+ const struct res_entry *re;
+ const struct res_id *type;
+ const struct res_id *name;
+ int *language;
+ int level;
+{
+ fprintf (e, "\n");
+ switch (level)
+ {
+ case 1:
+ fprintf (e, "// Type: ");
+ if (re->id.named)
+ res_id_print (e, re->id, 1);
+ else
+ {
+ const char *s;
+
+ switch (re->id.u.id)
+ {
+ case RT_CURSOR: s = "cursor"; break;
+ case RT_BITMAP: s = "bitmap"; break;
+ case RT_ICON: s = "icon"; break;
+ case RT_MENU: s = "menu"; break;
+ case RT_DIALOG: s = "dialog"; break;
+ case RT_STRING: s = "stringtable"; break;
+ case RT_FONTDIR: s = "fontdir"; break;
+ case RT_FONT: s = "font"; break;
+ case RT_ACCELERATORS: s = "accelerators"; break;
+ case RT_RCDATA: s = "rcdata"; break;
+ case RT_MESSAGETABLE: s = "messagetable"; break;
+ case RT_GROUP_CURSOR: s = "group cursor"; break;
+ case RT_GROUP_ICON: s = "group icon"; break;
+ case RT_VERSION: s = "version"; break;
+ case RT_DLGINCLUDE: s = "dlginclude"; break;
+ case RT_PLUGPLAY: s = "plugplay"; break;
+ case RT_VXD: s = "vxd"; break;
+ case RT_ANICURSOR: s = "anicursor"; break;
+ case RT_ANIICON: s = "aniicon"; break;
+ default: s = NULL; break;
+ }
+
+ if (s != NULL)
+ fprintf (e, "%s", s);
+ else
+ res_id_print (e, re->id, 1);
+ }
+ fprintf (e, "\n");
+ break;
+
+ case 2:
+ fprintf (e, "// Name: ");
+ res_id_print (e, re->id, 1);
+ fprintf (e, "\n");
+ break;
+
+ case 3:
+ fprintf (e, "// Language: ");
+ res_id_print (e, re->id, 1);
+ fprintf (e, "\n");
+ break;
+
+ default:
+ fprintf (e, "// Level %d: ", level);
+ res_id_print (e, re->id, 1);
+ fprintf (e, "\n");
+ }
+
+ write_rc_directory (e, re->u.dir, type, name, language, level + 1);
+}
+
+/* Write out a single resource. E is the file to write to. TYPE is a
+ pointer to the type of the resource. NAME is a pointer to the name
+ of the resource; it will be NULL if there is a level mismatch. RES
+ is the resource data. LANGUAGE is a pointer to the current
+ language. */
+
+static void
+write_rc_resource (e, type, name, res, language)
+ FILE *e;
+ const struct res_id *type;
+ const struct res_id *name;
+ const struct res_resource *res;
+ int *language;
+{
+ const char *s;
+ int rt;
+ int menuex = 0;
+
+ fprintf (e, "\n");
+
+ switch (res->type)
+ {
+ default:
+ abort ();
+
+ case RES_TYPE_ACCELERATOR:
+ s = "ACCELERATOR";
+ rt = RT_ACCELERATORS;
+ break;
+
+ case RES_TYPE_BITMAP:
+ s = "BITMAP";
+ rt = RT_BITMAP;
+ break;
+
+ case RES_TYPE_CURSOR:
+ s = "CURSOR";
+ rt = RT_CURSOR;
+ break;
+
+ case RES_TYPE_GROUP_CURSOR:
+ s = "GROUP_CURSOR";
+ rt = RT_GROUP_CURSOR;
+ break;
+
+ case RES_TYPE_DIALOG:
+ if (extended_dialog (res->u.dialog))
+ s = "DIALOGEX";
+ else
+ s = "DIALOG";
+ rt = RT_DIALOG;
+ break;
+
+ case RES_TYPE_FONT:
+ s = "FONT";
+ rt = RT_FONT;
+ break;
+
+ case RES_TYPE_FONTDIR:
+ s = "FONTDIR";
+ rt = RT_FONTDIR;
+ break;
+
+ case RES_TYPE_ICON:
+ s = "ICON";
+ rt = RT_ICON;
+ break;
+
+ case RES_TYPE_GROUP_ICON:
+ s = "GROUP_ICON";
+ rt = RT_GROUP_ICON;
+ break;
+
+ case RES_TYPE_MENU:
+ if (extended_menu (res->u.menu))
+ {
+ s = "MENUEX";
+ menuex = 1;
+ }
+ else
+ {
+ s = "MENU";
+ menuex = 0;
+ }
+ rt = RT_MENU;
+ break;
+
+ case RES_TYPE_MESSAGETABLE:
+ s = "MESSAGETABLE";
+ rt = RT_MESSAGETABLE;
+ break;
+
+ case RES_TYPE_RCDATA:
+ s = "RCDATA";
+ rt = RT_RCDATA;
+ break;
+
+ case RES_TYPE_STRINGTABLE:
+ s = "STRINGTABLE";
+ rt = RT_STRING;
+ break;
+
+ case RES_TYPE_USERDATA:
+ s = NULL;
+ rt = 0;
+ break;
+
+ case RES_TYPE_VERSIONINFO:
+ s = "VERSIONINFO";
+ rt = RT_VERSION;
+ break;
+ }
+
+ if (rt != 0
+ && type != NULL
+ && (type->named || type->u.id != rt))
+ {
+ fprintf (e, "// Unexpected resource type mismatch: ");
+ res_id_print (e, *type, 1);
+ fprintf (e, " != %d", rt);
+ }
+
+ if (res->coff_info.codepage != 0)
+ fprintf (e, "// Code page: %lu\n", res->coff_info.codepage);
+ if (res->coff_info.reserved != 0)
+ fprintf (e, "// COFF reserved value: %lu\n", res->coff_info.reserved);
+
+ if (name != NULL)
+ res_id_print (e, *name, 0);
+ else
+ fprintf (e, "??Unknown-Name??");
+
+ fprintf (e, " ");
+ if (s != NULL)
+ fprintf (e, "%s", s);
+ else if (type != NULL)
+ res_id_print (e, *type, 0);
+ else
+ fprintf (e, "??Unknown-Type??");
+
+ if (res->res_info.memflags != 0)
+ {
+ if ((res->res_info.memflags & MEMFLAG_MOVEABLE) != 0)
+ fprintf (e, " MOVEABLE");
+ if ((res->res_info.memflags & MEMFLAG_PURE) != 0)
+ fprintf (e, " PURE");
+ if ((res->res_info.memflags & MEMFLAG_PRELOAD) != 0)
+ fprintf (e, " PRELOAD");
+ if ((res->res_info.memflags & MEMFLAG_DISCARDABLE) != 0)
+ fprintf (e, " DISCARDABLE");
+ }
+
+ if (res->type == RES_TYPE_DIALOG)
+ {
+ fprintf (e, " %d, %d, %d, %d", res->u.dialog->x, res->u.dialog->y,
+ res->u.dialog->width, res->u.dialog->height);
+ if (res->u.dialog->ex != NULL
+ && res->u.dialog->ex->help != 0)
+ fprintf (e, ", %lu", res->u.dialog->ex->help);
+ }
+
+ fprintf (e, "\n");
+
+ if ((res->res_info.language != 0 && res->res_info.language != *language)
+ || res->res_info.characteristics != 0
+ || res->res_info.version != 0)
+ {
+ int modifiers;
+
+ switch (res->type)
+ {
+ case RES_TYPE_ACCELERATOR:
+ case RES_TYPE_DIALOG:
+ case RES_TYPE_MENU:
+ case RES_TYPE_RCDATA:
+ case RES_TYPE_STRINGTABLE:
+ modifiers = 1;
+ break;
+
+ default:
+ modifiers = 0;
+ break;
+ }
+
+ if (res->res_info.language != 0 && res->res_info.language != *language)
+ fprintf (e, "%sLANGUAGE %d, %d\n",
+ modifiers ? "// " : "",
+ res->res_info.language & 0xff,
+ (res->res_info.language >> 8) & 0xff);
+ if (res->res_info.characteristics != 0)
+ fprintf (e, "%sCHARACTERISTICS %lu\n",
+ modifiers ? "// " : "",
+ res->res_info.characteristics);
+ if (res->res_info.version != 0)
+ fprintf (e, "%sVERSION %lu\n",
+ modifiers ? "// " : "",
+ res->res_info.version);
+ }
+
+ switch (res->type)
+ {
+ default:
+ abort ();
+
+ case RES_TYPE_ACCELERATOR:
+ write_rc_accelerators (e, res->u.acc);
+ break;
+
+ case RES_TYPE_CURSOR:
+ write_rc_cursor (e, res->u.cursor);
+ break;
+
+ case RES_TYPE_GROUP_CURSOR:
+ write_rc_group_cursor (e, res->u.group_cursor);
+ break;
+
+ case RES_TYPE_DIALOG:
+ write_rc_dialog (e, res->u.dialog);
+ break;
+
+ case RES_TYPE_FONTDIR:
+ write_rc_fontdir (e, res->u.fontdir);
+ break;
+
+ case RES_TYPE_GROUP_ICON:
+ write_rc_group_icon (e, res->u.group_icon);
+ break;
+
+ case RES_TYPE_MENU:
+ write_rc_menu (e, res->u.menu, menuex);
+ break;
+
+ case RES_TYPE_RCDATA:
+ write_rc_rcdata (e, res->u.rcdata, 0);
+ break;
+
+ case RES_TYPE_STRINGTABLE:
+ write_rc_stringtable (e, name, res->u.stringtable);
+ break;
+
+ case RES_TYPE_USERDATA:
+ write_rc_rcdata (e, res->u.userdata, 0);
+ break;
+
+ case RES_TYPE_VERSIONINFO:
+ write_rc_versioninfo (e, res->u.versioninfo);
+ break;
+
+ case RES_TYPE_BITMAP:
+ case RES_TYPE_FONT:
+ case RES_TYPE_ICON:
+ case RES_TYPE_MESSAGETABLE:
+ write_rc_filedata (e, res->u.data.length, res->u.data.data);
+ break;
+ }
+}
+
+/* Write out accelerator information. */
+
+static void
+write_rc_accelerators (e, accelerators)
+ FILE *e;
+ const struct accelerator *accelerators;
+{
+ const struct accelerator *acc;
+
+ fprintf (e, "BEGIN\n");
+ for (acc = accelerators; acc != NULL; acc = acc->next)
+ {
+ int printable;
+
+ fprintf (e, " ");
+
+ if ((acc->key & 0x7f) == acc->key
+ && isprint ((unsigned char) acc->key)
+ && (acc->flags & ACC_VIRTKEY) == 0)
+ {
+ fprintf (e, "\"%c\"", acc->key);
+ printable = 1;
+ }
+ else
+ {
+ fprintf (e, "%d", acc->key);
+ printable = 0;
+ }
+
+ fprintf (e, ", %d", acc->id);
+
+ if (! printable)
+ {
+ if ((acc->flags & ACC_VIRTKEY) != 0)
+ fprintf (e, ", VIRTKEY");
+ else
+ fprintf (e, ", ASCII");
+ }
+
+ if ((acc->flags & ACC_SHIFT) != 0)
+ fprintf (e, ", SHIFT");
+ if ((acc->flags & ACC_CONTROL) != 0)
+ fprintf (e, ", CONTROL");
+ if ((acc->flags & ACC_ALT) != 0)
+ fprintf (e, ", ALT");
+
+ fprintf (e, "\n");
+ }
+
+ fprintf (e, "END\n");
+}
+
+/* Write out cursor information. This would normally be in a separate
+ file, which the rc file would include. */
+
+static void
+write_rc_cursor (e, cursor)
+ FILE *e;
+ const struct cursor *cursor;
+{
+ fprintf (e, "// Hotspot: x: %d; y: %d\n", cursor->xhotspot,
+ cursor->yhotspot);
+ write_rc_filedata (e, cursor->length, cursor->data);
+}
+
+/* Write out group cursor data. This would normally be built from the
+ cursor data. */
+
+static void
+write_rc_group_cursor (e, group_cursor)
+ FILE *e;
+ const struct group_cursor *group_cursor;
+{
+ const struct group_cursor *gc;
+
+ for (gc = group_cursor; gc != NULL; gc = gc->next)
+ {
+ fprintf (e, "// width: %d; height %d; planes %d; bits %d\n",
+ gc->width, gc->height, gc->planes, gc->bits);
+ fprintf (e, "// data bytes: %lu; index: %d\n",
+ gc->bytes, gc->index);
+ }
+}
+
+/* Write dialog data. */
+
+static void
+write_rc_dialog (e, dialog)
+ FILE *e;
+ const struct dialog *dialog;
+{
+ const struct dialog_control *control;
+
+ if (dialog->style != 0)
+ fprintf (e, "STYLE 0x%lx\n", dialog->style);
+ if (dialog->exstyle != 0)
+ fprintf (e, "EXSTYLE 0x%lx\n", dialog->exstyle);
+ if ((dialog->class.named && dialog->class.u.n.length > 0)
+ || dialog->class.u.id != 0)
+ {
+ fprintf (e, "CLASS ");
+ res_id_print (e, dialog->class, 0);
+ fprintf (e, "\n");
+ }
+ if (dialog->caption != NULL)
+ {
+ fprintf (e, "CAPTION \"");
+ unicode_print (e, dialog->caption, -1);
+ fprintf (e, "\"\n");
+ }
+ if ((dialog->menu.named && dialog->menu.u.n.length > 0)
+ || dialog->menu.u.id != 0)
+ {
+ fprintf (e, "MENU ");
+ res_id_print (e, dialog->menu, 0);
+ fprintf (e, "\n");
+ }
+ if (dialog->font != NULL)
+ {
+ fprintf (e, "FONT %d, \"", dialog->pointsize);
+ unicode_print (e, dialog->font, -1);
+ fprintf (e, "\"");
+ if (dialog->ex != NULL
+ && (dialog->ex->weight != 0 || dialog->ex->italic != 0))
+ fprintf (e, ", %d, %d", dialog->ex->weight, dialog->ex->italic);
+ fprintf (e, "\n");
+ }
+
+ fprintf (e, "BEGIN\n");
+
+ for (control = dialog->controls; control != NULL; control = control->next)
+ write_rc_dialog_control (e, control);
+
+ fprintf (e, "END\n");
+}
+
+/* For each predefined control keyword, this table provides the class
+ and the style. */
+
+struct control_info
+{
+ const char *name;
+ unsigned short class;
+ unsigned long style;
+};
+
+static const struct control_info control_info[] =
+{
+ { "AUTO3STATE", CTL_BUTTON, BS_AUTO3STATE },
+ { "AUTOCHECKBOX", CTL_BUTTON, BS_AUTOCHECKBOX },
+ { "AUTORADIOBUTTON", CTL_BUTTON, BS_AUTORADIOBUTTON },
+ { "CHECKBOX", CTL_BUTTON, BS_CHECKBOX },
+ { "COMBOBOX", CTL_COMBOBOX, (unsigned long) -1 },
+ { "CTEXT", CTL_STATIC, SS_CENTER },
+ { "DEFPUSHBUTTON", CTL_BUTTON, BS_DEFPUSHBUTTON },
+ { "EDITTEXT", CTL_EDIT, (unsigned long) -1 },
+ { "GROUPBOX", CTL_BUTTON, BS_GROUPBOX },
+ { "ICON", CTL_STATIC, SS_ICON },
+ { "LISTBOX", CTL_LISTBOX, (unsigned long) -1 },
+ { "LTEXT", CTL_STATIC, SS_LEFT },
+ { "PUSHBOX", CTL_BUTTON, BS_PUSHBOX },
+ { "PUSHBUTTON", CTL_BUTTON, BS_PUSHBUTTON },
+ { "RADIOBUTTON", CTL_BUTTON, BS_RADIOBUTTON },
+ { "RTEXT", CTL_STATIC, SS_RIGHT },
+ { "SCROLLBAR", CTL_SCROLLBAR, (unsigned long) -1 },
+ { "STATE3", CTL_BUTTON, BS_3STATE },
+ /* It's important that USERBUTTON come after all the other button
+ types, so that it won't be matched too early. */
+ { "USERBUTTON", CTL_BUTTON, (unsigned long) -1 },
+ { NULL, 0, 0 }
+};
+
+/* Write a dialog control. */
+
+static void
+write_rc_dialog_control (e, control)
+ FILE *e;
+ const struct dialog_control *control;
+{
+ const struct control_info *ci;
+
+ fprintf (e, " ");
+
+ if (control->class.named)
+ ci = NULL;
+ else
+ {
+ for (ci = control_info; ci->name != NULL; ++ci)
+ if (ci->class == control->class.u.id
+ && (ci->style == (unsigned long) -1
+ || ci->style == (control->style & 0xff)))
+ break;
+ }
+
+ if (ci->name != NULL)
+ fprintf (e, "%s", ci->name);
+ else
+ fprintf (e, "CONTROL");
+
+ if (control->text.named || control->text.u.id != 0)
+ {
+ fprintf (e, " ");
+ res_id_print (e, control->text, 1);
+ fprintf (e, ",");
+ }
+
+ fprintf (e, " %d, ", control->id);
+
+ if (ci->name == NULL)
+ {
+ res_id_print (e, control->class, 0);
+ fprintf (e, ", 0x%lx, ", control->style);
+ }
+
+ fprintf (e, "%d, %d", control->x, control->y);
+
+ if (control->style != SS_ICON
+ || control->exstyle != 0
+ || control->width != 0
+ || control->height != 0
+ || control->help != 0)
+ {
+ fprintf (e, ", %d, %d", control->width, control->height);
+
+ /* FIXME: We don't need to print the style if it is the default.
+ More importantly, in certain cases we actually need to turn
+ off parts of the forced style, by using NOT. */
+ fprintf (e, ", 0x%lx", control->style);
+
+ if (control->exstyle != 0 || control->help != 0)
+ fprintf (e, ", 0x%lx, %lu", control->exstyle, control->help);
+ }
+
+ fprintf (e, "\n");
+
+ if (control->data != NULL)
+ write_rc_rcdata (e, control->data, 2);
+}
+
+/* Write out font directory data. This would normally be built from
+ the font data. */
+
+static void
+write_rc_fontdir (e, fontdir)
+ FILE *e;
+ const struct fontdir *fontdir;
+{
+ const struct fontdir *fc;
+
+ for (fc = fontdir; fc != NULL; fc = fc->next)
+ {
+ fprintf (e, "// Font index: %d\n", fc->index);
+ write_rc_filedata (e, fc->length, fc->data);
+ }
+}
+
+/* Write out group icon data. This would normally be built from the
+ icon data. */
+
+static void
+write_rc_group_icon (e, group_icon)
+ FILE *e;
+ const struct group_icon *group_icon;
+{
+ const struct group_icon *gi;
+
+ for (gi = group_icon; gi != NULL; gi = gi->next)
+ {
+ fprintf (e, "// width: %d; height %d; colors: %d; planes %d; bits %d\n",
+ gi->width, gi->height, gi->colors, gi->planes, gi->bits);
+ fprintf (e, "// data bytes: %lu; index: %d\n",
+ gi->bytes, gi->index);
+ }
+}
+
+/* Write out a menu resource. */
+
+static void
+write_rc_menu (e, menu, menuex)
+ FILE *e;
+ const struct menu *menu;
+ int menuex;
+{
+ if (menu->help != 0)
+ fprintf (e, "// Help ID: %lu\n", menu->help);
+ write_rc_menuitems (e, menu->items, menuex, 0);
+}
+
+/* Write out menuitems. */
+
+static void
+write_rc_menuitems (e, menuitems, menuex, ind)
+ FILE *e;
+ const struct menuitem *menuitems;
+ int menuex;
+ int ind;
+{
+ const struct menuitem *mi;
+
+ indent (e, ind);
+ fprintf (e, "BEGIN\n");
+
+ for (mi = menuitems; mi != NULL; mi = mi->next)
+ {
+ indent (e, ind + 2);
+
+ if (mi->popup == NULL)
+ fprintf (e, "MENUITEM");
+ else
+ fprintf (e, "POPUP");
+
+ if (! menuex
+ && mi->popup == NULL
+ && mi->text == NULL
+ && mi->type == 0
+ && mi->id == 0)
+ {
+ fprintf (e, " SEPARATOR\n");
+ continue;
+ }
+
+ if (mi->text == NULL)
+ fprintf (e, " \"\"");
+ else
+ {
+ fprintf (e, " \"");
+ unicode_print (e, mi->text, -1);
+ fprintf (e, "\"");
+ }
+
+ if (! menuex)
+ {
+ if (mi->popup == NULL)
+ fprintf (e, ", %d", mi->id);
+
+ if ((mi->type & MENUITEM_CHECKED) != 0)
+ fprintf (e, ", CHECKED");
+ if ((mi->type & MENUITEM_GRAYED) != 0)
+ fprintf (e, ", GRAYED");
+ if ((mi->type & MENUITEM_HELP) != 0)
+ fprintf (e, ", HELP");
+ if ((mi->type & MENUITEM_INACTIVE) != 0)
+ fprintf (e, ", INACTIVE");
+ if ((mi->type & MENUITEM_MENUBARBREAK) != 0)
+ fprintf (e, ", MENUBARBREAK");
+ if ((mi->type & MENUITEM_MENUBREAK) != 0)
+ fprintf (e, ", MENUBREAK");
+ }
+ else
+ {
+ if (mi->id != 0 || mi->type != 0 || mi->state != 0 || mi->help != 0)
+ {
+ fprintf (e, ", %d", mi->id);
+ if (mi->type != 0 || mi->state != 0 || mi->help != 0)
+ {
+ fprintf (e, ", %lu", mi->type);
+ if (mi->state != 0 || mi->help != 0)
+ {
+ fprintf (e, ", %lu", mi->state);
+ if (mi->help != 0)
+ fprintf (e, ", %lu", mi->help);
+ }
+ }
+ }
+ }
+
+ fprintf (e, "\n");
+
+ if (mi->popup != NULL)
+ write_rc_menuitems (e, mi->popup, menuex, ind + 2);
+ }
+
+ indent (e, ind);
+ fprintf (e, "END\n");
+}
+
+/* Write out an rcdata resource. This is also used for other types of
+ resources that need to print arbitrary data. */
+
+static void
+write_rc_rcdata (e, rcdata, ind)
+ FILE *e;
+ const struct rcdata_item *rcdata;
+ int ind;
+{
+ const struct rcdata_item *ri;
+
+ indent (e, ind);
+ fprintf (e, "BEGIN\n");
+
+ for (ri = rcdata; ri != NULL; ri = ri->next)
+ {
+ if (ri->type == RCDATA_BUFFER && ri->u.buffer.length == 0)
+ continue;
+
+ indent (e, ind + 2);
+
+ switch (ri->type)
+ {
+ default:
+ abort ();
+
+ case RCDATA_WORD:
+ fprintf (e, "%d", ri->u.word);
+ break;
+
+ case RCDATA_DWORD:
+ fprintf (e, "%luL", ri->u.dword);
+ break;
+
+ case RCDATA_STRING:
+ {
+ const char *s;
+ unsigned long i;
+
+ fprintf (e, "\"");
+ s = ri->u.string.s;
+ for (i = 0; i < ri->u.string.length; i++)
+ {
+ if (isprint (*s))
+ putc (*s, e);
+ else
+ fprintf (e, "\\%03o", *s);
+ }
+ fprintf (e, "\"");
+ break;
+ }
+
+ case RCDATA_WSTRING:
+ fprintf (e, "L\"");
+ unicode_print (e, ri->u.wstring.w, ri->u.wstring.length);
+ fprintf (e, "\"");
+ break;
+
+ case RCDATA_BUFFER:
+ {
+ unsigned long i;
+ int first;
+
+ /* Assume little endian data. */
+
+ first = 1;
+ for (i = 0; i + 3 < ri->u.buffer.length; i += 4)
+ {
+ unsigned long l;
+
+ l = ((((((ri->u.buffer.data[i + 3] << 8)
+ | ri->u.buffer.data[i + 2]) << 8)
+ | ri->u.buffer.data[i + 1]) << 8)
+ | ri->u.buffer.data[i]);
+ if (first)
+ first = 0;
+ else
+ {
+ fprintf (e, ",\n");
+ indent (e, ind + 2);
+ }
+ fprintf (e, "%luL", l);
+ }
+
+ if (i + 1 < ri->u.buffer.length)
+ {
+ int i;
+
+ i = (ri->u.buffer.data[i + 1] << 8) | ri->u.buffer.data[i];
+ if (first)
+ first = 0;
+ else
+ {
+ fprintf (e, ",\n");
+ indent (e, ind + 2);
+ }
+ fprintf (e, "%d", i);
+ i += 2;
+ }
+
+ if (i < ri->u.buffer.length)
+ {
+ if (first)
+ first = 0;
+ else
+ {
+ fprintf (e, ",\n");
+ indent (e, ind + 2);
+ }
+ if ((ri->u.buffer.data[i] & 0x7f) == ri->u.buffer.data[i]
+ && isprint (ri->u.buffer.data[i]))
+ fprintf (e, "\"%c\"", ri->u.buffer.data[i]);
+ else
+ fprintf (e, "\"\%03o\"", ri->u.buffer.data[i]);
+ }
+
+ break;
+ }
+ }
+
+ if (ri->next != NULL)
+ fprintf (e, ",");
+ fprintf (e, "\n");
+ }
+
+ indent (e, ind);
+ fprintf (e, "END\n");
+}
+
+/* Write out a stringtable resource. */
+
+static void
+write_rc_stringtable (e, name, stringtable)
+ FILE *e;
+ const struct res_id *name;
+ const struct stringtable *stringtable;
+{
+ unsigned long offset;
+ int i;
+
+ if (name != NULL && ! name->named)
+ offset = (name->u.id - 1) << 4;
+ else
+ {
+ fprintf (e, "// %s string table name\n",
+ name == NULL ? "Missing" : "Invalid");
+ offset = 0;
+ }
+
+ fprintf (e, "BEGIN\n");
+
+ for (i = 0; i < 16; i++)
+ {
+ if (stringtable->strings[i].length != 0)
+ {
+ fprintf (e, " %lu, \"", offset + i);
+ unicode_print (e, stringtable->strings[i].string,
+ stringtable->strings[i].length);
+ fprintf (e, "\"\n");
+ }
+ }
+
+ fprintf (e, "END\n");
+}
+
+/* Write out a versioninfo resource. */
+
+static void
+write_rc_versioninfo (e, versioninfo)
+ FILE *e;
+ const struct versioninfo *versioninfo;
+{
+ const struct fixed_versioninfo *f;
+ const struct ver_info *vi;
+
+ f = versioninfo->fixed;
+ if (f->file_version_ms != 0 || f->file_version_ls != 0)
+ fprintf (e, " FILEVERSION %lu, %lu, %lu, %lu\n",
+ (f->file_version_ms >> 16) & 0xffff,
+ f->file_version_ms & 0xffff,
+ (f->file_version_ls >> 16) & 0xffff,
+ f->file_version_ls & 0xffff);
+ if (f->product_version_ms != 0 || f->product_version_ls != 0)
+ fprintf (e, " PRODUCTVERSION %lu, %lu, %lu, %lu\n",
+ (f->product_version_ms >> 16) & 0xffff,
+ f->product_version_ms & 0xffff,
+ (f->product_version_ls >> 16) & 0xffff,
+ f->product_version_ls & 0xffff);
+ if (f->file_flags_mask != 0)
+ fprintf (e, " FILEFLAGSMASK 0x%lx\n", f->file_flags_mask);
+ if (f->file_flags != 0)
+ fprintf (e, " FILEFLAGS 0x%lx\n", f->file_flags);
+ if (f->file_os != 0)
+ fprintf (e, " FILEOS 0x%lx\n", f->file_os);
+ if (f->file_type != 0)
+ fprintf (e, " FILETYPE 0x%lx\n", f->file_type);
+ if (f->file_subtype != 0)
+ fprintf (e, " FILESUBTYPE 0x%lx\n", f->file_subtype);
+ if (f->file_date_ms != 0 || f->file_date_ls != 0)
+ fprintf (e, "// Date: %lu, %lu\n", f->file_date_ms, f->file_date_ls);
+
+ fprintf (e, "BEGIN\n");
+
+ for (vi = versioninfo->var; vi != NULL; vi = vi->next)
+ {
+ switch (vi->type)
+ {
+ case VERINFO_STRING:
+ {
+ const struct ver_stringinfo *vs;
+
+ fprintf (e, " BLOCK \"StringFileInfo\"\n");
+ fprintf (e, " BEGIN\n");
+ fprintf (e, " BLOCK \"");
+ unicode_print (e, vi->u.string.language, -1);
+ fprintf (e, "\"\n");
+ fprintf (e, " BEGIN\n");
+
+ for (vs = vi->u.string.strings; vs != NULL; vs = vs->next)
+ {
+ fprintf (e, " VALUE \"");
+ unicode_print (e, vs->key, -1);
+ fprintf (e, "\", \"");
+ unicode_print (e, vs->value, -1);
+ fprintf (e, "\"\n");
+ }
+
+ fprintf (e, " END\n");
+ fprintf (e, " END\n");
+ break;
+ }
+
+ case VERINFO_VAR:
+ {
+ const struct ver_varinfo *vv;
+
+ fprintf (e, " BLOCK \"VarFileInfo\"\n");
+ fprintf (e, " BEGIN\n");
+ fprintf (e, " VALUE \"");
+ unicode_print (e, vi->u.var.key, -1);
+ fprintf (e, "\"");
+
+ for (vv = vi->u.var.var; vv != NULL; vv = vv->next)
+ fprintf (e, ", 0x%x, %d", (unsigned int) vv->language,
+ vv->charset);
+
+ fprintf (e, "\n END\n");
+
+ break;
+ }
+ }
+ }
+
+ fprintf (e, "END\n");
+}
+
+/* Write out data which would normally be read from a file. */
+
+static void
+write_rc_filedata (e, length, data)
+ FILE *e;
+ unsigned long length;
+ const unsigned char *data;
+{
+ unsigned long i;
+
+ for (i = 0; i + 15 < length; i += 16)
+ {
+ fprintf (e, "// %4lx: ", i);
+ fprintf (e, "%02x %02x %02x %02x %02x %02x %02x %02x ",
+ data[i + 0], data[i + 1], data[i + 2], data[i + 3],
+ data[i + 4], data[i + 5], data[i + 6], data[i + 7]);
+ fprintf (e, "%02x %02x %02x %02x %02x %02x %02x %02x\n",
+ data[i + 8], data[i + 9], data[i + 10], data[i + 11],
+ data[i + 12], data[i + 13], data[i + 14], data[i + 15]);
+ }
+
+ if (i < length)
+ {
+ fprintf (e, "// %4lx:", i);
+ while (i < length)
+ {
+ fprintf (e, " %02x", data[i]);
+ ++i;
+ }
+ fprintf (e, "\n");
+ }
+}
diff --git a/contrib/binutils/binutils/size.c b/contrib/binutils/binutils/size.c
index b928a81..60d67ee 100644
--- a/contrib/binutils/binutils/size.c
+++ b/contrib/binutils/binutils/size.c
@@ -1,5 +1,5 @@
/* size.c -- report size of various sections of an executable file.
- Copyright 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -50,8 +50,7 @@ int show_help = 0;
/* Program exit status. */
int return_code = 0;
-/* IMPORTS */
-extern char *target;
+static char *target = NULL;
/* Static declarations */
@@ -59,9 +58,13 @@ static void usage PARAMS ((FILE *, int));
static void display_file PARAMS ((char *filename));
static void display_bfd PARAMS ((bfd *));
static void display_archive PARAMS ((bfd *));
+static int size_number PARAMS ((bfd_size_type));
+#if 0
static void lprint_number PARAMS ((int, bfd_size_type));
+#endif
static void rprint_number PARAMS ((int, bfd_size_type));
static void print_berkeley_format PARAMS ((bfd *));
+static void sysv_internal_sizer PARAMS ((bfd *, asection *, PTR));
static void sysv_internal_printer PARAMS ((bfd *, asection *, PTR));
static void print_sysv_format PARAMS ((bfd *));
static void print_sizes PARAMS ((bfd * file));
@@ -82,7 +85,7 @@ Usage: %s [-ABdoxV] [--format=berkeley|sysv] [--radix=8|10|16]\n\
#endif
list_supported_targets (program_name, stream);
if (status == 0)
- fprintf (stream, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
exit (status);
}
@@ -303,24 +306,51 @@ display_file (filename)
/* This is what lexical functions are for. */
+static int
+size_number (num)
+ bfd_size_type num;
+{
+ char buffer[40];
+ sprintf (buffer,
+ (radix == decimal ? "%lu" :
+ ((radix == octal) ? "0%lo" : "0x%lx")),
+ (unsigned long) num);
+
+ return strlen (buffer);
+}
+
+#if 0
+
+/* This is not used. */
+
static void
lprint_number (width, num)
int width;
bfd_size_type num;
{
- printf ((radix == decimal ? "%-*lu\t" :
- ((radix == octal) ? "%-*lo\t" : "%-*lx\t")),
- width, (unsigned long) num);
+ char buffer[40];
+ sprintf (buffer,
+ (radix == decimal ? "%lu" :
+ ((radix == octal) ? "0%lo" : "0x%lx")),
+ (unsigned long) num);
+
+ printf ("%-*s", width, buffer);
}
+#endif
+
static void
rprint_number (width, num)
int width;
bfd_size_type num;
{
- printf ((radix == decimal ? "%*lu\t" :
- ((radix == octal) ? "%*lo\t" : "%*lx\t")),
- width, (unsigned long) num);
+ char buffer[40];
+ sprintf (buffer,
+ (radix == decimal ? "%lu" :
+ ((radix == octal) ? "0%lo" : "0x%lx")),
+ (unsigned long) num);
+
+ printf ("%*s", width, buffer);
}
static bfd_size_type bsssize;
@@ -365,19 +395,21 @@ print_berkeley_format (abfd)
if (files_seen++ == 0)
#if 0
/* Intel doesn't like bss/stk because they don't have core files. */
- puts ((radix == octal) ? "text\tdata\tbss/stk\toct\thex\tfilename" :
- "text\tdata\tbss/stk\tdec\thex\tfilename");
+ puts ((radix == octal) ? " text\t data\tbss/stk\t oct\t hex\tfilename" :
+ " text\t data\tbss/stk\t dec\t hex\tfilename");
#else
- puts ((radix == octal) ? "text\tdata\tbss\toct\thex\tfilename" :
- "text\tdata\tbss\tdec\thex\tfilename");
+ puts ((radix == octal) ? " text\t data\t bss\t oct\t hex\tfilename" :
+ " text\t data\t bss\t dec\t hex\tfilename");
#endif
total = textsize + datasize + bsssize;
- lprint_number (7, textsize);
- lprint_number (7, datasize);
- lprint_number (7, bsssize);
- printf (((radix == octal) ? "%-7lo\t%-7lx\t" : "%-7lu\t%-7lx\t"),
+ rprint_number (7, textsize);
+ putchar ('\t');
+ rprint_number (7, datasize);
+ putchar ('\t');
+ rprint_number (7, bsssize);
+ printf (((radix == octal) ? "\t%7lo\t%7lx\t" : "\t%7lu\t%7lx\t"),
(unsigned long) total, (unsigned long) total);
fputs (bfd_get_filename (abfd), stdout);
@@ -387,6 +419,31 @@ print_berkeley_format (abfd)
/* I REALLY miss lexical functions! */
bfd_size_type svi_total = 0;
+bfd_vma svi_maxvma = 0;
+int svi_namelen = 0;
+int svi_vmalen = 0;
+int svi_sizelen = 0;
+
+static void
+sysv_internal_sizer (file, sec, ignore)
+ bfd *file;
+ sec_ptr sec;
+ PTR ignore;
+{
+ bfd_size_type size = bfd_section_size (file, sec);
+ if (!bfd_is_abs_section (sec)
+ && !bfd_is_com_section (sec)
+ && !bfd_is_und_section (sec))
+ {
+ int namelen = strlen (bfd_section_name (file, sec));
+ if (namelen > svi_namelen)
+ svi_namelen = namelen;
+
+ svi_total += size;
+ if (bfd_section_vma (file, sec) > svi_maxvma)
+ svi_maxvma = bfd_section_vma (file, sec);
+ }
+}
static void
sysv_internal_printer (file, sec, ignore)
@@ -401,10 +458,10 @@ sysv_internal_printer (file, sec, ignore)
{
svi_total += size;
- printf ("%-12s", bfd_section_name (file, sec));
- rprint_number (8, size);
- printf (" ");
- rprint_number (8, bfd_section_vma (file, sec));
+ printf ("%-*s ", svi_namelen, bfd_section_name (file, sec));
+ rprint_number (svi_sizelen, size);
+ printf (" ");
+ rprint_number (svi_vmalen, bfd_section_vma (file, sec));
printf ("\n");
}
}
@@ -413,17 +470,30 @@ static void
print_sysv_format (file)
bfd *file;
{
+ /* size all of the columns */
svi_total = 0;
+ svi_maxvma = 0;
+ svi_namelen = 0;
+ bfd_map_over_sections (file, sysv_internal_sizer, (PTR) NULL);
+ svi_vmalen = size_number ((bfd_size_type)svi_maxvma);
+ if ((size_t) svi_vmalen < sizeof ("addr") - 1)
+ svi_vmalen = sizeof ("addr")-1;
+
+ svi_sizelen = size_number (svi_total);
+ if ((size_t) svi_sizelen < sizeof ("size") - 1)
+ svi_sizelen = sizeof ("size")-1;
+ svi_total = 0;
printf ("%s ", bfd_get_filename (file));
if (bfd_my_archive (file))
printf (" (ex %s)", bfd_get_filename (bfd_my_archive (file)));
- puts (":\nsection\t\tsize\t addr");
+ printf (":\n%-*s %*s %*s\n", svi_namelen, "section",
+ svi_sizelen, "size", svi_vmalen, "addr");
bfd_map_over_sections (file, sysv_internal_printer, (PTR) NULL);
- printf ("Total ");
- rprint_number (8, svi_total);
+ printf ("%-*s ", svi_namelen, "Total");
+ rprint_number (svi_sizelen, svi_total);
printf ("\n\n");
}
diff --git a/contrib/binutils/binutils/srconv.c b/contrib/binutils/binutils/srconv.c
index f378eda..930005f 100644
--- a/contrib/binutils/binutils/srconv.c
+++ b/contrib/binutils/binutils/srconv.c
@@ -1,5 +1,5 @@
/* srconv.c -- Sysroff conversion program
- Copyright (C) 1994 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95, 96, 1998 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -15,7 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
/* Written by Steve Chamberlain (sac@cygnus.com)
@@ -37,8 +38,10 @@
#define PROGRAM_VERSION "1.5"
/*#define FOOP1 1 */
-static int sh;
-static int h8300;
+static int addrsize;
+static char *toolname;
+static char **rnames;
+
static void wr_cs ();
static void walk_tree_scope ();
static void wr_globals ();
@@ -171,12 +174,7 @@ writeINT (n, ptr, idx, size, file)
int byte = *idx / 8;
if (size == -2)
- {
- if (sh)
- size = 4;
- else if (h8300)
- size = 2;
- }
+ size = addrsize;
else if (size == -1)
size = 0;
@@ -319,7 +317,7 @@ wr_un (ptr, sfile, first, nsecs)
un.spare1 = 0;
- if (abfd->flags & EXEC_P)
+ if (bfd_get_file_flags (abfd) & EXEC_P)
un.format = FORMAT_LM;
else
un.format = FORMAT_OM;
@@ -349,10 +347,7 @@ wr_un (ptr, sfile, first, nsecs)
un.nextrefs++;
}
}
- if (sh)
- un.tool = "C_SH";
- else if (h8300)
- un.tool = "C_H8/300H";
+ un.tool = toolname;
un.tcd = DATE;
un.linker = "L_GX00";
un.lcd = DATE;
@@ -368,7 +363,7 @@ wr_hd (p)
struct IT_hd hd;
hd.spare1 = 0;
- if (abfd->flags & EXEC_P)
+ if (bfd_get_file_flags (abfd) & EXEC_P)
{
hd.mt = MTYPE_ABS_LM;
}
@@ -381,17 +376,38 @@ wr_hd (p)
hd.nu = p->nsources; /* Always one unit */
hd.code = 0; /* Always ASCII */
hd.ver = "0200"; /* Version 2.00 */
- switch (abfd->arch_info->arch)
+ switch (bfd_get_arch (abfd))
{
case bfd_arch_h8300:
hd.au = 8;
hd.si = 0;
- hd.afl = 2;
hd.spcsz = 32;
hd.segsz = 0;
hd.segsh = 0;
- hd.cpu = "H8300H";
- h8300 = 1;
+ switch (bfd_get_mach (abfd))
+ {
+ case bfd_mach_h8300:
+ hd.cpu = "H8300";
+ hd.afl = 2;
+ addrsize = 2;
+ toolname = "C_H8/300";
+ break;
+ case bfd_mach_h8300h:
+ hd.cpu = "H8300H";
+ hd.afl = 4;
+ addrsize = 4;
+ toolname = "C_H8/300H";
+ break;
+ case bfd_mach_h8300s:
+ hd.cpu = "H8300S";
+ hd.afl = 4;
+ addrsize = 4;
+ toolname = "C_H8/300S";
+ break;
+ default:
+ abort();
+ }
+ rnames = rname_h8300;
break;
case bfd_arch_sh:
hd.au = 8;
@@ -401,13 +417,15 @@ wr_hd (p)
hd.segsz = 0;
hd.segsh = 0;
hd.cpu = "SH";
- sh = 1;
+ addrsize = 4;
+ toolname = "C_SH";
+ rnames = rname_sh;
break;
default:
abort ();
}
- if (!abfd->flags & EXEC_P)
+ if (! bfd_get_file_flags(abfd) & EXEC_P)
{
hd.ep = 0;
}
@@ -422,8 +440,7 @@ wr_hd (p)
hd.os = "";
hd.sys = "";
- hd.mn = strip_suffix (abfd->filename);
-
+ hd.mn = strip_suffix (bfd_get_filename (abfd));
sysroff_swap_hd_out (file, &hd);
}
@@ -449,7 +466,7 @@ wr_ob (p, section)
struct coff_ofile *p;
struct coff_section *section;
{
- int i;
+ bfd_size_type i;
int first = 1;
unsigned char stuff[200];
@@ -465,7 +482,7 @@ wr_ob (p, section)
if (first)
{
ob.saf = 1;
- if (abfd->flags & EXEC_P)
+ if (bfd_get_file_flags (abfd) & EXEC_P)
ob.address = section->address;
else
ob.address = 0;
@@ -485,12 +502,12 @@ wr_ob (p, section)
i += todo;
}
/* Now fill the rest with blanks */
- while (i < section->size)
+ while (i < (bfd_size_type) section->size)
{
struct IT_ob ob;
int todo = 200; /* Copy in 200 byte lumps */
ob.spare = 0;
- if (i + todo > section->size)
+ if (i + todo > (bfd_size_type) section->size)
todo = section->size - i;
ob.saf = 0;
@@ -959,7 +976,7 @@ walk_tree_symbol (sfile, section, symbol, nest)
{
struct IT_dsy dsy;
- dsy.spare2 = 0;
+ memset(&dsy, 0, sizeof(dsy));
dsy.nesting = nest;
switch (symbol->type->type)
@@ -1116,12 +1133,7 @@ walk_tree_symbol (sfile, section, symbol, nest)
}
if (symbol->where->where == coff_where_register)
- {
- if (sh)
- dsy.reg = rname_sh[symbol->where->offset];
- else if (h8300)
- dsy.reg = rname_h8300[symbol->where->offset];
- }
+ dsy.reg = rnames[symbol->where->offset];
switch (symbol->visible->type)
{
@@ -1230,7 +1242,7 @@ wr_du (p, sfile, n)
int j;
unsigned int *lowest = (unsigned *) nints (p->nsections);
unsigned int *highest = (unsigned *) nints (p->nsections);
- du.format = abfd->flags & EXEC_P ? 0 : 1;
+ du.format = bfd_get_file_flags (abfd) & EXEC_P ? 0 : 1;
du.optimized = 0;
du.stackfrmt = 0;
du.spare = 0;
@@ -1276,7 +1288,7 @@ wr_du (p, sfile, n)
}
du.san[used] = i;
du.length[used] = highest[i] - lowest[i];
- du.address[used] = abfd->flags & EXEC_P ? lowest[i] : 0;
+ du.address[used] = bfd_get_file_flags (abfd) & EXEC_P ? lowest[i] : 0;
if (debug)
{
printf (" section %6s 0x%08x..0x%08x\n",
@@ -1665,14 +1677,14 @@ int scount = 0;
{
/* Don't have a symbol set aside for this section, which means that nothing
in this file does anything for the section. */
- sc.format = !(abfd->flags & EXEC_P);
+ sc.format = !(bfd_get_file_flags (abfd) & EXEC_P);
sc.addr = 0;
sc.length = 0;
name = info[i].sec->name;
}
else
{
- if (abfd->flags & EXEC_P)
+ if (bfd_get_file_flags (abfd) & EXEC_P)
{
sc.format = 0;
sc.addr = symbol->where->offset;
diff --git a/contrib/binutils/binutils/stabs.c b/contrib/binutils/binutils/stabs.c
index db2df7a..ce85bfe 100644
--- a/contrib/binutils/binutils/stabs.c
+++ b/contrib/binutils/binutils/stabs.c
@@ -1,5 +1,5 @@
/* stabs.c -- Parse stabs debugging information
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
@@ -2944,7 +2944,7 @@ parse_stab_argtypes (dhandle, info, class_type, fieldname, tagname,
*pphysname = physname;
}
- if (*argtypes == '\0')
+ if (*argtypes == '\0' || is_destructor)
{
args = (debug_type *) xmalloc (sizeof *args);
*args = NULL;
diff --git a/contrib/binutils/binutils/stamp-h.in b/contrib/binutils/binutils/stamp-h.in
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/contrib/binutils/binutils/stamp-h.in
@@ -0,0 +1 @@
+timestamp
diff --git a/contrib/binutils/binutils/strings.c b/contrib/binutils/binutils/strings.c
index a5780df..d6a011b 100644
--- a/contrib/binutils/binutils/strings.c
+++ b/contrib/binutils/binutils/strings.c
@@ -1,5 +1,5 @@
/* strings -- print the strings of printable characters in files
- Copyright (C) 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -503,6 +503,6 @@ Usage: %s [-afov] [-n min-len] [-min-len] [-t {o,x,d}] [-]\n\
program_name);
list_supported_targets (program_name, stream);
if (status == 0)
- fprintf (stream, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
exit (status);
}
diff --git a/contrib/binutils/binutils/sysdump.c b/contrib/binutils/binutils/sysdump.c
index 5f158e9..870857c 100644
--- a/contrib/binutils/binutils/sysdump.c
+++ b/contrib/binutils/binutils/sysdump.c
@@ -1,21 +1,22 @@
/* Sysroff object format dumper.
- Copyright (C) 1994 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95, 1998 Free Software Foundation, Inc.
-This file is part of GNU Binutils.
+ This file is part of GNU Binutils.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is 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.
+ 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. */
+ 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. */
/* Written by Steve Chamberlain <sac@cygnus.com>.
@@ -33,11 +34,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysroff.h"
#define PROGRAM_VERSION "1.0"
-static int h8300;
-static int sh;
+
static int dump = 1;
static int segmented_p;
static int code;
+static int addrsize = 4;
static FILE *file;
static char *
@@ -171,7 +172,7 @@ getINT (ptr, idx, size, max)
return 0;
}
if (size == -2)
- size = 4;
+ size = addrsize;
if (size == -1)
size = 0;
switch (size)
@@ -195,14 +196,17 @@ getINT (ptr, idx, size, max)
}
int
-getBITS (ptr, idx, size)
+getBITS (ptr, idx, size, max)
char *ptr;
int *idx;
- int size;
+ int size, max;
{
int byte = *idx / 8;
int bit = *idx % 8;
+ if (byte >= max)
+ return 0;
+
*idx += size;
return (ptr[byte] >> (8 - bit - size)) & ((1 << size) - 1);
@@ -308,6 +312,7 @@ getone (type)
{
struct IT_hd dummy;
sysroff_swap_hd_in (&dummy);
+ addrsize = dummy.afl;
sysroff_print_hd_out (&dummy);
}
break;
@@ -487,6 +492,10 @@ opt (x)
return getone (x);
}
+#if 0
+
+/* This is no longer used. */
+
static void
unit_info_list ()
{
@@ -505,6 +514,12 @@ unit_info_list ()
}
}
+#endif
+
+#if 0
+
+/* This is no longer used. */
+
static void
object_body_list ()
{
@@ -517,6 +532,8 @@ object_body_list ()
}
}
+#endif
+
static void
must (x)
int x;
@@ -612,6 +629,10 @@ derived_type ()
tab (-1, "");
}
+#if 0
+
+/* This is no longer used. */
+
static void
program_structure ()
{
@@ -626,6 +647,12 @@ program_structure ()
tab (-1, "");
}
+#endif
+
+#if 0
+
+/* This is no longer used. */
+
static void
debug_list ()
{
@@ -639,6 +666,8 @@ debug_list ()
tab (-1, "");
}
+#endif
+
static void
module ()
{
diff --git a/contrib/binutils/binutils/sysinfo.y b/contrib/binutils/binutils/sysinfo.y
index 0e0141a..0aa8737 100644
--- a/contrib/binutils/binutils/sysinfo.y
+++ b/contrib/binutils/binutils/sysinfo.y
@@ -406,8 +406,10 @@ if (writecode == 'd')
return 0;
}
-int yyerror(s)
+int
+yyerror(s)
char *s;
{
fprintf(stderr, "%s\n" , s);
+ return 0;
}
diff --git a/contrib/binutils/binutils/wrstabs.c b/contrib/binutils/binutils/wrstabs.c
index b771ab5..9c1f91d 100644
--- a/contrib/binutils/binutils/wrstabs.c
+++ b/contrib/binutils/binutils/wrstabs.c
@@ -1,5 +1,5 @@
/* wrstabs.c -- Output stabs debugging information
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
@@ -552,8 +552,8 @@ write_stabs_in_sections_debugging_info (abfd, dhandle, psyms, psymsize,
*p++ = '\0';
for (h = info.strings; h != NULL; h = h->next)
{
- strcpy (p, h->root.string);
- p += strlen (p) + 1;
+ strcpy ((char *) p, h->root.string);
+ p += strlen ((char *) p) + 1;
}
return true;
@@ -915,14 +915,14 @@ stab_modify_type (info, mod, size, cache, cache_alloc)
}
else
{
- if (targindex >= *cache_alloc)
+ if ((size_t) targindex >= *cache_alloc)
{
size_t alloc;
alloc = *cache_alloc;
if (alloc == 0)
alloc = 10;
- while (targindex >= alloc)
+ while ((size_t) targindex >= alloc)
alloc *= 2;
*cache = (long *) xrealloc (*cache, alloc * sizeof (long));
memset (*cache + *cache_alloc, 0,
@@ -1884,7 +1884,7 @@ stab_end_class_type (p)
{
struct stab_write_handle *info = (struct stab_write_handle *) p;
size_t len;
- unsigned int i;
+ unsigned int i = 0;
char *buf;
assert (info->type_stack != NULL && info->type_stack->fields != NULL);
@@ -2173,7 +2173,7 @@ stab_variable (p, name, kind, val)
kindstr = "";
/* Make sure that this is a type reference or definition. */
- if (! isdigit (*s))
+ if (! isdigit ((unsigned char) *s))
{
char *n;
long index;
diff --git a/contrib/binutils/config-ml.in b/contrib/binutils/config-ml.in
index be0ced8..527e781 100644
--- a/contrib/binutils/config-ml.in
+++ b/contrib/binutils/config-ml.in
@@ -201,6 +201,19 @@ for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
done
case "${target}" in
+arc-*-elf*)
+ if [ x$enable_biendian != xyes ]
+ then
+ old_multidirs=${multidirs}
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "${x}" in
+ *be*) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ ;;
m68*-*-*)
if [ x$enable_softfloat = xno ]
then
@@ -295,17 +308,6 @@ powerpc*-*-* | rs6000*-*-*)
esac
done
fi
- if [ x$enable_commoncpu = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *common* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
if [ x$enable_powercpu = xno ]
then
old_multidirs="${multidirs}"
@@ -317,17 +319,6 @@ powerpc*-*-* | rs6000*-*-*)
esac
done
fi
- if [ x$enable_power2cpu = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *power2* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
if [ x$enable_powerpccpu = xno ]
then
old_multidirs="${multidirs}"
@@ -339,13 +330,13 @@ powerpc*-*-* | rs6000*-*-*)
esac
done
fi
- if [ x$enable_601cpu = xno ]
+ if [ x$enable_powerpcos = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *601* ) : ;;
+ *mcall-linux* | *mcall-solaris* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
@@ -356,18 +347,7 @@ powerpc*-*-* | rs6000*-*-*)
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *endian* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_relocatable = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *relocatable* ) : ;;
+ *mlittle* | *mbig* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
@@ -378,7 +358,7 @@ powerpc*-*-* | rs6000*-*-*)
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *sysv* ) : ;;
+ *mcall-sysv* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
@@ -389,7 +369,7 @@ powerpc*-*-* | rs6000*-*-*)
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
- *aix* ) : ;;
+ *mcall-aix* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
@@ -428,6 +408,7 @@ multi-do:
CXXFLAGS="$(CXXFLAGS) $${flags}" \
LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
+ LDFLAGS="$(LDFLAGS) $${flags}" \
$(DO)); then \
true; \
else \
diff --git a/contrib/binutils/config.guess b/contrib/binutils/config.guess
index b6f37c9..583439e 100755
--- a/contrib/binutils/config.guess
+++ b/contrib/binutils/config.guess
@@ -1,6 +1,6 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1992, 93-97, 1998 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -52,11 +52,53 @@ trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
+ cat <<EOF >dummy.s
+ .globl main
+ .ent main
+main:
+ .frame \$30,0,\$26,0
+ .prologue 0
+ .long 0x47e03d80 # implver $0
+ lda \$2,259
+ .long 0x47e20c21 # amask $2,$1
+ srl \$1,8,\$2
+ sll \$2,2,\$2
+ sll \$0,3,\$0
+ addl \$1,\$0,\$0
+ addl \$2,\$0,\$0
+ ret \$31,(\$26),1
+ .end main
+EOF
+ ${CC-cc} dummy.s -o dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./dummy
+ case "$?" in
+ 7)
+ UNAME_MACHINE="alpha"
+ ;;
+ 15)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 14)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 10)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 16)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ esac
+ fi
+ rm -f dummy.s dummy
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
@@ -91,6 +133,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
+ arm32:NetBSD:*:*)
+ echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
@@ -129,6 +174,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
@@ -168,6 +225,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
+ 2020:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >dummy.c
int main (argc, argv) int argc; char **argv; {
@@ -298,8 +358,13 @@ EOF
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
- 9000/8?? ) HP_ARCH=hppa1.0 ;;
+ 9000/6?? ) HP_ARCH=hppa1.0 ;;
+ 9000/78? ) HP_ARCH=hppa1.1 ;; # FIXME: really hppa2.0
+ 9000/7?? ) HP_ARCH=hppa1.1 ;;
+ 9000/8[67]1 | 9000/80[24] | 9000/8[78]9 | 9000/893 )
+ HP_ARCH=hppa1.1 ;; # FIXME: really hppa2.0
+ 9000/8?[13679] ) HP_ARCH=hppa1.1 ;;
+ 9000/8?? ) HP_ARCH=hppa1.0 ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@@ -418,7 +483,10 @@ EOF
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
- echo i386-pc-cygwin32
+ echo ${UNAME_MACHINE}-pc-cygwin32
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
@@ -427,33 +495,115 @@ EOF
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
- echo `echo ${UNAME_MACHINE}|sed -e 's,-.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
+ # uname on the ARM produces all sorts of strangeness, and we need to
+ # filter it out.
+ case "$UNAME_MACHINE" in
+ arm* | sa110*) UNAME_MACHINE="arm" ;;
+ esac
+
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
- if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
- echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
- echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
- echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
- echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
- echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
- echo "powerpc-unknown-linux-gnu" ; exit 0
- elif test "${UNAME_MACHINE}" = "alpha" ; then
- echo alpha-unknown-linux-gnu ; exit 0
- elif test "${UNAME_MACHINE}" = "sparc" ; then
- echo sparc-unknown-linux-gnu ; exit 0
+ ld_supported_emulations=`echo $ld_help_string \
+ | sed -ne '/supported emulations:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported emulations: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_emulations" in
+ i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
+ i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
+ sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ elf32ppc)
+ # Determine Lib Version
+ cat >dummy.c <<EOF
+#include <features.h>
+#if defined(__GLIBC__)
+extern char __libc_version[];
+extern char __libc_release[];
+#endif
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#if defined(__GLIBC__)
+ printf("%s %s\n", __libc_version, __libc_release);
+#else
+ printf("unkown\n");
+#endif
+ return 0;
+}
+EOF
+ LIBC=""
+ ${CC-cc} dummy.c -o dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./dummy | grep 1\.99 > /dev/null
+ if test "$?" = 0 ; then
+ LIBC="libc1"
+ fi
+ fi
+ rm -f dummy.c dummy
+ echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
+ esac
+
+ if test "${UNAME_MACHINE}" = "alpha" ; then
+ sed 's/^ //' <<EOF >dummy.s
+ .globl main
+ .ent main
+ main:
+ .frame \$30,0,\$26,0
+ .prologue 0
+ .long 0x47e03d80 # implver $0
+ lda \$2,259
+ .long 0x47e20c21 # amask $2,$1
+ srl \$1,8,\$2
+ sll \$2,2,\$2
+ sll \$0,3,\$0
+ addl \$1,\$0,\$0
+ addl \$2,\$0,\$0
+ ret \$31,(\$26),1
+ .end main
+EOF
+ LIBC=""
+ ${CC-cc} dummy.s -o dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./dummy
+ case "$?" in
+ 7)
+ UNAME_MACHINE="alpha"
+ ;;
+ 15)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 14)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 10)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 16)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ esac
+
+ objdump --private-headers dummy | \
+ grep ld.so.1 > /dev/null
+ if test "$?" = 0 ; then
+ LIBC="libc1"
+ fi
+ fi
+ rm -f dummy.s dummy
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >dummy.c <<EOF
main(argc, argv)
-int argc;
-char *argv[];
+ int argc;
+ char *argv[];
{
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
@@ -467,20 +617,41 @@ EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
else
- # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
- # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
- test ! -d /usr/lib/ldscripts/. \
- && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+ # Either a pre-BFD a.out linker (linux-gnuoldld)
+ # or one that does not give us useful --help.
+ # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
+ # If ld does not provide *any* "supported emulations:"
+ # that means it is gnuoldld.
+ echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
+ test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+
+ case "${UNAME_MACHINE}" in
+ i?86)
+ VENDOR=pc;
+ ;;
+ *)
+ VENDOR=unknown;
+ ;;
+ esac
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
+#include <features.h>
main(argc, argv)
-int argc;
-char *argv[];
+ int argc;
+ char *argv[];
{
#ifdef __ELF__
- printf ("%s-pc-linux-gnu\n", argv[1]);
+# ifdef __GLIBC__
+# if __GLIBC__ >= 2
+ printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+# else
+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+# endif
+# else
+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+# endif
#else
- printf ("%s-pc-linux-gnuaout\n", argv[1]);
+ printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
@@ -493,6 +664,14 @@ EOF
i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
+ i?86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
@@ -500,6 +679,13 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
+ i?86:*:5:7)
+ UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
+ exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -514,6 +700,11 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
+ pc:*:*:*)
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit 0 ;;
@@ -589,6 +780,9 @@ EOF
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
+ news*:NEWS-OS:*:6*)
+ echo mips-sony-newsos6
+ exit 0 ;;
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
@@ -596,6 +790,12 @@ EOF
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
diff --git a/contrib/binutils/config.sub b/contrib/binutils/config.sub
index 2832962..5d135ab 100755
--- a/contrib/binutils/config.sub
+++ b/contrib/binutils/config.sub
@@ -1,6 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+# Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -64,6 +64,18 @@ case $1 in
;;
esac
+# CYGNUS LOCAL marketing-names
+# Here we handle any "marketing" names - translating them to
+# standard triplets
+case $1 in
+ mips-tx39-elf)
+ set mipstx39-unknown-elf
+ ;;
+ *)
+ ;;
+esac
+# END CYGNUS LOCAL marketing-names
+
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
@@ -108,9 +120,6 @@ case $os in
os=vxworks
basic_machine=$1
;;
- -hiuxmpp)
- os=-hiuxmpp
- ;;
-hiux*)
os=-hiuxwe2
;;
@@ -162,18 +171,23 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arm \
- | arme[lb] | pyramid | mn10300 \
+ tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+ | arme[lb] | pyramid | mn10200 | mn10300 \
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
- | alpha | we32k | ns16k | clipper | i370 | sh \
- | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
- | pdp11 | mips64el | mips64orion | mips64orionel \
- | sparc | sparclet | sparclite | sparc64)
+ | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \
+ | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
+ | 1750a | dsp16xx | pdp11 \
+ | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
+ | mipstx39 | mipstx39el \
+ | sparc | sparclet | sparclite | sparc64 | v850)
basic_machine=$basic_machine-unknown
;;
m88110 | m680[01234]0 | m683?2 | m68360 | z8k | v70 | h8500 | w65) # CYGNUS LOCAL
basic_machine=$basic_machine-unknown
;;
+ thumb)
+ basic_machine=$basic_machine-unknown
+ ;;
mips64vr4300 | mips64vr4300el) # CYGNUS LOCAL jsmith/vr4300
basic_machine=$basic_machine-unknown
;;
@@ -186,15 +200,13 @@ case $basic_machine in
mips16) # CYGNUS LOCAL krk/mips16
basic_machine=$basic_machine-unknown
;;
-# CYGNUS LOCAL law
- mn10200)
+ tic30) # CYGNUS LOCAL ian/tic30
basic_machine=$basic_machine-unknown
;;
-# END CYGNUS LOCAL
- d10v) # CYGNUS LOCAL meissner/d10v
- basic_machine=$basic_machine-unknown
+ c30) # CYGNUS LOCAL ian/tic30
+ basic_machine=tic30-unknown
;;
- mn10200) # CYGNUS LOCAL
+ d10v) # CYGNUS LOCAL meissner/d10v
basic_machine=$basic_machine-unknown
;;
# We use `pc' rather than `unknown'
@@ -210,22 +222,36 @@ case $basic_machine in
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
- | m88k-* | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
- | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
- | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
- | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
- | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
+ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
+ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
+ | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+ | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
+ | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \
+ | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
+ | xps100-* | clipper-* | orion-* \
+ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+ | sparc64-* | mips64-* | mipsel-* \
+ | mips64el-* | mips64orion-* | mips64orionel-* \
+ | mipstx39-* | mipstx39el-* \
+ | f301-*)
;;
m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # CYGNUS LOCAL
;;
+ thumb-*) # CYGNUS LOCAL angela/thumb
+ ;;
+ v850-*) # CYGNUS LOCAL
+ ;;
mips64vr4300-* | mips64vr4300el-*) # CYGNUS LOCAL jsmith/vr4300
;;
mips64vr4100-* | mips64vr4100el-*) # CYGNUS LOCAL jsmith/vr4100
;;
mips16-*) # CYGNUS LOCAL krk/mips16
;;
+ tic30-*) # CYGNUS LOCAL ian/tic30
+ ;;
+ c30-*) # CYGNUS LOCAL ian/tic30
+ basic_machine=tic30-unknown
+ ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd) # CYGNUS LOCAL
@@ -369,10 +395,6 @@ case $basic_machine in
basic_machine=tron-gmicro
os=-sysv
;;
- hiuxmpp)
- basic_machine=hppa1.1-hitachi
- os=-hiuxmpp
- ;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@@ -426,7 +448,22 @@ case $basic_machine in
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
- hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+ hp9k6[0-9][0-9] | hp6[0-9][0-9] )
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9] )
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9] )
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
+ hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679] )
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -472,6 +509,10 @@ case $basic_machine in
basic_machine=i386-unknown
os=-go32
;;
+ i386-mingw32 | mingw32)
+ basic_machine=i386-unknown
+ os=-mingw32
+ ;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -502,11 +543,11 @@ case $basic_machine in
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
- os=-linux
+ os=-linux-gnu
;;
mips*-linux*)
basic_machine=mips-unknown
- os=-linux
+ os=-linux-gnu
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
@@ -724,6 +765,12 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
tower | tower-32)
basic_machine=m68k-ncr
;;
@@ -747,7 +794,7 @@ case $basic_machine in
basic_machine=vax-dec
os=-vms
;;
- vpp*|vx|vx-*)
+ vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
@@ -794,7 +841,7 @@ case $basic_machine in
basic_machine=hppa1.1-oki
;;
mips)
- if [ x$os = x-linux ]; then
+ if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
@@ -886,7 +933,7 @@ case $os in
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -linux-gnu* | -uxpv*)
+ | -mingw32* | -linux-gnu* | -uxpv*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
# CYGNUS LOCAL
diff --git a/contrib/binutils/config/ChangeLog b/contrib/binutils/config/ChangeLog
index e2164a1..6d8a429 100644
--- a/contrib/binutils/config/ChangeLog
+++ b/contrib/binutils/config/ChangeLog
@@ -1,3 +1,20 @@
+Thu Mar 26 01:54:25 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * mh-cygwin32: stop configuring and building dosrel.
+
+Thu Sep 11 16:43:27 1997 Jim Wilson <wilson@cygnus.com>
+
+ * mh-elfalphapic, mt-elfalphapic: New files.
+
+Wed Jul 23 12:32:18 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * mh-go32 (CFLAGS): Don't set -fno-omit-frame-pointer.
+
+Mon Jun 16 19:06:41 1997 Geoff Keating <geoffk@ozemail.com.au>
+
+ * mh-ppcpic: New file.
+ * mt-ppcpic: New file.
+
Thu Mar 27 15:52:40 1997 Geoffrey Noer <noer@cygnus.com>
* mh-cygwin32: override CXXFLAGS, setting to -O2 only
diff --git a/contrib/binutils/config/mh-elfalphapic b/contrib/binutils/config/mh-elfalphapic
new file mode 100644
index 0000000..35cf2c8
--- /dev/null
+++ b/contrib/binutils/config/mh-elfalphapic
@@ -0,0 +1 @@
+PICFLAG=-fPIC
diff --git a/contrib/binutils/config/mh-mingw32 b/contrib/binutils/config/mh-mingw32
new file mode 100644
index 0000000..8c4839d
--- /dev/null
+++ b/contrib/binutils/config/mh-mingw32
@@ -0,0 +1,12 @@
+# We don't want debugging info in Win32-hosted toolchains.
+# Accomplish this by overriding CFLAGS.
+CFLAGS=-O2
+CXXFLAGS=-O2
+
+# We also need to override LIBGCC2_DEBUG_CFLAGS so libgcc2 will be
+# built without debugging information
+
+LIBGCC2_DEBUG_CFLAGS=
+
+# custom installation rules for mingw32 (append .exe to binaries, etc.)
+# INSTALL_DOSREL=install-dosrel
diff --git a/contrib/binutils/config/mt-elfalphapic b/contrib/binutils/config/mt-elfalphapic
new file mode 100644
index 0000000..35b8c9e
--- /dev/null
+++ b/contrib/binutils/config/mt-elfalphapic
@@ -0,0 +1 @@
+PICFLAG_FOR_TARGET=-fPIC
diff --git a/contrib/binutils/config/mt-linux b/contrib/binutils/config/mt-linux
new file mode 100644
index 0000000..bbd9792
--- /dev/null
+++ b/contrib/binutils/config/mt-linux
@@ -0,0 +1,2 @@
+# When using glibc 2 on Linux we must always use vtable thunks.
+ CXXFLAGS=-O2 -g -fvtable-thunks
diff --git a/contrib/binutils/configure b/contrib/binutils/configure
index 8f118c2..b2aa5b2 100755
--- a/contrib/binutils/configure
+++ b/contrib/binutils/configure
@@ -51,6 +51,7 @@ build_alias=
cache_file=config.cache
cache_file_option=
configdirs=
+diroptions=
exec_prefix=
exec_prefixoption=
fatal=
@@ -62,6 +63,7 @@ moveifchange=
norecursion=
other_options=
package_makefile_frag=
+package_makefile_rules_frag=
prefix=/usr/local
progname=
program_prefix=
@@ -70,7 +72,7 @@ program_suffix=
program_suffixoption=
program_transform_name=
program_transform_nameoption=
-redirect=">/dev/null"
+redirect=
removing=
site=
site_makefile_frag=
@@ -81,11 +83,54 @@ subdirs=
target_alias=NOTARGET
target_makefile_frag=
undefs=NOUNDEFS
-version="$Revision: 1.230.2.1 $"
+version="$Revision: 1.260.2.1 $"
x11=default
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
### we might need to use some other shell than /bin/sh for running subshells
-#
+
+### If we are on Windows, search for the shell. This will permit people
+### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
+### without also having to set CONFIG_SHELL. This code will work when
+### using bash, which sets OSTYPE.
+case "${OSTYPE}" in
+*win32*)
+ if [ x${CONFIG_SHELL} = x ]; then
+ if [ ! -f /bin/sh ]; then
+ if [ x${SHELL} != x ] && [ -f ${SHELL} ]; then
+ CONFIG_SHELL=${SHELL}
+ export CONFIG_SHELL
+ else
+ for prog in sh sh.exe bash bash.exe; do
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ if test -f $dir/$prog; then
+ CONFIG_SHELL=$dir/$prog
+ export CONFIG_SHELL
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ test -n "${CONFIG_SHELL}" && break
+ done
+ fi
+ fi
+ fi
+ ;;
+esac
+
config_shell=${CONFIG_SHELL-/bin/sh}
NO_EDIT="This file was generated automatically by configure. Do not edit."
@@ -158,6 +203,10 @@ do
# Now, process the options
case $option in
+ --bi*)
+ bindir=$optarg
+ diroptions="$diroptions --bindir=$optarg"
+ ;;
--build* | --bu*)
case "$build_alias" in
"") build_alias=$optarg ;;
@@ -169,6 +218,10 @@ do
--cache*)
cache_file=$optarg
;;
+ --da*)
+ datadir=$optarg
+ diroptions="$diroptions --datadir=$optarg"
+ ;;
--disable-*)
enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
eval $enableopt=no
@@ -202,6 +255,30 @@ do
;;
esac
;;
+ --inc*)
+ includedir=$optarg
+ diroptions="$diroptions --includedir=$optarg"
+ ;;
+ --inf*)
+ infodir=$optarg
+ diroptions="$diroptions --infodir=$optarg"
+ ;;
+ --libd*)
+ libdir=$optarg
+ diroptions="$diroptions --libdir=$optarg"
+ ;;
+ --libe*)
+ libexecdir=$optarg
+ diroptions="$diroptions --libexecdir=$optarg"
+ ;;
+ --lo*)
+ localstatedir=$optarg
+ diroptions="$diroptions --localstatedir=$optarg"
+ ;;
+ --ma*)
+ mandir=$optarg
+ diroptions="$diroptions --mandir=$optarg"
+ ;;
--nfp | --nf*)
floating_point=no
floating_pointoption="--nfp"
@@ -209,6 +286,10 @@ do
--norecursion | --no*)
norecursion=yes
;;
+ --ol*)
+ oldincludedir=$optarg
+ diroptions="$diroptions --oldincludedir=$optarg"
+ ;;
--prefix* | --pre*)
prefix=$optarg
prefixoption="--prefix=$optarg"
@@ -229,6 +310,14 @@ do
--rm)
removing=--rm
;;
+ --sb*)
+ sbindir=$optarg
+ diroptions="$diroptions --sbindir=$optarg"
+ ;;
+ --sh*)
+ sharedstatedir=$optarg
+ diroptions="$diroptions --sharedstatedir=$optarg"
+ ;;
--silent | --sil* | --quiet | --q*)
redirect=">/dev/null"
verbose=--silent
@@ -247,6 +336,10 @@ do
--srcdir* | --sr*)
srcdir=$optarg
;;
+ --sy*)
+ sysconfdir=$optarg
+ diroptions="$diroptions --sysconfdir=$optarg"
+ ;;
--target* | --ta*)
case $target_alias in
NOTARGET) target_alias=$optarg ;;
@@ -287,9 +380,6 @@ do
;;
--x-i* | --x-l*) other_options="$other_options $orig_option"
;;
- --bi* | --sb* | --li* | --da* | --sy* | --sh* | --lo* | --in* | --ol* | --ma*)
- # These options were added to autoconf for emacs.
- ;;
--*)
echo "configure: Unrecognized option: \"$orig_option\"; use --help for usage." >&2
exit 1
@@ -481,6 +571,7 @@ case "${srcdir}" in
fi
esac
+
# default exec_prefix
case "${exec_prefixoption}" in
"") exec_prefix="\$(prefix)" ;;
@@ -509,7 +600,7 @@ case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
eval exec ${config_shell} ${srcdir}/configure ${verbose} \
${buildopt} --host=${host_alias} --target=${target_alias} \
${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
- ${srcdiroption} \
+ ${srcdiroption} ${diroptions} \
${program_prefixoption} ${program_suffixoption} \
${program_transform_nameoption} ${site_option} \
${withoptions} ${withoutoptions} \
@@ -681,6 +772,16 @@ t loop
rm -f Makefile.cc
fi
+if [ -z "${CFLAGS}" -a -r Makefile ]; then
+ sed -n -e ':loop
+/\\$/ N
+s/\\\n//g
+t loop
+/^CFLAGS[ ]*=/ s/CFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
+ CFLAGS=`tail -1 Makefile.cc`
+ rm -f Makefile.cc
+fi
+
if [ -z "${CXX}" -a -r Makefile ]; then
sed -n -e ':loop
/\\$/ N
@@ -691,6 +792,16 @@ t loop
rm -f Makefile.cc
fi
+if [ -z "${CXXFLAGS}" -a -r Makefile ]; then
+ sed -n -e ':loop
+/\\$/ N
+s/\\\n//g
+t loop
+/^CXXFLAGS[ ]*=/ s/CXXFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
+ CXXFLAGS=`tail -1 Makefile.cc`
+ rm -f Makefile.cc
+fi
+
# Generate a default definition for YACC. This is used if the makefile can't
# locate bison or byacc in objdir.
@@ -738,6 +849,7 @@ if [ "${build}" != "${host}" ]; then
tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET GCC_FOR_TARGET HOST_PREFIX"
tools="${tools} HOST_PREFIX_1 LD LD_FOR_TARGET LEX MAKEINFO NM"
tools="${tools} NM_FOR_TARGET RANLIB RANLIB_FOR_TARGET"
+ tools="${tools} WINDRES WINDRES_FOR_TARGET YACC"
for var in ${tools}; do
if [ -z "`eval 'echo $'"${var}"`" -a -r Makefile ]; then
@@ -759,11 +871,14 @@ t loop
AR_FOR_TARGET=${AR_FOR_TARGET-${target_alias}-ar}
AS=${AS-${host_alias}-as}
AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as}
+ BISON=${BISON-bison}
CC=${CC-${host_alias}-gcc}
- CXX=${CXX-${host_alias}-gcc}
+ CFLAGS=${CFLAGS-"-g -O2"}
+ CXX=${CXX-${host_alias}-c++}
+ CXXFLAGS=${CXXFLAGS-"-g -O2"}
CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
- CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-gcc}
+ CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
DLLTOOL=${DLLTOOL-${host_alias}-dlltool}
DLLTOOL_FOR_TARGET=${DLLTOOL_FOR_TARGET-${target_alias}-dlltool}
GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
@@ -776,26 +891,30 @@ t loop
NM_FOR_TARGET=${NM_FOR_TARGET-${target_alias}-nm}
RANLIB=${RANLIB-${host_alias}-ranlib}
RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET-${target_alias}-ranlib}
+ WINDRES=${WINDRES-${host_alias}-windres}
+ WINDRES_FOR_TARGET=${WINDRES_FOR_TARGET-${target_alias}-windres}
- if [ -z "${BISON}" ]; then
+ if [ -z "${YACC}" ]; then
IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
for dir in $PATH; do
test -z "$dir" && dir=.
- if test -f $dir/byacc; then
- BISON=byacc
+ if test -f $dir/bison; then
+ YACC="bison -y"
break
fi
- if test -f $dir/bison; then
- BISON=bison
+ if test -f $dir/byacc; then
+ YACC=byacc
break
fi
if test -f $dir/yacc; then
- BISON=yacc
+ YACC=yacc
break
fi
done
IFS="$save_ifs"
- BISON=${BISON-bison}
+ if [ -z "${YACC}" ]; then
+ YACC="bison -y"
+ fi
fi
if [ -z "${LEX}" ]; then
@@ -823,6 +942,7 @@ t loop
export LD
export NM
export RANLIB
+ export WINDRES
else
# If CC is still not set, try to get gcc.
if [ -z "${CC}" ]; then
@@ -830,7 +950,16 @@ else
for dir in $PATH; do
test -z "$dir" && dir=.
if test -f $dir/gcc; then
- CC="gcc -O2"
+ CC="gcc"
+ echo 'void f(){}' > conftest.c
+ if test -z "`${CC} -g -c conftest.c 2>&1`"; then
+ CFLAGS=${CFLAGS-"-g -O2"}
+ CXXFLAGS=${CFLAGS-"-g -O2"}
+ else
+ CFLAGS=${CFLAGS-"-O2"}
+ CXXFLAGS=${CFLAGS-"-O2"}
+ fi
+ rm -f conftest*
break
fi
done
@@ -838,22 +967,28 @@ else
CC=${CC-cc}
fi
- CXX=${CXX-"gcc"}
+ CXX=${CXX-"c++"}
+ CFLAGS=${CFLAGS-"-g"}
+ CXXFLAGS=${CXXFLAGS-"-g -O2"}
fi
export CC
export CXX
+export CFLAGS
+export CXXFLAGS
+# FIXME: This should be in configure.in, not configure
case "$host" in
*go32*)
enable_gdbtk=no ;;
- *cygwin32*)
+ *msdosdjgpp*)
enable_gdbtk=no ;;
esac
+# FIXME: This should be in configure.in, not configure
# Determine whether gdb needs tk/tcl or not.
if [ "$enable_gdbtk" != "no" ]; then
- GDB_TK="all-tcl all-tk"
+ GDB_TK="all-tcl all-tk all-itcl all-tix all-libgui"
else
GDB_TK=""
fi
@@ -961,88 +1096,101 @@ EOF
# been somewhat optimized and is perhaps a bit twisty.
# code is order so as to try to sed the smallest input files we know.
+ # so do these separately because I don't trust the order of sed -e expressions.
- # the four makefile fragments MUST end up in the resulting Makefile in this order:
- # package, target, host, and site. so do these separately because I don't trust the
- # order of sed -e expressions.
+ # the five makefile fragments MUST end up in the resulting Makefile in this order:
+ # package macros, target, host, site, and package rules.
if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then
- # Conditionalize for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
- rm -f ${subdir}/Makefile.tem
- case "${site}" in
+ # Conditionalize the makefile for this package from "Makefile.in" (or whatever it's called) into Makefile.tem.
+ rm -f ${subdir}/${Makefile}.tem
+ case "${package_makefile_rules_frag}" in
"") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;;
*)
+ if [ ! -f ${package_makefile_rules_frag} ] ; then
+ package_makefile_rules_frag=${srcdir}/${package_makefile_rules_frag}
+ fi
+ if [ -f ${package_makefile_rules_frag} ] ; then
+ sed -e "/^####/ r ${package_makefile_rules_frag}" ${srcdir}/${subdir}/${Makefile_in} > ${Makefile}.tem
+ else
+ echo '***' Expected package makefile rules fragment \"${package_makefile_rules_frag}\" 1>&2
+ echo '***' is missing in ${PWD=`pwd`}. 1>&2
+ cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
+ fi
+ esac
+ # working copy now in ${Makefile}.tem
+
+ # Conditionalize for this site.
+ rm -f ${Makefile}
+ case "${site}" in
+ "") mv ${subdir}/Makefile.tem ${Makefile} ;;
+ *)
site_makefile_frag=${srcdir}/config/ms-${site}
if [ -f ${site_makefile_frag} ] ; then
- sed -e "/^####/ r ${site_makefile_frag}" ${srcdir}/${subdir}/${Makefile_in} \
- > ${subdir}/Makefile.tem
+ sed -e "/^####/ r ${site_makefile_frag}" ${subdir}/Makefile.tem \
+ > ${Makefile}
else
- cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
+ mv ${subdir}/Makefile.tem ${Makefile}
site_makefile_frag=
fi
;;
esac
- # working copy now in ${subdir}/Makefile.tem
+ # working copy now in ${Makefile}
# Conditionalize the makefile for this host.
- rm -f ${Makefile}
+ rm -f ${subdir}/Makefile.tem
case "${host_makefile_frag}" in
- "") mv ${subdir}/Makefile.tem ${Makefile} ;;
+ "") mv ${Makefile} ${subdir}/Makefile.tem ;;
*)
if [ ! -f ${host_makefile_frag} ] ; then
host_makefile_frag=${srcdir}/${host_makefile_frag}
fi
if [ -f ${host_makefile_frag} ] ; then
- sed -e "/^####/ r ${host_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
+ sed -e "/^####/ r ${host_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
else
echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
echo '***' is missing in ${PWD=`pwd`}. 1>&2
- mv ${subdir}/Makefile.tem ${Makefile}
+ mv ${Makefile} ${subdir}/Makefile.tem
fi
esac
- # working copy now in ${Makefile}
+ # working copy now in ${subdir)/Makefile.tem
# Conditionalize the makefile for this target.
- rm -f ${subdir}/Makefile.tem
+ rm -f ${Makefile}
case "${target_makefile_frag}" in
- "") mv ${Makefile} ${subdir}/Makefile.tem ;;
+ "") mv ${subdir}/Makefile.tem ${Makefile} ;;
*)
if [ ! -f ${target_makefile_frag} ] ; then
target_makefile_frag=${srcdir}/${target_makefile_frag}
fi
if [ -f ${target_makefile_frag} ] ; then
- sed -e "/^####/ r ${target_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
+ sed -e "/^####/ r ${target_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
else
- mv ${Makefile} ${subdir}/Makefile.tem
+ mv ${subdir}/Makefile.tem ${Makefile}
target_makefile_frag=
fi
;;
esac
- # real copy now in ${subdir}/Makefile.tem
+ # working copy now in ${Makefile}
- # Conditionalize the makefile for this package.
- rm -f ${Makefile}
+ # Emit the default values of this package's macros.
+ rm -f ${subdir}/Makefile.tem
case "${package_makefile_frag}" in
- "") mv ${subdir}/Makefile.tem ${Makefile} ;;
+ "") mv ${Makefile} ${subdir}/Makefile.tem ;;
*)
if [ ! -f ${package_makefile_frag} ] ; then
package_makefile_frag=${srcdir}/${package_makefile_frag}
fi
if [ -f ${package_makefile_frag} ] ; then
- sed -e "/^####/ r ${package_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
- rm -f ${subdir}/Makefile.tem
+ sed -e "/^####/ r ${package_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
else
- echo '***' Expected package makefile fragment \"${package_makefile_frag}\" 1>&2
+ echo '***' Expected package makefile fragment \"${package_makefile_rules_frag}\" 1>&2
echo '***' is missing in ${PWD=`pwd`}. 1>&2
- mv ${subdir}/Makefile.tem ${Makefile}
+ mv ${Makefile} ${subdir}/Makefile.tem
fi
esac
- # working copy now in ${Makefile}
-
- mv ${Makefile} ${subdir}/Makefile.tem
-
# real copy now in ${subdir}/Makefile.tem
# prepend warning about editting, and a bunch of variables.
@@ -1095,18 +1243,39 @@ EOF
echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
fi
+ # provide a proper gxx_include_dir to all subdirs.
+ # Note, if you change the default, make sure to fix both here
+ # and in the gcc subdirectory.
+ if test -z "${with_gxx_include_dir}"; then
+ echo gxx_include_dir = '${prefix}/include/g++' >> ${Makefile}
+ else
+ echo gxx_include_dir = ${with_gxx_include_dir} >> ${Makefile}
+ fi
+
# reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
# remove any form feeds.
if [ -z "${subdirs}" ]; then
- rm -f ${subdir}/Makefile.tem2
+ rm -f ${subdir}/Makefile.tm2
sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \
-e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
- ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2
+ ${subdir}/Makefile.tem > ${subdir}/Makefile.tm2
rm -f ${subdir}/Makefile.tem
- mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem
- fi
- sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \
- -e "s:^exec_prefix[ ]*=.*$:exec_prefix = ${exec_prefix}:" \
+ mv ${subdir}/Makefile.tm2 ${subdir}/Makefile.tem
+ fi
+ sed -e "s|^prefix[ ]*=.*$|prefix = ${prefix}|" \
+ -e "s|^exec_prefix[ ]*=.*$|exec_prefix = ${exec_prefix}|" \
+ -e "s|^bindir[ ]*=.*$|bindir = ${bindir}|" \
+ -e "s|^sbindir[ ]*=.*$|sbindir = ${sbindir}|" \
+ -e "s|^libexecdir[ ]*=.*$|libexecdir = ${libexecdir}|" \
+ -e "s|^datadir[ ]*=.*$|datadir = ${datadir}|" \
+ -e "s|^sysconfdir[ ]*=.*$|sysconfdir = ${sysconfdir}|" \
+ -e "s|^sharedstatedir[ ]*=.*$|sharedstatedir = ${sharedstatedir}|" \
+ -e "s|^localstatedir[ ]*=.*$|localstatedir = ${localstatedir}|" \
+ -e "s|^libdir[ ]*=.*$|libdir = ${libdir}|" \
+ -e "s|^includedir[ ]*=.*$|includedir = ${includedir}|" \
+ -e "s|^oldincludedir[ ]*=.*$|oldincludedir = ${oldincludedir}|" \
+ -e "s|^infodir[ ]*=.*$|infodir = ${infodir}|" \
+ -e "s|^mandir[ ]*=.*$|mandir = ${mandir}|" \
-e "/^CC[ ]*=/{
:loop1
/\\\\$/ N
@@ -1121,17 +1290,32 @@ EOF
t loop2
s%^CXX[ ]*=.*$%CXX = ${CXX}%
}" \
- -e "s:^SHELL[ ]*=.*$:SHELL = ${config_shell}:" \
- -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" \
- -e "s:^srcdir[ ]*=.*$:srcdir = ${makesrcdir}:" \
+ -e "/^CFLAGS[ ]*=/{
+ :loop3
+ /\\\\$/ N
+ s/\\\\\\n//g
+ t loop3
+ s%^CFLAGS[ ]*=.*$%CFLAGS = ${CFLAGS}%
+ }" \
+ -e "/^CXXFLAGS[ ]*=/{
+ :loop4
+ /\\\\$/ N
+ s/\\\\\\n//g
+ t loop4
+ s%^CXXFLAGS[ ]*=.*$%CXXFLAGS = ${CXXFLAGS}%
+ }" \
+ -e "s|^SHELL[ ]*=.*$|SHELL = ${config_shell}|" \
+ -e "s|^srcdir[ ]*=.*$|srcdir = ${makesrcdir}|" \
-e "s/ //" \
-e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \
-e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \
-e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \
- -e "s:^tooldir[ ]*=.*$:tooldir = ${tooldir}:" \
+ -e "s|^tooldir[ ]*=.*$|tooldir = ${tooldir}|" \
-e "s:^DEFAULT_YACC[ ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \
-e "s:^DEFAULT_LEX[ ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \
${subdir}/Makefile.tem >> ${Makefile}
+ sed -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" ${Makefile} >${Makefile}.tem
+ mv -f ${Makefile}.tem ${Makefile}
# If this is a Canadian Cross, preset the values of many more
# tools.
@@ -1213,7 +1397,7 @@ ${progname}" ${arguments} "
esac
done
-# If there are subdirectories, then recur.
+# If there are subdirectories, then recur.
if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
for configdir in ${configdirs} ; do
@@ -1243,6 +1427,10 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
newsrcdir=${srcdir}/${configdir}
srcdiroption="--srcdir=${newsrcdir}"
;;
+ ?:*) # absolute path on win32
+ newsrcdir=${srcdir}/${configdir}
+ srcdiroption="--srcdir=${newsrcdir}"
+ ;;
*) # otherwise relative
newsrcdir=../${srcdir}/${configdir}
srcdiroption="--srcdir=${newsrcdir}"
@@ -1256,6 +1444,9 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
/*) # absolute path
cache_file_option="--cache-file=${cache_file}"
;;
+ ?:*) # absolute path on win32
+ cache_file_option="--cache-file=${cache_file}"
+ ;;
*) # relative path
cache_file_option="--cache-file=../${cache_file}"
;;
@@ -1267,6 +1458,7 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
elif [ -f ${newsrcdir}/configure.in ] ; then
case "${progname}" in
/*) recprog=${progname} ;;
+ ?:*) recprog=${progname} ;;
*) recprog=../${progname} ;;
esac
else
@@ -1278,7 +1470,7 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
if [ ! -z "${recprog}" ] ; then
if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
- ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${floating_pointoption} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
+ ${srcdiroption} ${diroptions} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${floating_pointoption} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
true
else
echo Configure in `pwd` failed, exiting. 1>&2
diff --git a/contrib/binutils/configure.in b/contrib/binutils/configure.in
index 72b8036..5faaf02 100644
--- a/contrib/binutils/configure.in
+++ b/contrib/binutils/configure.in
@@ -14,7 +14,7 @@
## For more information on these two systems, check out the documentation
## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
-# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@
# these libraries are used by various programs built for the host environment
#
-host_libs="mmalloc libiberty opcodes bfd readline gash db tcl tk tclX itcl"
+host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tclX itcl tix libgui"
if [ "${enable_gdbgui}" = "yes" ] ; then
host_libs="${host_libs} libgui"
@@ -50,8 +50,7 @@ fi
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
# know that we are building the simulator.
-host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu bash m4 autoconf ispell grep diff rcs cvs fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils sn"
-
+host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu bash m4 autoconf automake ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext"
# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
@@ -66,7 +65,7 @@ target_libs="target-libiberty target-libgloss target-newlib target-libio target-
# list belongs in this list. those programs are also very likely
# candidates for the "native_only" list which follows
#
-target_tools="target-examples target-groff"
+target_tools="target-examples target-groff target-gperf"
################################################################################
@@ -80,11 +79,11 @@ target_tools="target-examples target-groff"
#
# This must be a single line because of the way it is searched by grep in
# the code below.
-native_only="autoconf cvs emacs emacs19 fileutils find gawk grep gzip hello indent ispell m4 rcs recode sed shellutils tar textutils gash uudecode wdiff gprof target-groff guile perl apache inet time bash prms sn"
+native_only="autoconf automake cvssrc emacs emacs19 fileutils find gawk gettext grep gzip hello indent ispell m4 rcs recode sed shellutils tar textutils gash uudecode wdiff gprof target-groff guile perl apache inet time bash prms snavigator gnuserv target-gperf libtool"
# directories to be built in a cross environment only
#
-cross_only="target-libiberty target-libgloss target-newlib"
+cross_only="target-libgloss target-newlib target-cygmon target-opcodes"
## All tools belong in one of the four categories, and are assigned above
## We assign ${configdirs} this way to remove all embedded newlines. This
@@ -108,41 +107,117 @@ appdirs=""
# Work in distributions that contain no compiler tools, like Autoconf.
if [ -d ${srcdir}/config ]; then
case "${host}" in
- m68k-hp-hpux*) host_makefile_frag=config/mh-hp300 ;;
- m68k-apollo-sysv*) host_makefile_frag=config/mh-apollo68 ;;
- m68k-apollo-bsd*) host_makefile_frag=config/mh-a68bsd ;;
- m88k-dg-dgux*) host_makefile_frag=config/mh-dgux ;;
- m88k-harris-cxux*) host_makefile_frag=config/mh-cxux ;;
- m88k-motorola-sysv*) host_makefile_frag=config/mh-delta88;;
- mips*-dec-ultrix*) host_makefile_frag=config/mh-decstation ;;
- mips*-nec-sysv4*) host_makefile_frag=config/mh-necv4 ;;
- mips*-sgi-irix6*) host_makefile_frag=config/mh-irix6 ;;
- mips*-sgi-irix5*) host_makefile_frag=config/mh-irix5 ;;
- mips*-sgi-irix4*) host_makefile_frag=config/mh-irix4 ;;
- mips*-sgi-irix3*) host_makefile_frag=config/mh-sysv ;;
- mips*-*-sysv4*) host_makefile_frag=config/mh-sysv4 ;;
- mips*-*-sysv*) host_makefile_frag=config/mh-riscos ;;
- i[3456]86-*-dgux*) host_makefile_frag=config/mh-dgux386 ;;
- i[3456]86-ncr-sysv4.3) host_makefile_frag=config/mh-ncrsvr43 ;;
- i[3456]86-ncr-sysv4*) host_makefile_frag=config/mh-ncr3000 ;;
- i[3456]86-*-sco3.2v5*) host_makefile_frag=config/mh-sysv ;;
- i[3456]86-*-sco*) host_makefile_frag=config/mh-sco ;;
- i[3456]86-*-isc*) host_makefile_frag=config/mh-sysv ;;
- i[3456]86-*-solaris2*) host_makefile_frag=config/mh-sysv4 ;;
- i[3456]86-*-aix*) host_makefile_frag=config/mh-aix386 ;;
- i[3456]86-*-go32*) host_makefile_frag=config/mh-go32 ;;
- *-cygwin32*) host_makefile_frag=config/mh-cygwin32 ;;
- *-windows*) host_makefile_frag=config/mh-windows ;;
- vax-*-ultrix2*) host_makefile_frag=config/mh-vaxult2 ;;
- *-*-solaris2*) host_makefile_frag=config/mh-solaris ;;
- m68k-sun-sunos*) host_makefile_frag=config/mh-sun3 ;;
- *-hp-hpux[78]*) host_makefile_frag=config/mh-hpux8 ;;
- *-hp-hpux*) host_makefile_frag=config/mh-hpux ;;
- *-*-hiux*) host_makefile_frag=config/mh-hpux ;;
- rs6000-*-lynxos*) host_makefile_frag=config/mh-lynxrs6k ;;
- *-*-lynxos*) host_makefile_frag=config/mh-lynxos ;;
- *-*-sysv4*) host_makefile_frag=config/mh-sysv4 ;;
- *-*-sysv*) host_makefile_frag=config/mh-sysv ;;
+ m68k-hp-hpux*)
+ host_makefile_frag="${host_makefile_frag} config/mh-hp300"
+ ;;
+ m68k-apollo-sysv*)
+ host_makefile_frag="${host_makefile_frag} config/mh-apollo68"
+ ;;
+ m68k-apollo-bsd*)
+ host_makefile_frag="${host_makefile_frag} config/mh-a68bsd"
+ ;;
+ m88k-dg-dgux*)
+ host_makefile_frag="${host_makefile_frag} config/mh-dgux"
+ ;;
+ m88k-harris-cxux*)
+ host_makefile_frag="${host_makefile_frag} config/mh-cxux"
+ ;;
+ m88k-motorola-sysv*)
+ host_makefile_frag="${host_makefile_frag} config/mh-delta88"
+ ;;
+ mips*-dec-ultrix*)
+ host_makefile_frag="${host_makefile_frag} config/mh-decstation"
+ ;;
+ mips*-nec-sysv4*)
+ host_makefile_frag="${host_makefile_frag} config/mh-necv4"
+ ;;
+ mips*-sgi-irix6*)
+ host_makefile_frag="${host_makefile_frag} config/mh-irix6"
+ ;;
+ mips*-sgi-irix5*)
+ host_makefile_frag="${host_makefile_frag} config/mh-irix5"
+ ;;
+ mips*-sgi-irix4*)
+ host_makefile_frag="${host_makefile_frag} config/mh-irix4"
+ ;;
+ mips*-sgi-irix3*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sysv"
+ ;;
+ mips*-*-sysv4*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
+ ;;
+ mips*-*-sysv*)
+ host_makefile_frag="${host_makefile_frag} config/mh-riscos"
+ ;;
+ i[3456]86-*-dgux*)
+ host_makefile_frag="${host_makefile_frag} config/mh-dgux386"
+ ;;
+ i[3456]86-ncr-sysv4.3*)
+ host_makefile_frag="${host_makefile_frag} config/mh-ncrsvr43"
+ ;;
+ i[3456]86-ncr-sysv4*)
+ host_makefile_frag="${host_makefile_frag} config/mh-ncr3000"
+ ;;
+ i[3456]86-*-sco3.2v5*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sysv"
+ ;;
+ i[3456]86-*-sco*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sco"
+ ;;
+ i[3456]86-*-isc*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sysv"
+ ;;
+ i[3456]86-*-solaris2*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
+ ;;
+ i[3456]86-*-aix*)
+ host_makefile_frag="${host_makefile_frag} config/mh-aix386"
+ ;;
+ i[3456]86-*-go32*)
+ host_makefile_frag="${host_makefile_frag} config/mh-go32"
+ ;;
+ i[3456]86-*-msdosdjgpp*)
+ host_makefile_frag="${host_makefile_frag} config/mh-go32"
+ ;;
+ *-cygwin32*)
+ host_makefile_frag="${host_makefile_frag} config/mh-cygwin32"
+ ;;
+ *-mingw32*)
+ host_makefile_frag="${host_makefile_frag} config/mh-mingw32"
+ ;;
+ *-windows*)
+ host_makefile_frag="${host_makefile_frag} config/mh-windows"
+ ;;
+ vax-*-ultrix2*)
+ host_makefile_frag="${host_makefile_frag} config/mh-vaxult2"
+ ;;
+ *-*-solaris2*)
+ host_makefile_frag="${host_makefile_frag} config/mh-solaris"
+ ;;
+ m68k-sun-sunos*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sun3"
+ ;;
+ *-hp-hpux[78]*)
+ host_makefile_frag="${host_makefile_frag} config/mh-hpux8"
+ ;;
+ *-hp-hpux*)
+ host_makefile_frag="${host_makefile_frag} config/mh-hpux"
+ ;;
+ *-*-hiux*)
+ host_makefile_frag="${host_makefile_frag} config/mh-hpux"
+ ;;
+ rs6000-*-lynxos*)
+ host_makefile_frag="${host_makefile_frag} config/mh-lynxrs6k"
+ ;;
+ *-*-lynxos*)
+ host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
+ ;;
+ *-*-sysv4*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
+ ;;
+ *-*-sysv*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sysv"
+ ;;
esac
fi
@@ -171,8 +246,8 @@ fi
# Well, we don't yet, but we will.
if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then
case "${target}" in
- alpha-dec-osf*) enable_shared=yes ;;
- alpha-*-linux*) enable_shared=yes ;;
+ alpha*-dec-osf*) enable_shared=yes ;;
+ alpha*-*-linux*) enable_shared=yes ;;
mips-sgi-irix5*) enable_shared=yes ;;
*) enable_shared=no ;;
esac
@@ -186,30 +261,54 @@ case "${enable_shared}" in
esac
if [ x${shared} = xyes ]; then
- waugh=
case "${host}" in
- hppa*) waugh=config/mh-papic ;;
- i[3456]86-*) waugh=config/mh-x86pic ;;
- sparc64-*) waugh=config/mh-sparcpic ;;
- *) waugh=config/mh-${host_cpu}pic ;;
+ hppa*)
+ host_makefile_frag="${host_makefile_frag} config/mh-papic"
+ ;;
+ i[3456]86-*)
+ host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
+ ;;
+ sparc64-*)
+ host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
+ ;;
+ powerpc*-*)
+ host_makefile_frag="${host_makefile_frag} config/mh-ppcpic"
+ ;;
+ alpha*-*-linux*)
+ host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
+ ;;
+ *)
+ if test -f ${srcdir}/config/mh-${host_cpu}pic; then
+ host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic"
+ fi
+ ;;
esac
- if [ -f ${srcdir}/${waugh} ]; then
- if [ -n "${host_makefile_frag}" ] ; then
- cat ${srcdir}/${host_makefile_frag} > mh-frag
- cat ${srcdir}/${waugh} >> mh-frag
- host_makefile_frag=mh-frag
- else
- host_makefile_frag=${waugh}
- fi
- fi
+fi
+
+rm -f mh-frag
+if [ -n "${host_makefile_frag}" ] ; then
+ for f in ${host_makefile_frag}
+ do
+ cat ${srcdir}/$f >> mh-frag
+ done
+ host_makefile_frag=mh-frag
fi
# per-target:
case "${target}" in
- v810*) target_makefile_frag=config/mt-v810 ;;
- i[3456]86-*-netware*) target_makefile_frag=config/mt-netware ;;
- powerpc-*-netware*) target_makefile_frag=config/mt-netware ;;
+ v810*)
+ target_makefile_frag="${target_makefile_frag} config/mt-v810"
+ ;;
+ i[3456]86-*-netware*)
+ target_makefile_frag="${target_makefile_frag} config/mt-netware"
+ ;;
+ powerpc-*-netware*)
+ target_makefile_frag="${target_makefile_frag} config/mt-netware"
+ ;;
+ *-*-linux-gnu)
+ target_makefile_frag="${target_makefile_frag} config/mt-linux"
+ ;;
esac
skipdirs=
@@ -224,7 +323,7 @@ case ${with_x} in
yes | "") # the default value for this tree is that X11 is available
;;
no)
- skipdirs="${skipdirs} tk gash"
+ skipdirs="${skipdirs} tk libgui gash"
;;
*)
echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2
@@ -244,21 +343,27 @@ if [ x"${host}" = x"${target}" ] ; then
skipdirs="${skipdirs} ${cross_only}"
is_cross_compiler=no
target_subdir=.
+ case "${host}" in
+ # We need multilib support for irix6, to get libiberty built
+ # properly for o32 and n32.
+ mips-sgi-irix6*) target_subdir=${host} ;;
+ esac
else
# similarly, don't build the targets in the 'native only'
# list when building a cross compiler
skipdirs="${skipdirs} ${native_only}"
is_cross_compiler=yes
target_subdir=${target_alias}
- if [ ! -d ${target_subdir} ] ; then
- if mkdir ${target_subdir} ; then true
- else
- echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
- exit 1
- fi
- fi
fi
+if [ ! -d ${target_subdir} ] ; then
+ if mkdir ${target_subdir} ; then true
+ else
+ echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
+ exit 1
+ fi
+fi
+
copy_dirs=
# Handle --with-headers=XXX. The contents of the named directory are
@@ -335,7 +440,7 @@ while [ $# != 0 ]; do
:
else
echo >config.temp
- ${srcdir}/install.sh -c -m 644 config.temp $2/COPIED
+ ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
fi
# Copy the directory, assuming we have tar.
@@ -356,6 +461,8 @@ done
case "${host}" in
i[3456]86-*-go32*)
configdirs="$configdirs dosrel" ;;
+ i[3456]86-*-mingw32*)
+ configdirs="$configdirs dosrel" ;;
*-cygwin32*)
configdirs="$configdirs dosrel" ;;
esac
@@ -368,21 +475,29 @@ noconfigdirs=""
case "${host}" in
i[3456]86-*-vsta)
- noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl db sn"
+ noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
;;
- i[3456]86-*-go32)
- noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl db sn"
+ i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
+ noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
+ ;;
+ i[3456]86-*-mingw32*)
+ # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv"
+ noconfigdirs="expect dejagnu cvs autoconf automake send-pr gprof rcs guile perl texinfo apache inet libtool"
;;
*-*-cygwin32)
- noconfigdirs="expect dejagnu cvs autoconf bison send-pr gprof rcs guile perl texinfo apache inet itcl db sn"
+ noconfigdirs="autoconf automake send-pr gprof rcs guile perl texinfo apache inet"
;;
*-*-windows*)
# This is only used to build WinGDB...
- configdirs="bfd gdb libiberty opcodes readline sim"
+# note that powerpc-eabi depends on sim configured before gdb.
+ configdirs="bfd libiberty opcodes readline sim gdb"
target_configdirs=
;;
+ *-*-netbsd*)
+ noconfigdirs="rcs"
+ ;;
ppc*-*-pe)
- noconfigdirs="patch diff make tk tcl expect dejagnu cvs autoconf texinfo bison send-pr gprof rcs guile perl apache inet itcl db sn"
+ noconfigdirs="patch diff make tk tcl expect dejagnu cvssrc autoconf automake texinfo bison send-pr gprof rcs guile perl apache inet itcl tix db snavigator gnuserv"
;;
esac
@@ -391,28 +506,46 @@ case "${target}" in
*-*-netware)
noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
;;
+ *-*-rtems*)
+ noconfigdirs="$noconfigdirs target-libgloss"
+ ;;
*-*-vxworks*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
- alpha-dec-osf*)
+ alpha*-dec-osf*)
# ld works, but does not support shared libraries. emacs doesn't
- # work. newlib is not 64 bit ready. I'm not sure about fileutils or grep.
+ # work. newlib is not 64 bit ready. I'm not sure about fileutils.
# gas doesn't generate exception information.
- noconfigdirs="$noconfigdirs gas ld emacs fileutils grep target-newlib target-libgloss"
+ noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss"
;;
alpha*-*-*vms*)
noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss"
;;
+ alpha*-*-linux*)
+ # newlib is not 64 bit ready
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ # linux has rx in libc
+ skipdirs="$skipdirs target-librx"
+ ;;
alpha*-*-*)
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
+ arc-*-*)
+ noconfigdirs="$noconfigdirs target-libgloss"
+ ;;
arm-*-pe*)
noconfigdirs="$noconfigdirs target-libgloss"
;;
arm-*-coff*)
noconfigdirs="$noconfigdirs target-libgloss"
;;
+ thumb-*-coff)
+ noconfigdirs="$noconfigdirs target-libgloss"
+ ;;
+ thumb-*-pe) # CYGNUS LOCAL nickc/thumb
+ noconfigdirs="$noconfigdirs target-libgloss"
+ ;;
arm-*-riscix*)
noconfigdirs="$noconfigdirs ld target-libgloss"
;;
@@ -424,8 +557,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
;;
hppa*-*-*elf* | \
- hppa*-*-lites* | \
- hppa*-*-rtems* )
+ hppa*-*-lites*)
# Do configure ld/binutils/gas for this case.
;;
hppa*-*-*)
@@ -438,20 +570,32 @@ case "${target}" in
esac
noconfigdirs="$noconfigdirs ld shellutils"
;;
- i[3456]86-*-go32)
+ i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
# but don't build gdb
noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
;;
- *-*-cygwin32)
+ i[3456]86-*-mingw32*)
+ target_configdirs="$target_configdirs target-mingw"
+ noconfigdirs="$noconfigdirs expect target-libgloss"
+
+ # Can't build gdb for mingw32 if not native.
+ case "${host}" in
+ i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
+ *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
+ ;;
+ esac
+ ;;
+ *-*-cygwin32*)
target_configdirs="$target_configdirs target-winsup"
- noconfigdirs="$noconfigdirs expect target-libgloss itcl db sn"
+ noconfigdirs="$noconfigdirs target-gperf target-libgloss"
# always build newlib.
skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
# Can't build gdb for cygwin32 if not native.
case "${host}" in
- *-*-cygwin32) ;; # keep gdb
- *) noconfigdirs="$noconfigdirs gdb"
+ *-*-cygwin32*) ;; # keep gdb tcl tk expect etc.
+ *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
+ ;;
esac
;;
i[3456]86-*-pe)
@@ -484,28 +628,28 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-libgloss"
;;
mn10300-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs"
;;
powerpc-*-aix*)
# copied from rs6000-*-* entry
- noconfigdirs="$noconfigdirs gprof cvs target-libgloss"
+ noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss"
# This is needed until gcc and ld are fixed to work together.
use_gnu_ld=no
;;
powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
target_configdirs="$target_configdirs target-winsup"
- noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl db sn"
+ noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv"
# always build newlib.
skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
;;
# This is temporary until we can link against shared libraries
powerpcle-*-solaris*)
- noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl db sn"
+ noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv"
;;
rs6000-*-lynxos*)
# The CVS server code doesn't work on the RS/6000
# Newlib makes problems for libg++ in crosses.
- noconfigdirs="$noconfigdirs target-newlib gprof cvs"
+ noconfigdirs="$noconfigdirs target-newlib gprof cvssrc"
;;
rs6000-*-aix*)
noconfigdirs="$noconfigdirs gprof"
@@ -524,7 +668,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
;;
mips*-*-irix6*)
- # The GNU linker does not support shared libraries.
+ # The GNU assembler and linker do not support IRIX 6.
# emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
noconfigdirs="$noconfigdirs ld gas gprof emacs target-libgloss"
;;
@@ -543,11 +687,27 @@ case "${target}" in
sh-*-*)
case "${host}" in
i[3456]86-*-vsta) ;; # don't add gprof back in
- i[3456]86-*-go32) ;; # don't add gprof back in
+ i[3456]86-*-go32*) ;; # don't add gprof back in
+ i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
*) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
esac
noconfigdirs="$noconfigdirs target-libgloss"
;;
+ sparc-*-elf*)
+ if [ x${is_cross_compiler} != xno ] ; then
+ target_configdirs="${target_configdirs} target-cygmon"
+ fi
+ ;;
+ sparc64-*-elf*)
+ if [ x${is_cross_compiler} != xno ] ; then
+ target_configdirs="${target_configdirs} target-cygmon"
+ fi
+ ;;
+ sparclite-*-aout*)
+ if [ x${is_cross_compiler} != xno ] ; then
+ target_configdirs="${target_configdirs} target-cygmon"
+ fi
+ ;;
sparc-*-sunos4*)
if [ x${is_cross_compiler} != xno ] ; then
noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
@@ -558,6 +718,9 @@ case "${target}" in
v810-*-*)
noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
;;
+ v850-*-*)
+ noconfigdirs="$noconfigdirs target-libgloss"
+ ;;
vax-*-vms)
noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
;;
@@ -575,13 +738,6 @@ case "${target}" in
;;
esac
-# targets that need a second pass
-case "${target}" in
- *-gm-magic*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
-esac
-
# If we aren't building newlib, then don't build libgloss, since libgloss
# depends upon some newlib header files.
case "${noconfigdirs}" in
@@ -589,12 +745,6 @@ case "${noconfigdirs}" in
*target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
esac
-# If we are building a Canadian Cross, discard tools that can not be built
-# using a cross compiler. FIXME: These tools should be fixed.
-if [ "${build}" != "${host}" ]; then
- noconfigdirs="$noconfigdirs expect dejagnu itcl db sn"
-fi
-
# Make sure we don't let GNU ld be added if we didn't want it.
if [ x$with_gnu_ld = xno ]; then
use_gnu_ld=no
@@ -741,12 +891,35 @@ fi
if [ x${shared} = xyes ]; then
case "${target}" in
- hppa*) target_makefile_frag=config/mt-papic ;;
- i[3456]86-*) target_makefile_frag=config/mt-x86pic ;;
- *) target_makefile_frag=config/mt-${target_cpu}pic ;;
+ hppa*)
+ target_makefile_frag="${target_makefile_frag} config/mt-papic"
+ ;;
+ i[3456]86-*)
+ target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
+ ;;
+ powerpc*-*)
+ target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
+ ;;
+ alpha*-*-linux*)
+ target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic"
+ ;;
+ *)
+ if test -f ${srcdir}/config/mt-${target_cpu}pic; then
+ target_makefile_frag="${target_makefile_frag} config/mt-${target_cpu}pic"
+ fi
+ ;;
esac
fi
+rm -f mt-frag
+if [ -n "${target_makefile_frag}" ] ; then
+ for f in ${target_makefile_frag}
+ do
+ cat ${srcdir}/$f >> mt-frag
+ done
+ target_makefile_frag=mt-frag
+fi
+
# post-target:
# Make sure that the compiler is able to generate an executable. If it
@@ -755,7 +928,7 @@ fi
# can be created. At this point the main configure script has set CC.
echo "int main () { return 0; }" > conftest.c
${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
-if [ $? = 0 ] && [ -s conftest ]; then
+if [ $? = 0 ] && [ -s conftest -o -s conftest.exe ]; then
:
else
echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
@@ -803,7 +976,7 @@ if [ "${shared}" = "yes" ]; then
case "${host}" in
*-*-hpux*)
- sed -e 's/RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
+ sed -e 's/^RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
Makefile > Makefile.tem
rm -f Makefile
mv -f Makefile.tem Makefile
@@ -811,12 +984,24 @@ if [ "${shared}" = "yes" ]; then
esac
fi
+# If we are building for a win32 host, then set INSTALL_PROGRAM_ARGS to
+# -x. This will cause programs to be installed with .exe extensions.
+case "${host}" in
+*-*-cygwin32* | i[3456]86-*-mingw32)
+ sed -e 's/^INSTALL_PROGRAM_ARGS[ ]*=.*$/INSTALL_PROGRAM_ARGS = -x/' \
+ Makefile > Makefile.tem
+ rm -f Makefile
+ mv -f Makefile.tem Makefile
+ ;;
+esac
+
# Record target_configdirs and the configure arguments in Makefile.
target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
targargs=`echo "${arguments}" | \
sed -e 's/--norecursion//' \
-e 's/--cache[a-z-]*=[^ ]*//' \
-e 's/--ho[a-z-]*=[^ ]*//' \
+ -e 's/--bu[a-z-]*=[^ ]*//' \
-e 's/--ta[a-z-]*=[^ ]*//'`
# Passing a --with-cross-host argument lets the target libraries know
@@ -828,7 +1013,12 @@ if [ x${is_cross_compiler} = xyes ]; then
targargs="--with-cross-host=${host_alias} ${targargs}"
fi
-targargs="--host=${target_alias} ${targargs}"
+# Default to --enable-multilib.
+if [ x${enable_multilib} = x ]; then
+ targargs="--enable-multilib ${targargs}"
+fi
+
+targargs="--host=${target_alias} --build=${build_alias} ${targargs}"
sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
-e "s%^CONFIG_ARGUMENTS[ ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
-e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
diff --git a/contrib/binutils/etc/Makefile.in b/contrib/binutils/etc/Makefile.in
index 1a7eb4c..c490082 100644
--- a/contrib/binutils/etc/Makefile.in
+++ b/contrib/binutils/etc/Makefile.in
@@ -40,45 +40,31 @@ TEXIDIR = $(srcdir)/../texinfo
#### Host, target, and site specific Makefile fragments come in here.
###
-INFOFILES = configure.info standards.info cfg-paper.info
-DVIFILES = configure.dvi standards.dvi cfg-paper.dvi
+INFOFILES = standards.info
+DVIFILES = standards.dvi
all:
-install: $(srcdir)/configure.man
- $(INSTALL_DATA) $(srcdir)/configure.man $(man1dir)/configure.1
+install:
uninstall:
- cd $(infodir) && rm -f configure.info* standards.info* cfg-paper.info*
info: $(INFOFILES)
install-info: info
- if test ! -f configure.info ; then cd $(srcdir); fi; \
- for i in configure.info* standards.info* cfg-paper.info*; do \
+ if test ! -f standards.info ; then cd $(srcdir); fi; \
+ for i in standards.info*; do \
$(INSTALL_DATA) $$i $(infodir)/$$i; \
done
dvi: $(DVIFILES)
-configure.info: $(srcdir)/configure.texi
- $(MAKEINFO) -o configure.info $(srcdir)/configure.texi
-
-configure.dvi: $(srcdir)/configure.texi
- TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/configure.texi
-
-standards.info: $(srcdir)/standards.texi
- $(MAKEINFO) -I$(srcdir) -o standards.info $(srcdir)/standards.texi
+standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi
+ $(MAKEINFO) --no-split -I$(srcdir) -o standards.info $(srcdir)/standards.texi
standards.dvi: $(srcdir)/standards.texi
TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/standards.texi
-cfg-paper.info : $(srcdir)/cfg-paper.texi
- $(MAKEINFO) -o cfg-paper.info $(srcdir)/cfg-paper.texi
-
-cfg-paper.dvi: $(srcdir)/cfg-paper.texi
- TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/cfg-paper.texi
-
clean:
rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
diff --git a/contrib/binutils/etc/configure b/contrib/binutils/etc/configure
index 74c33ae..101fcef 100755
--- a/contrib/binutils/etc/configure
+++ b/contrib/binutils/etc/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.10
+# Generated automatically using autoconf version 2.12.1
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -49,6 +49,9 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
ac_prev=
for ac_option
@@ -330,7 +333,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.10"
+ echo "configure generated by autoconf version 2.12.1"
exit 0 ;;
-with-* | --with-*)
@@ -432,11 +435,14 @@ do
done
# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
@@ -445,7 +451,7 @@ echo > confdefs.h
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=configure.texi
+ac_unique_file=Makefile.in
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
@@ -498,6 +504,7 @@ ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
@@ -539,27 +546,30 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:555: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -570,7 +580,7 @@ else
;;
esac
done
- IFS="$ac_save_ifs"
+ IFS="$ac_save_IFS"
fi
if test "${ac_cv_path_install+set}" = set; then
@@ -609,11 +619,25 @@ cat > confcache <<\EOF
# --recheck option to rerun configure.
#
EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
- >> confcache
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
if cmp -s $cache_file confcache; then
:
else
@@ -680,7 +704,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.10"
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -700,6 +724,7 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
@@ -726,20 +751,56 @@ s%@INSTALL_DATA@%$INSTALL_DATA%g
CEOF
EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
- # Adjust relative srcdir, etc. for subdirectories.
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
@@ -767,6 +828,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
[/$]*) INSTALL="$ac_given_INSTALL" ;;
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
esac
+
echo creating "$ac_file"
rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
@@ -775,16 +837,22 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
# $configure_input" ;;
*) ac_comsub= ;;
esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
-" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
-rm -f conftest.subs
+rm -f conftest.s*
+EOF
+cat >> $CONFIG_STATUS <<EOF
+EOF
+cat >> $CONFIG_STATUS <<\EOF
exit 0
EOF
diff --git a/contrib/binutils/etc/configure.in b/contrib/binutils/etc/configure.in
index a29f993..b785068 100644
--- a/contrib/binutils/etc/configure.in
+++ b/contrib/binutils/etc/configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.5)
-AC_INIT(configure.texi)
+AC_INIT(Makefile.in)
AC_PROG_INSTALL
diff --git a/contrib/binutils/etc/make-stds.texi b/contrib/binutils/etc/make-stds.texi
index e7c9cf9..2149764 100644
--- a/contrib/binutils/etc/make-stds.texi
+++ b/contrib/binutils/etc/make-stds.texi
@@ -209,11 +209,12 @@ don't need to replace them with other programs.
Each program-name variable should come with an options variable that is
used to supply options to the program. Append @samp{FLAGS} to the
program-name variable name to get the options variable name---for
-example, @code{BISONFLAGS}. (The name @code{CFLAGS} is an exception to
-this rule, but we keep it because it is standard.) Use @code{CPPFLAGS}
-in any compilation command that runs the preprocessor, and use
-@code{LDFLAGS} in any compilation command that does linking as well as
-in any direct use of @code{ld}.
+example, @code{BISONFLAGS}. (The names @code{CFLAGS} for the C
+compiler, @code{YFLAGS} for yacc, and @code{LFLAGS} for lex, are
+exceptions to this rule, but we keep them because they are standard.)
+Use @code{CPPFLAGS} in any compilation command that runs the
+preprocessor, and use @code{LDFLAGS} in any compilation command that
+does linking as well as in any direct use of @code{ld}.
If there are C compiler options that @emph{must} be used for proper
compilation of certain files, do not include them in @code{CFLAGS}.
@@ -239,6 +240,9 @@ Put @code{CFLAGS} last in the compilation command, after other variables
containing compiler options, so the user can use @code{CFLAGS} to
override the others.
+@code{CFLAGS} should be used in every invocation of the C compiler,
+both those which do compilation and those which do linking.
+
Every Makefile should define the variable @code{INSTALL}, which is the
basic command for installing a file into the system.
@@ -253,6 +257,18 @@ $(INSTALL_PROGRAM) foo $(bindir)/foo
$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
@end example
+Optionally, you may prepend the value of @code{DESTDIR} to the target
+filename. Doing this allows the installer to create a snapshot of the
+installation to be copied onto the real target filesystem later. Do not
+set the value of @code{DESTDIR} in your Makefile, and do not include it
+in any installed files. With support for @code{DESTDIR}, the above
+examples become:
+
+@example
+$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo
+$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a
+@end example
+
@noindent
Always use a file name, not a directory name, as the second argument of
the installation commands. Use a separate command for each file to be
@@ -279,6 +295,10 @@ When building the complete GNU system, the prefix will be empty and
@file{/usr} will be a symbolic link to @file{/}.
(If you are using Autoconf, write it as @samp{@@prefix@@}.)
+Running @samp{make install} with a different value of @code{prefix}
+from the one used to build the program should @var{not} recompile
+the program.
+
@item exec_prefix
A prefix used in constructing the default values of some of the
variables listed below. The default value of @code{exec_prefix} should
@@ -288,6 +308,10 @@ be @code{$(prefix)}.
Generally, @code{$(exec_prefix)} is used for directories that contain
machine-specific files (such as executables and subroutine libraries),
while @code{$(prefix)} is used directly for other directories.
+
+Running @samp{make install} with a different value of @code{exec_prefix}
+from the one used to build the program should @var{not} recompile the
+program.
@end table
Executable programs are installed in one of the following directories.
@@ -355,14 +379,11 @@ files. This directory should normally be @file{/usr/local/etc}, but
write it as @file{$(prefix)/etc}.
(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.)
-@c rewritten to avoid overfull hbox --tower
-Do not install executables
-@c here
-in this directory (they probably
-belong in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not
-install files that are modified in the normal course of their use
-(programs whose purpose is to change the configuration of the system
-excluded). Those probably belong in @file{$(localstatedir)}.
+Do not install executables here in this directory (they probably belong
+in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not install
+files that are modified in the normal course of their use (programs
+whose purpose is to change the configuration of the system excluded).
+Those probably belong in @file{$(localstatedir)}.
@item sharedstatedir
The directory for installing architecture-independent data files which
@@ -415,7 +436,7 @@ should normally be @file{/usr/local/include}, but write it as
@file{$(prefix)/include}.
(If you are using Autoconf, write it as @samp{@@includedir@@}.)
-Most compilers other than GCC do not look for header files in
+Most compilers other than GCC do not look for header files in directory
@file{/usr/local/include}. So installing the header files this way is
only useful with GCC. Sometimes this is not a problem because some
libraries are only really intended to work with GCC. But some libraries
@@ -567,12 +588,12 @@ Here is a sample rule to install an Info file:
@comment This example has been carefully formatted for the Make manual.
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
@smallexample
-$(infodir)/foo.info: foo.info
+$(DESTDIR)$(infodir)/foo.info: foo.info
$(POST_INSTALL)
# There may be a newer info file in . than in srcdir.
-if test -f foo.info; then d=.; \
else d=$(srcdir); fi; \
- $(INSTALL_DATA) $$d/foo.info $@@; \
+ $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@@; \
# Run install-info only if it exists.
# Use `if' instead of just prepending `-' to the
# line so we notice real errors from install-info.
@@ -580,8 +601,8 @@ $(infodir)/foo.info: foo.info
# fail gracefully when there is an unknown command.
if $(SHELL) -c 'install-info --version' \
>/dev/null 2>&1; then \
- install-info --dir-file=$(infodir)/dir \
- $(infodir)/foo.info; \
+ install-info --dir-file=$(DESTDIR)$(infodir)/dir \
+ $(DESTDIR)$(infodir)/foo.info; \
else true; fi
@end smallexample
diff --git a/contrib/binutils/etc/standards.texi b/contrib/binutils/etc/standards.texi
index 4170093..910bf8b 100644
--- a/contrib/binutils/etc/standards.texi
+++ b/contrib/binutils/etc/standards.texi
@@ -2,8 +2,8 @@
@c %**start of header
@setfilename standards.info
@settitle GNU Coding Standards
-@c UPDATE THIS DATE WHENEVER YOU MAKE CHANGES!
-@set lastupdate 16 January 1997
+@c This date is automagically updated when you save this file:
+@set lastupdate March 13, 1998
@c %**end of header
@ifinfo
@@ -28,7 +28,7 @@ END-INFO-DIR-ENTRY
@ifinfo
GNU Coding Standards
-Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -59,7 +59,7 @@ by the Free Software Foundation.
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright @copyright{} 1992, 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -104,8 +104,8 @@ programs written in C, but many of the rules and principles are useful
even if you write in another programming language. The rules often
state reasons for writing in a certain way.
-Corrections or suggestions regarding this document should be sent to
-@code{gnu@@prep.ai.mit.edu}. If you make a suggestion, please include a
+Corrections or suggestions for this document should be sent to
+@email{gnu@@gnu.org}. If you make a suggestion, please include a
suggested new wording for it; our time is limited. We prefer a context
diff to the @file{standards.texi} or @file{make-stds.texi} files, but if
you don't have those files, please mail your suggestion anyway.
@@ -168,14 +168,18 @@ contributor to a program must sign some sort of legal papers in order
for us to have clear title to the program. The main author alone is not
enough.
-So, before adding in any contributions from other people, tell us
-so we can arrange to get the papers. Then wait until we tell you
+So, before adding in any contributions from other people, please tell
+us, so we can arrange to get the papers. Then wait until we tell you
that we have received the signed papers, before you actually use the
contribution.
This applies both before you release the program and afterward. If
you receive diffs to fix a bug, and they make significant changes, we
-need legal papers for it.
+need legal papers for that change.
+
+This also applies to comments and documentation files. For copyright
+law, comments and code are just text. Copyright applies to all kinds of
+text, so we need legal papers for all kinds.
You don't need papers for changes of a few lines here or there, since
they are not significant for copyright purposes. Also, you don't need
@@ -192,6 +196,10 @@ The very worst thing is if you forget to tell us about the other
contributor. We could be very embarrassed in court some day as a
result.
+We have more detailed advice for maintainers of programs; if you have
+reached the stage of actually maintaining a program for GNU (whether
+released or not), please ask us for a copy.
+
@node Design Advice
@chapter General Program Design
@@ -236,9 +244,6 @@ completely with something totally different and better. (For example,
feature as well. (There is a free @code{vi} clone, so we offer it.)
Additional useful features not in Berkeley Unix are welcome.
-Additional programs with no counterpart in Unix may be useful,
-but our first priority is usually to duplicate what Unix already
-has.
@node Using Extensions
@section Using Non-standard Features
@@ -323,13 +328,16 @@ write in @sc{ansi} C.
Using a language other than C is like using a non-standard feature: it
will cause trouble for users. Even if GCC supports the other language,
users may find it inconvenient to have to install the compiler for that
-other language in order to build your program. So please write in C.
+other language in order to build your program. For example, if you
+write your program in C++, people will have to install the C++ compiler
+in order to compile your program. Thus, it is better if you write in C.
-There are three exceptions for this rule:
+But there are three situations when there is no disadvantage in using
+some other language:
@itemize @bullet
@item
-It is okay to use a special language if the same program contains an
+It is okay to use another language if your program contains an
interpreter for that language.
For example, if your program links with GUILE, it is ok to write part of
@@ -343,10 +351,14 @@ This is okay because the only people who want to build the tool will be
those who have installed the other language anyway.
@item
-If an application is not of extremely widespread interest, then perhaps
+If an application is of interest to a narrow community, then perhaps
it's not important if the application is inconvenient to install.
@end itemize
+C has one other advantage over C++ and other compiled languages: more
+people know C, so more people will find it easy to read and modify the
+program if it is written in C.
+
@node Program Behavior
@chapter Program Behavior for All Programs
@@ -606,10 +618,10 @@ you can do so by printing an additional line of version info for each
library you want to mention. Use the same format for these lines as for
the first line.
-Please don't mention all the libraries that the program uses ``just for
-completeness''---that would produce a lot of unhelpful clutter. Please
-mention library version numbers only if you find in practice that they
-are very important to you in debugging.
+Please do not mention all of the libraries that the program uses ``just
+for completeness''---that would produce a lot of unhelpful clutter.
+Please mention library version numbers only if you find in practice that
+they are very important to you in debugging.
The following line, after the version number line or lines, should be a
copyright notice. If more than one copyright notice is called for, put
@@ -628,10 +640,12 @@ Here's an example of output that follows these rules:
@smallexample
GNU Emacs 19.34.5
Copyright (C) 1996 Free Software Foundation, Inc.
-GNU Emacs comes with NO WARRANTY, to the extent permitted by law.
+GNU Emacs comes with NO WARRANTY,
+to the extent permitted by law.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
-For more information about these matters, see the files named COPYING.
+For more information about these matters,
+see the files named COPYING.
@end smallexample
You should adapt this to your program, of course, filling in the proper
@@ -664,7 +678,7 @@ Report bugs to @var{mailing-address}.
Here is a table of long options used by GNU programs. It is surely
incomplete, but we aim to list all the options that a new program might
want to be compatible with. If you use names not already in the table,
-please send @samp{gnu@@prep.ai.mit.edu} a list of them, with their
+please send @email{gnu@@gnu.org} a list of them, with their
meanings, so we can update the table.
@c Please leave newlines between items in this table; it's much easier
@@ -1159,7 +1173,7 @@ Used in @code{su}.
@item machine
No listing of which programs already use this;
someone should check to
-see if any actually do and tell @code{gnu@@prep.ai.mit.edu}.
+see if any actually do, and tell @email{gnu@@gnu.org}.
@item macro-name
@samp{-M} in @code{ptx}.
@@ -1962,6 +1976,11 @@ its sense}. @samp{#else} should have a comment describing the condition
@dots{}
#endif /* not foo */
@end group
+@group
+#ifdef foo
+ @dots{}
+#endif /* foo */
+@end group
@end example
@noindent
@@ -1975,9 +1994,13 @@ but, by contrast, write the comments this way for a @samp{#ifndef}:
@dots{}
#endif /* foo */
@end group
+@group
+#ifndef foo
+ @dots{}
+#endif /* not foo */
+@end group
@end example
-
@node Syntactic Conventions
@section Clean Use of C Constructs
@@ -2433,7 +2456,7 @@ printf ((nfiles != 1 ? gettext ("%d files processed")
@end example
@noindent
-This can any method of forming the plural of the word for ``file'', and
+This can be any method of forming the plural of the word for ``file'', and
also handles languages that require agreement in the word for
``processed''.
@@ -2924,9 +2947,12 @@ to work with @var{package}.
@c Giving an optional @var{parameter} of
@c @samp{no} should omit @var{package}, if it is used by default.
-Possible values of @var{package} include @samp{x}, @samp{x-toolkit},
-@samp{gnu-as} (or @samp{gas}), @samp{gnu-ld}, @samp{gnu-libc}, and
-@samp{gdb}.
+Possible values of @var{package} include
+@samp{gnu-as} (or @samp{gas}), @samp{gnu-ld}, @samp{gnu-libc},
+@samp{gdb},
+@samp{x},
+and
+@samp{x-toolkit}.
Do not use a @samp{--with} option to specify the file name to use to
find certain files. That is outside the scope of what @samp{--with}
@@ -2993,9 +3019,9 @@ ignore most of its arguments.
@node Releases
@section Making Releases
-Package the distribution of Foo version 69.96 in a gzipped tar file
-named @file{foo-69.96.tar.gz}. It should unpack into a subdirectory
-named @file{foo-69.96}.
+Package the distribution of @code{Foo version 69.96} up in a gzipped tar
+file with the name @file{foo-69.96.tar.gz}. It should unpack into a
+subdirectory named @file{foo-69.96}.
Building and installing the program should never modify any of the files
contained in the distribution. This means that all the files that form
@@ -3059,3 +3085,9 @@ other files to get.
@contents
@bye
+Local variables:
+update-date-leading-regexp: "@c This date is automagically updated when you save this file:\n@set lastupdate "
+update-date-trailing-regexp: ""
+eval: (load "/gd/gnuorg/update-date.el")
+eval: (add-hook 'write-file-hooks 'update-date)
+End:
diff --git a/contrib/binutils/gas/CONTRIBUTORS b/contrib/binutils/gas/CONTRIBUTORS
index 14ef05c..96d8775 100644
--- a/contrib/binutils/gas/CONTRIBUTORS
+++ b/contrib/binutils/gas/CONTRIBUTORS
@@ -52,9 +52,10 @@ code to support a.out format.
Support for the Zilog Z8k and Hitachi H8/300, H8/500 and SH processors
(tc-z8k, tc-h8300, tc-h8500, tc-sh), and IEEE 695 object file format
-(obj-ieee), was written by Steve Chamberlain of Cygnus Support. Steve
-also modified the COFF back end (obj-coffbfd) to use BFD for some
-low-level operations, for use with the Hitachi, 29k and Zilog targets.
+(obj-ieee), was written by Steve Chamberlain of Cygnus Solutions.
+Steve also modified the COFF back end (obj-coffbfd) to use BFD for
+some low-level operations, for use with the Hitachi, 29k and Zilog
+targets.
John Gilmore built the AMD 29000 support, added .include support, and
simplified the configuration of which versions accept which
@@ -64,7 +65,7 @@ synthetic instructions remained shrinkable (jbsr). John fixed many
bugs, including true tested cross-compilation support, and one bug in
relaxation that took a week and required the proverbial one-bit fix.
-Ian Lance Taylor of Cygnus Support merged the Motorola and MIT
+Ian Lance Taylor of Cygnus Solutions merged the Motorola and MIT
syntaxes for the 68k, completed support for some COFF targets (68k,
i386 SVR3, and SCO Unix), wrote the ECOFF support based on Michael
Meissner's mips-tfile program, wrote the PowerPC and RS/6000 support,
@@ -77,23 +78,26 @@ Steve Chamberlain made gas able to generate listings.
Support for the HP9000/300 was contributed by Glenn Engel of HP.
Support for ELF format files has been worked on by Mark Eichin of
-Cygnus Support (original, incomplete implementation), Pete Hoogenboom
-at the University of Utah (HPPA mainly), Michael Meissner of the Open
-Software Foundation (i386 mainly), and Ken Raeburn of Cygnus Support
-(sparc, initial 64-bit support).
+Cygnus Solutions (original, incomplete implementation), Pete
+Hoogenboom at the University of Utah (HPPA mainly), Michael Meissner
+of the Open Software Foundation (i386 mainly), and Ken Raeburn of
+Cygnus Solutions (sparc, initial 64-bit support).
-Several engineers at Cygnus Support have also provided many small bug
-fixes and configuration enhancements.
+Several engineers at Cygnus Solutions have also provided many small
+bug fixes and configuration enhancements.
The initial Alpha support was contributed by Carnegie-Mellon
University. Additional work was done by Ken Raeburn of Cygnus
-Support. Richard Henderson then rewrote much of the Alpha support.
+Solutions. Richard Henderson then rewrote much of the Alpha support.
Ian Dall updated the support code for the National Semiconductor 32000
series, and added support for Mach 3 and NetBSD running on the PC532.
Klaus Kaempf ported the assembler and the binutils to openVMS/Alpha.
+Steve Haworth contributed the support for the Texas Instruction c30
+(tms320c30).
+
Many others have contributed large or small bugfixes and enhancements. If
you've contributed significant work and are not mentioned on this list, and
want to be, let us know. Some of the history has been lost; we aren't
diff --git a/contrib/binutils/gas/ChangeLog b/contrib/binutils/gas/ChangeLog
index d513e07..a7e46aa 100644
--- a/contrib/binutils/gas/ChangeLog
+++ b/contrib/binutils/gas/ChangeLog
@@ -1,11 +1,1957 @@
+Mon Apr 27 13:45:04 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set version number to 2.9.1.
+ * configure: Rebuild.
+
+Fri Apr 24 12:47:42 1998 Philippe De Muyter <phdm@macqel.be>
+
+ * read.c (s_set): Cast xmalloc return value to fragS *.
+ * config/tc-m68k.c (m68k_ip): Function made static to match
+ previous forward declaration.
+ (insert_reg, init_regtable, md_convert_frag_1): Likewise.
+
+Thu Apr 23 19:23:23 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-ppc.c (ppc_fix_adjustable): Correct test of whether a
+ reloc is in the TOC csect.
+
+Tue Apr 21 16:18:12 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * doc/Makefile.am (as.dvi): New target.
+ * doc/Makefile.in: Rebuild.
+
+Thu Apr 2 16:36:47 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * gasp.c (main): Set next field of new include_path structure to
+ NULL. From Avery Pennarun <averyp@gdc.ca>.
+
+Wed Apr 1 14:41:31 1998 Dean M. Deaver <deaver@amt.tay1.dec.com>
+
+ * config/tc-arm.c (decode_shift): Handle addressing mode 2 w/rrx
+ also.
+
+Wed Apr 1 13:13:20 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * doc/as.texinfo: Use @itemx for a secondary item in a table.
+ * doc/c-hppa.texi: Likewise.
+
+Tue Mar 31 17:52:40 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Rebuild dependencies.
+ * Makefile.in: Rebuild.
+
+ * Makefile.am (DEP_INCLUDES): New variable.
+ (.dep1): Change to work when srcdir is not an absolute path.
+ (.tcdep, .objdep, .dep2, dep.sed): Likewise.
+ * Makefile.in: Rebuild.
+
+Mon Mar 30 16:12:34 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-i386.h, config/tc-i386.c: Revert March 24
+ LinearAddress patch.
+
+ * configure.in: Set version number to 2.9.
+ * configure: Rebuild.
+
+Mon Mar 30 11:22:08 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * config/tc-i386.h (FWait): Define.
+ * config/tc-i386.c (md_assemble): Emit fwait prefix before any
+ other prefixes. Check FWait flag in opcode table to see which
+ instructions require an fwait prefix.
+
+Mon Mar 30 10:12:00 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * stabs.c (get_stab_string_offset): Always create a stab string
+ section.
+
+Sat Mar 28 22:28:02 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Fix some gcc -Wall warnings:
+ * atof-generic.c (atof_generic): Add casts to avoid warnings.
+ * ehopt.c (eh_frame_code_alignment): Likewise.
+ * expr.c (integer_constant, operand): Likewise.
+ * frags.c (frag_align): Likewise.
+ * gasp.c (level_0, change_base, doinstr): Likewise.
+ * hash.c (hash_ask): Likewise.
+ * listing.c (listing_page, calc_hex, print_lines): Likewise.
+ (debugging_pseudo): Likewise.
+ * macro.c (define_macro, check_macro): Likewise.
+ * read.c (read_a_source_file, s_align, s_float_space): Likewise.
+ (ignore_rest_of_line, float_cons): Likewise.
+ * symbols.c (decode_local_label_name): Likewise.
+ * write.c (record_alignment, cvs_frag_to_fill): Likewise.
+ (fixup_segment, number_to_chars_bigendian): Likewise.
+ (number_to_chars_littleendian): Likewise.
+ * config/atof-ieee.c (gen_to_words): Likewise.
+ * config/tc-sparc.c (md_begin, md_assemble): Likewise.
+ (sparc_ip, parse_keyword_arg, s_common): Likewise.
+ * read.c (output_big_sleb128): Initialize locals to avoid
+ warnings.
+ (output_big_uleb128, equals): Likewise.
+ * atof-generic.c (atof_generic): Change number_of_digits_* locals
+ to unsigned int. Change zeros to unsigned int.
+ * cond.c (s_if): Add return to default case.
+ * frags.c (frag_now_fix): Change return type to addressT.
+ * frags.h (frag_now_fix): Update declaration.
+ * listing.c (file_info_struct): Change linenum to unsigned int.
+ (struct list_info_struct): Change hll_line to unsigned int.
+ (print_source): Update format string.
+ * read.c (emit_expr): Change scan to unsigned int, and don't
+ bother to initialize it.
+ * symbols.c (dollar_label_count): Change to unsigned long.
+ * write.c (adjust_reloc_syms): Remove unused label reduce_fixup.
+ * config/tc-sparc.c (sparc_memory_model): Only define if OBJ_ELF.
+ * config/tc-sparc.c (tc_gen_reloc): Add return to default case.
+
+Fri Mar 27 12:46:47 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-m68k.c (m68k_ip): Check legal addressing modes for
+ mcf5200 just as we do for m68000.
+ (m68k_init_after_args): Likewise.
+ (md_estimate_size_before_relax): Likewise.
+
+Thu Mar 26 23:07:18 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * config/tc-i386.c (md_assemble): Swap template arguments to
+ CONSISTENT_REGISTER_MATCH macro in reverse direction test.
+ This macro is currently symmetric, so passing them the wrong
+ way didn't cause any problem, but may if the macro is changed
+ in the future.
+ After copying template to i.tm, use i.tm. rather than t-> to
+ access fields, and make t a const*
+ Move i.tm.operand_types[] swap to immediately after the copy.
+
+Wed Mar 25 13:44:18 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * expr.h (expr_build_uconstant): Add prototype.
+ (expr_build_unary,expr_build_binary): Add prototypes.
+ * expr.c (expr_build_uconstant): New function.
+ (expr_build_unary,expr_build_binary): New functions.
+
+Wed Mar 25 13:10:42 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * gasp.c (IS*): Cast argument to unsigned char, not unsigned int.
+ * macro.c (macro_expand_body): Increase buffer size.
+ * messages.c (as_warn): Likewise.
+ (as_warn_where, as_bad, as_bad_where): Likewise.
+
+Wed Mar 25 12:59:07 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Based on patch from H.J. Lu <hjl@gnu.org>:
+ * Makefile.am (DISTSTUFF): New variable.
+ (diststuff): New target.
+ * Makefile.in: Rebuild.
+
+Tue Mar 24 16:51:29 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-m32r.h (md_cleanup, md_elf_section_change_hook): Call
+ m32r_elf_section_change_hook.
+
+ * config/tc-m32r.c (m32r_elf_section_change_hook): New function to
+ emit a nop if a section ends with a 16 bit instruction.
+
+Tue Mar 24 19:48:09 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.c (obj_coff_bss): Compile unconditionally. Call
+ s_lcomm rather than obj_coff_lcomm.
+ (obj_pseudo_table): Compile .bss pseudo-op unconditionally.
+
+Tue Mar 24 18:30:58 1998 H.J. Lu <hjl@gnu.org>
+
+ * config/tc-i386.h (LinearAddress): Define.
+ * config/tc-i386.c (md_assemble): If LinearAddress is set for the
+ instruction, don't use a default segment.
+
+Mon Mar 23 18:53:40 1998 Joel Sherrill <joel@OARcorp.com>
+
+ * configure.in: (sh*-*-rtems*): Switched from ELF to COFF.
+ * configure: Rebuild.
+
+Fri Mar 20 19:15:44 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4, configure: Rebuild with libtool 1.2.
+
+Thu Mar 19 16:03:12 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-arm.c (md_apply_fix3): fix code to test the range of
+ PC relative branches (PR15358). Patch courtesy of Jonathan
+ Walton.
+
+
+Wed Mar 18 09:29:51 1998 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in (emulations): Add thumb-pe target.
+
+ * configure (emulations): Add thumb-pe target.
+
+1998-03-17 Ken Raeburn <raeburn@cygnus.com>
+
+ * itbl-lex.l (yywrap): Don't define if already defined as a
+ macro.
+
+Fri Mar 13 16:31:38 1998 Tom Tromey <tromey@cygnus.com>
+
+ * depend.c (quote_string_for_make): New function.
+ (wrap_output): Use it.
+
+Thu Mar 12 18:28:22 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/obj-elf.c (obj_elf_section): Set bss flag in seg_info
+ structure if type is SHT_NOBITS. [Bug fix courtesy of rth]
+
+Sat Feb 28 17:28:55 1998 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-alpha.c (md_shortopts, md_longopts, md_parse_option):
+ Recognize -GN and -relax.
+ (md_begin): Initialize gp size from -G switch.
+ (alpha_force_relocation): Always force if -relax.
+ (alpha_align): Take a new argument that will specify when to
+ emit an R_ALPHA_ALIGN relocation (though we don't do that now).
+ Change all callers. Emit nop alignment padding as nop+unop pair.
+
+Sat Feb 28 17:06:22 1998 Richard Henderson <rth@cygnus.com>
+
+ * config/obj-elf.c [TC_ALPHA]: Include <elf/alpha.h>.
+ * config/tc-alpha.h (ELF_TC_SPECIAL_SECTIONS): New.
+
+Mon Feb 23 11:29:06 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen.c: #include symcat.h.
+ * config/tc-m32r.c: Likewise.
+
+Mon Feb 23 10:27:40 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mips.c (mips_ip, case 'P'): Make 'P' arguments be
+ absolute expressions instead of '$' prefixed register names.
+
+Sat Feb 21 22:36:52 1998 Richard Henderson <rth@cygnus.com>
+
+ * read.c (s_set): Record file and line info for symbols when -as.
+ (pseudo_set): Don't overwrite that dummy fragment.
+
+Fri Feb 20 15:03:13 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-ppc.c (md_pseudo_table): Add "section".
+ (ppc_named_section): New static function.
+
+Thu Feb 19 22:25:42 1998 Richard Henderson <rth@cygnus.com>
+
+ * tc-ppc.c (ppc_biei): Cache the last symbol we inserted
+ so we don't have to scan the entire list.
+
+Thu Feb 19 16:08:15 1998 Richard Henderson <rth@cygnus.com>
+
+ * listing.c (list_symbol_table): Categorize symbols by
+ undefined_section rather than sy_frag->line == NULL.
+
+Wed Feb 18 23:39:46 1998 Richard Henderson <rth@cygnus.com>
+
+ * Makefile.am (install-exec-local): Install properly when ln
+ fails or tooldir == prefix.
+
+Tue Feb 17 18:58:51 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen.c (cgen_md_apply_fix3): Delete call to validate_operand.
+ Test result of insert_operand for error.
+
+Fri Feb 13 16:41:42 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Add cygnus.
+ * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e.
+ * doc/Makefile.am (AUTOMAKE_OPTIONS): Define.
+ * doc/Makefile.in: Rebuild.
+
+Fri Feb 13 00:47:44 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (macro_build): Handle operand type 'C'.
+ (macro): Fix handling of M_COP[0-3].
+
+Thu Feb 12 14:06:59 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Based on patches from Ross Harvey <ross@teraflop.com>:
+ * macro.c (ISSEP): Only treat '<' and '>' as separator characters
+ if macro_alternate or macro_mri.
+ (getstring): Remove support for byte constants between < and >.
+ (get_any_string): '<' only starts a string if macro_alternate or
+ macro_mri.
+ (macro_expand_body): Permit keyword parameters following
+ positional parameters.
+
+ NetBSD patches from Gordon W. Ross <gwr@mc.com>:
+ * configure.in (alpha*-*-netbsd*): New target.
+ * config/te-nbsd.h (LOCAL_LABELS_FB): Define.
+ * configure: Rebuild.
+
+ * as.h (flag_warn_suppress_instructionswap): Move from here...
+ * config/tc-d10v.c (flag_warn_suppress_instructionswap): ...to
+ here, and make static.
+
+ * ehopt.c (eh_frame_code_alignment): Only use seg_info if
+ BFD_ASSEMBLER or MANY_SEGMENTS.
+
+ * as.c (show_usage): Update bug-gnu-utils address.
+ * gasp.c (show_usage): Likewise.
+ * doc/as.texinfo (Bug Reporting): Likewise.
+
+Wed Feb 11 23:26:28 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mips.c (load_address): Don't use mips III or mips IV
+ insns regardless of the size of a pointer if we're in mips I or
+ MIPS II mode.
+ (macro, macro2, s_cprestore, s_cpadd): Likewise.
+
+Thu Feb 12 03:41:00 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+Fix rac to accept only a0:
+ * tc-d10v.c (parallel_ok, find_opcode):
+ Split OPERAND_ACC into OPERAND_ACC0 and OPERAND_ACC1.
+ Introduce OPERAND_GPR.
+
+Wed Feb 11 16:28:13 1998 Richard Henderson <rth@cygnus.com>
+
+ * read.c (s_fill): Handle non-constant repeat counts by creating
+ an rs_space fragment.
+
+Tue Feb 10 18:31:31 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-i386.c (i386_operand): Change error added Jan 2 1998
+ from as_bad to as_warn.
+
+Tue Feb 10 18:04:00 1998 Jim Lemke <jlemke@cygnus.com>
+
+ * as.c: (perform_an_assembly_pass): Use [TEXT|DATA|BSS]_SECTION_NAME
+ * as.h: Define default values of [TEXT|DATA|BSS]_SECTION_NAME
+ * config/obj-elf.c (elf_begin): Use [TEXT|DATA|BSS]_SECTION_NAME
+
+Tue Feb 10 17:58:18 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ehopt.c (eh_frame_code_alignment): If not BFD_ASSEMBLER, use
+ seg_fix_rotP rather than fix_root from seg_info.
+
+Tue Feb 10 15:32:22 1998 Ian Carmichael <iancarm@cygnus.com>
+
+ * expr.c: Add support for 0x1_2_3_4 bignums.
+
+Tue Feb 10 14:43:40 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Change -linux* to -linux-gnu*.
+ * configure: Rebuild.
+
+ * app.c (do_scrub_begin): Treat \r as whitespace.
+
+Mon Feb 9 14:16:11 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Update dependencies.
+ * Makefile.in: Rebuild.
+
+Sat Feb 7 15:33:51 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure, aclocal.m4: Rebuild with new libtool.
+
+Fri Feb 6 16:08:30 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mips.c (md_begin): If mips_cpu is set, then use it as
+ the argument to bfd_set_arch_mach.
+ (load_address): Use bfd_arch_bits_per_address to determine the
+ bit size of an address instead of looking at the isa level.
+ (macro, macro2, s_cprestore, s_cpadd): Likewise.
+
+Thu Feb 5 12:39:08 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ehopt.c: New file.
+ * as.h (enum _relax_state): Add rs_cfa.
+ (check_eh_frame, eh_frame_estimate_size_before_relax): Declare.
+ (eh_frame_relax_frag, eh_frame_convert_frag): Declare.
+ * read.c (emit_expr): Call check_eh_frame.
+ * write.c (cvt_frag_to_fill): Handle rs_cfa.
+ (relax_segment): Likewise.
+ * Makefile.am: Rebuild dependencies.
+ (GAS_CFILES): Add ehopt.c.
+ (GENERIC_OBJS): Add ehopt.o.
+ * doc/internals.texi (Frags): Document rs_cfa.
+
+ * as.c (show_usage): Mention --traditional-format.
+ (parse_args): Accept --traditional-format.
+ * as.h (flag_traditional_format): Declare.
+ * output-file.c (output_file_create): If flag_traditional_format,
+ set BFD_TRADITIONAL_FORMAT on stdoutput.
+ * doc/as.texinfo, doc/as.1: Document --traditional-format.
+
+ * config/tc-mips.c (append_insn): Make sure that if we have a
+ fixup for an unmatched %hi reloc, it does not associated with a
+ variant frag.
+
+ * configure, Makefile.in, aclocal.m4: Rebuild with new libtool.
+ * doc/Makefile.in: Likewise.
+
+Wed Feb 4 15:41:54 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-m32r.c (check_for_side_effects): New function.
+ (can_make_parallel): Add checks for instruction side effects
+ clashing with the other instruction.
+ (assemble_parallel_insn): Improve warning messages. Return error
+ message from non-swapped instruction order.
+
+Wed Feb 4 20:00:26 1998 James G. Smith <jsmith@teknema.demon.co.uk>
+
+ * config/tc-arm.c: Rename arm_after_pass_hook() to arm_cleanup().
+
+ * config/tc-arm.h: Replace md_after_pass_hook definition with a
+ md_cleanup definition. This moves the forced literal output to
+ the end of the source pass, and avoids macro's inserting literals
+ into the code immediately after the macro expansion.
+
+Wed Feb 4 13:17:19 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sparc.h (tc_fix_adjustable) [OBJ_ELF]: A reloc against
+ a gas internal symbol is adjustable.
+ * config/tc-ppc.h (tc_fix_adjustable): Likewise.
+
+ * as.h: If gcc version greater than 2.6, use `__format__' and
+ `__printf__' in function attributes, rather than `format' and
+ `printf'.
+
+Mon Feb 2 18:38:18 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sparc.c: Only include elf/sparc.h if OBJ_ELF.
+
+Mon Feb 2 18:30:34 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
+
+ Add tms320c30 support:
+ * config/tc-tic30.h: New file.
+ * config/tc-tic30.c: New file.
+ * config/obj-coff.h: If TC_TIC30, include coff/tic30.h and define
+ TARGET_FORMAT as "coff-tic30".
+ * configure.in (tic30-*-*aout*, tic30-*-*coff*): New targets.
+ * Makefile.am: Rebuild dependencies.
+ (CPU_TYPES): Add tic30.
+ (CPU_OBJ_VALID): tic30-aout is valid.
+ (TARGET_CPU_CFILES): Add config/tc-tic30.c.
+ (TARGET_CPU_HFILES): Add config/tc-tic30.h.
+ * configure, Makefile.in: Rebuild.
+
+Mon Feb 2 10:20:37 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (md_assemble): Improvements to error messages
+ for PR 14720.
+
+Mon Feb 2 12:39:05 1998 Geoff Keating <geoffk@ozemail.com.au>
+
+ * config/tc-ppc.c (md_apply_fix3): Change BFD_RELOC_HI16 and
+ BFD_RELOC_HI16_S to store the high bits of any value.
+
+ * config/tc-ppc.h (tc_fix_adjustable): Undo change of Fri Jun 27.
+ (TC_RELOC_RTSYM_LOC_FIXUP): Don't let the
+ assembler calculate relocations to any external symbol at all.
+ * config/tc-ppc.c (md_apply_fix3) [OBJ_ELF]: Correct bugs
+ involving generation of pc-relative relocs.
+ (md_pcrel_from_section) [OBJ_ELF]: The job this code used to do
+ has been moved to md_apply_fix3.
+
+ * config/tc-ppc.c (md_apply_fix3): Fix test for too-far branch.
+ (ppc_elf_suffix): Warn about 'identifier+constant@got' syntax,
+ which actually means (the address of identifier's GOT entry) +
+ constant, which is not particularly useful.
+
+Fri Jan 30 11:02:35 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * read.h (include_dirs): Declare.
+ (include_dir_count,include_dir_maxlen): Declare.
+
+Fri Jan 30 11:47:02 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Correct check for shared opcodes library.
+ * configure: Rebuild.
+
+ * listing.c (buffer_line): If we can't open the file, set at_end.
+ (listing_print): Remove unused local variable fi.
+
+ * config/m68k-parse.y (reglistpair): Handle register list in
+ either order.
+
+ * config/vms-conf.h: Don't undef VERSION.
+
+Thu Jan 29 14:42:44 1998 Pat Rankin <rankin@eql.caltech.edu>
+
+ * Makefile.am (CONFIG_OBJS): New variable, containing part of old
+ OBJS variable.
+ (GENERIC_OBJS): New variable, with the rest of the old OBJS
+ variable.
+ (OBJS): Now just $(CONFIG_OBJS) and $(GENERIC_OBJS).
+ ($(srcdir)/make-gas.com): Rename from make-gas.com.
+ (stamp-mk.com): Replace $(OBJS) with $(GENERIC_OBJS).
+ (EXTRA_DIST): Define.
+ * vmsconf.sh: Handle {targ-cpu, obj-format, atof-targ} modules
+ explicitly rather than via the list of object files.
+ (gcc-as.opt): New file created when make-gas.com is run.
+ * config-gas.com: Create {targ-cpu.h, obj-format.h, targ-env.h,
+ itbl-cpu.h} to #include appropriate file rather than copying that
+ file.
+ * config/vms-conf.h: Synchronize with current config.in.
+ * Makefile.in: Rebuild.
+
+Wed Jan 28 14:35:00 1998 Bill Moyer <billm@cygnus.com>
+
+ * as.h (flag_warn_suppress_instructionswap): added new flag.
+ * tc-d10v.c (md_parse_option,md_longopts): added "--nowarnswap"
+ command line argument.
+ * tc-d10v.c (write_2_short): emit "Swapping instructions"
+ warning only if flag_warn_suppress_instructionswap is false.
+
+Wed Jan 28 16:41:19 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
+
+ * configure.in (i386-*-mingw32*): New target.
+ * configure: Rebuild.
+
+Wed Jan 28 14:51:18 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * symbols.c (resolve_symbol_value): Don't set the segment if it
+ hasn't changed, and this is OBJ_AOUT without BFD_ASSEMBLER.
+
+ * config/obj-aout.h (S_IS_LOCAL): Correct typo--pass argument to
+ S_GET_SEGMENT.
+
+Wed Jan 28 13:54:50 1998 Pat Rankin <rankin@eql.caltech.edu>
+
+ as.h (unlink): Reverse 13-Feb-97 change; use of unlink vs remove
+ depends upon HAVE_{UNLINK,REMOVE} values rather than host
+ compiler.
+
+Wed Jan 28 13:48:08 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.h (RESOLVE_SYMBOL_REDEFINITION): Define.
+
+Wed Jan 28 09:52:00 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (v850_insert_operand): Display instruction when
+ an error is encountered.
+
+Tue Jan 27 13:32:01 1998 Robert Lipe <robertl@dgii.com>
+
+ * configure.in (i386-*-sco3.2v5*): Defaults to ELF now.
+ (i386-*-sco3.2v5*coff): New target.
+ (i386-*-sco3.2*): New target.
+ * configure: Rebuild.
+
+Tue Jan 27 11:06:52 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c: Fix PRs 14721, 14722, 14723, tidying error
+ message production.
+
+Tue Jan 27 12:24:32 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-arm.c (md_apply_fix3): Add new variable newimm to hold
+ validate_immediate return value in the right type for comparisons
+ to FAIL.
+
+Tue Jan 27 06:51:59 1998 Richard Henderson <rth@cygnus.com>
+
+ * listing.c (MAX_BYTES): Use listing variables not constants.
+ (data_buffer): No longer an array, but a pointer.
+ (calc_hex): sizeof(data_buffer) -> MAX_BYTES.
+ (listing_listing): Allocate data_buffer.
+
+Tue Jan 27 06:38:35 1998 Richard Henderson <rth@cygnus.com>
+
+ * as.c (parse_args): Add --listing-lhs-width, --listing-lhs-width2,
+ --listing-rhs-width, --listing-cont-lines.
+ (show_usage): Update.
+ * listing.c (listing_lhs_width, listing_lhs_width_second): New vars.
+ (listing_lhs_cont_lines, listing_rhs_width): New vars.
+ (print_lines): Use the variables instead of the constants.
+ (listing_listing): Likewise.
+ * listing.h: Declare the new vars.
+
+Tue Jan 27 05:32:05 1998 Richard Henderson <rth@cygnus.com>
+
+ * as.c (parse_args): Add --keep-locals alias for -L.
+ Add --strip-local-absolute.
+ (show_usage): Update.
+ * as.h (flag_strip_local_absolute): New flag.
+ * symbols.c (S_IS_LOCAL): Use it.
+ * config/obj-aout.h (S_IS_LOCAL): Likewise.
+ * config/obj-bout.h (S_IS_LOCAL): Likewise.
+ * config/obj-coff.h (S_IS_LOCAL): Likewise.
+
+Mon Jan 26 13:07:41 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-m32r.c: Detect if explicitly parallel instructions
+ might have an io conflict and issue a warning message.
+
+Thu Jan 22 17:51:44 1998 Nick Clifton <nickc@cygnus.com>
+
+ * cgen.c (cgen_save_fixups, cgen_restore_fixups,
+ cgen_swap_fixups): Functions to save, restore and swap the fixup
+ chain with a backup copy.
+ (cgen_asm_finish_insn): Returns address of constructed insn.
+
+Wed Jan 21 16:49:10 1998 Richard Henderson <rth@cygnus.com>
+
+ * listing.c (file_info_struct): Remove FILE, add POS.
+ (last_open_file_info, last_open_file): New; a one entry FILE* cache.
+ (file_info): Don't open the file.
+ (buffer_line): Check for the file in the last_open cache, updating
+ as necessary.
+ (print_source): Don't reference file_info->file.
+ (listing_listing): Likewise.
+ (listing_print): Close the file in the cache, if any.
+
+Fri Jan 16 14:51:48 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * read.c (dwarf_file_string): New file static variable.
+ (emit_expr): Look for constant sequence that leads up to a file
+ name in DWARF debugging output.
+ (stringer): Use dwarf_file_string to decide whether to accept a
+ string as a file name.
+
+Fri Jan 16 11:30:37 1998 Richard Henderson <rth@cygnus.com>
+
+ * tc-m68k.c (m68k_ip): Remove absl->reglst MRI hack.
+ (crack_operand): Add reg->reglst MRI hack.
+ (r_seg): Put reglst symbols in reg_section.
+ (m68k_frob_symbol): Frob reglst symbols into absolute_section.
+
+Thu Jan 15 14:19:01 1998 Richard Henderson <rth@cygnus.com>
+
+ * tc-sh.c (get_specific): Handle SGR & DBR.
+
+Thu Jan 15 13:46:48 1998 Richard Henderson <rth@cygnus.com>
+
+ * tc-h8300.c (parse_reg): Take the length of the symbol into
+ account when attempting to match a register name.
+ * tc-h8500.c (parse_reg): Likewise.
+
+Wed Jan 14 17:52:33 1998 Nick Clifton <nickc@cygnus.com>
+
+ * cgen.c: Formatting changes to improve readability.
+
+Wed Jan 14 15:41:41 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mips.c (macro): Rework division code to avoid unfilled
+ delay slot.
+
+Wed Jan 14 15:02:19 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * config/tc-mips.c (mips_ip): Don't test pinfo flags if INSN_MACRO.
+
+Mon Jan 12 13:04:57 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen.c: #include setjmp.h. Clean up pass over `struct foo' usage.
+ (expr_jmp_buf): New static local.
+ (cgen_parse_operand): Allow use of longjmp in parsing to handle errors.
+ (cgen_md_operand): New function.
+ * tc-m32r.c: Clean up pass over `struct foo' usage.
+ (md_estimate_size_before_relax): Use CGEN_INSN_MNEMONIC.
+
+Tue Jan 6 15:36:02 1998 Richard Henderson <rth@cygnus.com>
+
+ * symbols.c (S_SET_SEGMENT): Don't set the segment for section syms.
+ (S_IS_EXTERNAL, S_IS_LOCAL): Correct parenthetication.
+
+Fri Jan 2 16:08:54 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-i386.c (i386_operand): Give an error if there are
+ unrecognized characters after an expression.
+
+Wed Dec 31 12:29:47 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mn10200.c (md_relax_table): Correct branch ranges.
+
+Mon Dec 22 13:06:05 1997 Joel Sherrill <joel@oarcorp.com>
+
+ * configure.in (i386*-go32-rtems*): Fix to be the same as
+ i[3456]86-go32.
+ * configure: Rebuild.
+
+Mon Dec 22 12:54:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (macro): The 4650 doesn't permit M_LDC1_AB,
+ M_SDC1_AB, M_L_DOB, M_L_DAB, M_S_DAB, or M_S_DOB.
+ (mips_ip): Always check for FP_D, not just for instructions that
+ are not part of the regular ISA.
+
+Thu Dec 18 16:49:28 1997 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-d10v.c (build_insn): Make `number' a long for 64-bit hosts.
+
+Thu Dec 18 16:42:57 1997 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-alpha.c (cpu_types): 21164pc/pca56 does not have CIX.
+
+Wed Dec 17 21:23:07 1997 Jeffrey A Law (law@cygnus.com)
+
+ * expr.c (integer_constant 32bit bignum): Mask off bits outside
+ the range we care about.
+
+Tue Dec 16 09:20:43 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-arm.c: Prevent use of interworking support for
+ non-COFF targets.
+
+Mon Dec 15 15:20:32 1997 Nick Clifton <nickc@cygnus.com>
+
+ * doc/all.texi: Add M32R cpu.
+
+ * doc/as.texinfo: Add documentation of m32r processor.
+
+ * doc/c-m32r.texi: New file, documenting m32r specific features.
+
+
+Mon Dec 15 10:32:28 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mips.c (mips_ip): Correctly insert 'P' operands into
+ the instruction.
+
+Fri Dec 12 10:35:01 1997 Nick Clifton <nickc@cygnus.com>
+
+ * doc/c-arm.texi (ARM Options): Document support for new ARM
+ processor names.
+
+ * config/tc-arm.c (md_parse_option): Add support for new ARM
+ processor names.
+
+Thu Dec 11 17:46:50 1997 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-m68k.c (m68k_ip): Don't overwrite opcode table data.
+ (insop, m68k_ip): Make `opcode' const so it doesn't happen again.
+
+Fri Dec 5 11:23:59 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (md_assemble): Fix BFD_RELOC_32 against a
+ symbol + offset.
+
+ * config/tc-v850.h (ELF_TC_SPECIAL_SECTIONS): Use
+ SHT_V850_{S|T|Z}COMMON to mark special common sections.
+
+Tue Dec 2 17:05:13 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c: Brought up to date with the branch.
+
+Mon Dec 1 20:24:18 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * config/tc-sh.c (SWITCH_TABLE_CONS): Handle (fix)->fx_size == 1.
+ (SWITCH_TABLE): Handle BFD_RELOC_8.
+ (md_apply_fix): #ifndef BFD_ASSEMBLER code: Handle fixP->fx_size == 1.
+ (coff_reloc_map): Add BFD_RELOC_8_PCREL entry.
+ (sh_coff_reloc_mangle): SWITCH_TABLE case: Handle BFD_RELOC_8.
+
+Sat Nov 22 16:19:22 1997 Richard Henderson <rth@cygnus.com>
+
+ * tc-alpha.c (range_signed_16, range_signed_32): Work around an
+ apparent bug in gcc's long long support crossing from x86.
+
+Sat Nov 22 14:26:09 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-arm.c: Brought up to date with latest changes on arm
+ branch.
+
+Sat Nov 22 15:50:09 1997 Klaus Kaempf <kkaempf@progis.de>
+
+ * config-gas.com: Get version info from configure.in.
+
+ * makefile.vms: include depend.obj in OBJS.
+
+ * config/tc-alpha.c (s_alpha_section): Remove ".lcomm" handling.
+
+ * config/tc-alpha.c (alpha_basereg_clobbered): Remove variable and
+ all corresponding code.
+
+Thu Nov 20 15:06:08 1997 Richard Earnshaw <rearnsha@arm.com>
+
+ * config/tc-arm.h (TARGET_FORMAT for generic a.out targets): Allow
+ run-time endian selection.
+
+Wed Nov 19 17:44:42 1997 Richard Henderson <rth@cygnus.com>
+
+ * tc-sh.c (parse_reg): Properly quote for fv4.
+
+Wed Nov 19 23:46:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * symbols.c (resolve_symbol_value): Add missing breaks in case on
+ symbol value operator.
+
+Tue Nov 18 18:45:14 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * config/tc-d10v.c (parallel_ok, find_opcode):
+ Split OPERAND_FLAG into OPERAND_FFLAG and OPERAND_CFLAG.
+
+Sun Nov 16 10:05:07 1997 Fred Fish <fnf@cygnus.com>
+
+ * config/obj-coff.c (fixup_segment): Cast second arg of
+ md_apply_fix3 call to type "valueT *".
+
+Thu Nov 13 13:53:10 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (emulations): Make FreeBSD an aout / i386bsd
+ variant.
+ * configure: Re-generate.
+
+Thu Nov 13 11:07:14 1997 Gavin Koch <gavin@cygnus.com>
+
+ * config/tc-mips.c (macro_build): Use the membership field
+ for INSN_MACRO's.
+ (mips_ip): Same.
+
+Thu Nov 13 02:04:55 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * config/tc-d10v.c (find_opcode): For OPCODE_FAKE, add check for
+ first argument if it's supposed to be a register.
+
+Tue Nov 11 19:25:05 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * app.c (do_scrub_chars): If d10v, re-insert a space before
+ a '#' when in state 10.
+
+Tue Nov 11 13:33:15 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-h8300.c: Include "subsegs.h".
+ (tc_reloc_mangle): Handle references to symbols which are not
+ being output, so that references to `.' work.
+
+Mon Nov 10 13:43:33 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-m68k.c (m68k_ip): Call add_fix when needed for '_'
+ case.
+
+ * macro.c (sub_actual): If we don't find a parameter for an &,
+ just substitute &.
+
+Fri Nov 7 21:29:32 1997 Ken Raeburn <raeburn@cygnus.com>
+
+ * config/tc-mips.c (mips_ip): In default case, call as_bad
+ instead of fprintf, to get "assembler messages:" message output
+ before instead of after.
+
+Fri Nov 7 10:36:22 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * frags.h: Handle multiple inclusion.
+
+Wed Nov 5 10:51:49 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ Based on a patch from Ian.Dall@dsto.defence.gov.au.
+ * as.h (struct frag, frag support): Moved from here.
+ * frags.h: To here.
+ (struct frag, member tc_frag_data): New member if TC_FRAG_TYPE
+ is defined.
+ (struct frag, member fr_cgen): Renamed from fr_targ.cgen.
+ * cgen.c (cgen_asm_finish_insn): Update.
+ * config/tc-m32r.c (md_estimate_size_before_relax): Update.
+ * config/tc-m32r.h (TC_FRAG_INIT): Renamed from md_init_frag.
+ (md_convert_frag): Ditto.
+ * config/tc-ns32k.h (TC_FRAG_TYPE): Define.
+ (frag_opcode_frag,frag_opcode_offset,frag_bsr): Update.
+ (TC_FRAG_INIT): Update.
+
+Tue Nov 4 16:35:57 1997 Ian Dall <Ian.Dall@dsto.defence.gov.au>
+
+ * write.c (print_fixup): Use TC_FIX_DATA_PRINT (if defined) to
+ print out MD fields of fix.
+ * frags.c (frag_var, frag_variant): Use TC_FRAG_INIT macro (if
+ defined) to initialize MD fields in frag.
+ * as.h (struct frag, ns32k support): Rename ns32k to fr_ns32k.
+ Delete pcrel_adjust. Add fr_opcode_fragP, fr_opcode_offset.
+ * config/tc-ns32k.h: Add comments. Remove obsolete
+ BFD_FAST_SECTION_FILL definition, change prototypes for
+ fix_new_ns32k and fix_new_ns32k_exp to add new arguments
+ opcode_frag and opcode_offset and remove pcrel_adjust.
+ (TC_FIX_TYPE): add opcode_fragP and opcode_offset fields.
+ (TC_FIX_DATA_PRINT): new macro to print out TC_FIX_TYPE.
+ (TC_FRAG_INIT): new macro to initialize machine dependent field in
+ frags.
+ (frag_opcode_frag, frag_opcode_offset, frag_bsr): macros to access
+ MD fields in frag structure.
+ (fix_im_disp, fix_bit_fixP, fix_opcode_frag, fix_opcode_offset,
+ fix_bsr): macros to access MD fields in fix structure.
+ * config/tc-ns32k.c: Avoid overlength lines. Align comments. Don't
+ use struct opcode_location as these fields are now in the frag
+ structure.
+ (convert_iif): Call frag_more as it is needed instead
+ of trying to allocate for the whole insn. Avoid call of frag_more
+ with negative argument.
+ (md_pcrel_adjust, md_fix_pcrel_adjust, md_apply_fix,
+ md_estimate_size_before_relax, md_pcrel_from,
+ tc_aout_fix_to_chars): use accessor macros to get md fields in fix
+ and frag structures.
+ (fix_new_ns32k, fix_new_ns32k_exp): add new arguments opcode_frag and
+ opcode_offset and remove pcrel_adjust.
+ (convert_iif, cons_fix_new_ns32k): call fix_new_ns32k,
+ fix_new_ns32k_exp with changed arguments.
+
+Mon Nov 3 13:30:17 1997 Gavin Koch <gavin@cygnus.com>
+
+ * tc-mips.c (md_begin): Reorganize setting of default values so
+ that mips_cpu depends on TARGET_CPU, and mips_opts.isa depends on
+ mips_cpu.
+ (md_parse_option): Remove all code that sets defaults; md_begin
+ handles all of this now.
+
+Sun Nov 2 14:46:09 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (STAGESTUFF): Change bin_PROGRAMS to
+ noinst_PROGRAMS.
+ (bootstrap, bootstrap2, bootstrap3): Likewise.
+ * Makefile.in: Rebuild.
+
+ * config/tc-ppc.c (ppc_fix_adjustable): Don't adjust relocs in the
+ TOC section to be against the csect.
+
+Fri Oct 31 18:19:55 1997 Ken Raeburn <raeburn@cygnus.com>
+
+ * config/tc-mips.c (validate_mips_insn): New function, checks
+ match versus mask bits, and also verifies that all bits to be
+ output are actually specified somewhere.
+ (md_begin): Call it for 32-bit instructions, instead of doing
+ match/mask check here. In case of failure, print a message, but
+ check the rest of the opcode table before exiting.
+
+Thu Oct 30 13:46:20 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-arm.c (md_apply_fix3): Fix thumb ADR pseudo op. Patch
+ from Tony Thompson at ARM: athompso@arm.com
+
+Fri Oct 24 15:56:47 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-ppc.c (md_assemble): When handling @l, always sign
+ extend if the operand expects a signed value.
+
+ * config/tc-mips.h (LOCAL_LABELS_DOLLAR): Don't define; use
+ default which is to permit dollar labels.
+
+Fri Oct 24 11:19:22 1997 Jakub Jelinek <jj@sunsite.mff.cuni.cz>
+
+ * config/tc-sparc.c (sparc_memory_model): New variable.
+ (md_longopts): Add -TSO/-PSO/-RMO options.
+ (md_parse_options): Handle them.
+ (sparc_elf_final_processing): For 64 ELF, set required
+ memory ordering in e_flags. Default to RMO and let the user
+ override it through command line.
+
+ * config/tc-sparc.h (elf_tc_final_processing): Add.
+
+Wed Oct 22 17:42:12 1997 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-sparc.c (v9a_asr_table): New variable.
+ (sparc_ip): Handle v9a asr's.
+ Patch from David Miller <davem@vger.rutgers.edu>.
+
+Wed Oct 22 17:22:59 1997 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-sparc.h (md_do_align): New macro.
+ * config/tc-sparc.c (sparc_handle_align): Handle rs_align_code.
+ Patch from Jakub Jelinek <jj@sunsite.mff.cuni.cz>.
+
+Wed Oct 22 12:51:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sh.c (sh_small): New variable.
+ (OPTION_SMALL): Define.
+ (md_longopts): Add "small".
+ (md_parse_option): Handle OPTION_SMALL.
+ (md_show_usage): Mention -small.
+ * config/tc-sh.h (sh_small): Declare.
+ (SUB_SEGMENT_ALIGN): Handle sh_small.
+ * config/obj-coff.h (TARGET_FORMAT): Check sh_small in TC_SH
+ case.
+
+ * config/tc-mips.c (macro): Correct handling of constant in M_LI_D
+ case in little endian mode.
+
+Tue Oct 21 10:20:11 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * config/tc-sparc.c (md_apply_fix3, cases ..._H44, ..._HIX22): Leave
+ overflow signalling to linker.
+
+Mon Oct 20 14:54:06 1997 Klaus K"ampf <kkaempf@progis.de>
+
+ * makefile.vms: Fix for dec c.
+
+ * config-gas.com: Give explanation for dec c setup in error
+ message.
+
+ * config/tc-alpha.c (s_alpha_comm): Make .comm symbols separate
+ sections on openvms/alpha.
+
+ * config/obj-evax.c: support .weak pseudo-op
+
+Mon Oct 20 10:13:32 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * config/tc-sparc.c (default_arch_size): New static local.
+ (struct sparc_arch): Rename arch_size to default_arch_size.
+ New member user_option_p.
+ (sparc_arch_table): Always include v9, v9a. New entry v9-64.
+ (init_default_arch): Check whether default arch is valid.
+ Set default_arch_size in addition to sparc_arch_size.
+ (OPTION_32,OPTION_64): Define.
+ (md_longopts): New entries for -32, -64.
+ (md_parse_option): Handle them.
+ (md_show_usage): Print them. Ensure init_default_arch called.
+ * configure.in (sparc64): Set arch to v9-64.
+ * configure: Regenerated.
+
+Sun Oct 19 13:50:50 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * write.c (subsegs_finish): New function, broken out of
+ write_object_file.
+ (write_object_file): Some code moves into subsegs_finish.
+ * write.c (subsegs_finish): Declare.
+ * as.c (main): Call subsegs_finish.
+
+ * read.c (s_include): Check for error return from
+ demand_copy_string.
+
+Tue Oct 14 20:50:58 1997 Richard Henderson <rth@cygnus.com>
+
+ * read.c (get_line_sb): Accept any eol marker while scanning macros.
+
+Tue Oct 14 19:12:45 1997 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-alpha.h (DIFF_EXPR_OK): Define.
+ * config/tc-i386.h (DIFF_EXPR_OK): Define.
+ * config/tc-alpha.c (md_apply_fix): Notice fx_pcrel and substitute
+ the correct relocation when it exists.
+ * config/tc-i386.c (md_apply_fix3): Likewise.
+
+ * config/tc-ppc.h: Correct typo in comment.
+ * config/tc-v850.h: Likewise.
+
+Fri Oct 10 16:09:35 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/tc-d10v.c (parallel_ok): Allow parallel instruction issue
+ when second instruction is writing to first instructions inputs.
+
+Mon Oct 13 15:27:17 1997 Richard Henderson <rth@cygnus.com>
+
+ * ecoff.c (PAGE_SIZE): Double to 8k as a hack to allow some C++
+ templated programs to build with -g.
+
+Fri Oct 10 17:48:29 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (md_relax_table): Add support for relaxing
+ unconditional branches. This patch is courtesy of Jim Wilson.
+ (md_convert_frag): Fix relaxing of branches. This patch is
+ courtesy of Jim Wilson.
+ (md_assemble): Create different fixups for conditional and
+ unconditional branches. This patch is courtesy of Jim Wilson.
+ (md_estimate_size_before_relax): Estimate size of variable part of
+ fixup based on whether it is for a conditional or an unconditional
+ branch. This patch is courtesy of Jim Wilson.
+ (v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss,
+ v850_zbss, v850_rosdata, v850_rozdata, v850_bss): Add call to
+ obj_elf_section_change_hook().
+ (v850_comm): New function.
+ (md_pseudo_table): Add new pseudo ops .zcomm, .scomm and .tcomm.
+ (md_begin): Add bss flag to seg_info of bss sections.
+
+ Add support for .scommon, .tcommon and .zcommon sections.
+
+ * config/tc-v850.h (ELF_TC_SPECIAL_SECTIONS): Add .scommon,
+ .zcommon, .tbss, .call_table_data and .call_table_text.
+
+Fri Oct 10 15:01:14 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.in (sparc): Set DEFAULT_ARCH from correct target.
+ * configure: Regenerated.
+
+Fri Oct 10 11:22:45 1997 Martin M. Hunt <hunt@cygnus.com>
+
+ * config/tc-d10v.c: Fixes to make sure the AT_WORD
+ expression is not confused with -1.
+
+Fri Oct 10 11:54:50 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/tc-d10v.c (parallel_ok): Flag SP as modified for @-sp
+ operand - OPERAND_ATMINUS.
+
+Fri Oct 10 00:47:44 1997 Michael Meissner <meissner@cygnus.com>
+
+ * config/tc-d10v.c (parallel_ok): Note that auto increment and
+ decrement modify the index register.
+
+Thu Oct 9 15:17:50 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Robin Kirkham <Robin.Kirkham@mlb.dmt.csiro.au>:
+ * config/tc-m68k.c (archs): Add 68306, 68307, 68322, 68356, 68334,
+ 68336, 68341, 68349.
+ * doc/c-m68k.texi (M68K-Opts): Add -m68ec000 -m68hc000 -m68hc001
+ -m68306, -m68307, -m68322, -m68356, -m68ec020, -m68ec030,
+ -m68ec040, -m68ec060, -m68330, -m68334, -m68336, -m68341,
+ -m68349.
+
+ * doc/Makefile.am (CPU_DOCS): Define.
+ (as.info): Depend upon $(CPU_DOCS).
+ * doc/Makefile.in: Rebuild.
+
+ * configure.in: Remove AM_PROG_INSTALL; it's called by
+ AM_INIT_AUTOMAKE.
+ * configure: Rebuild.
+
+Thu Oct 9 01:44:36 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * tc-d10v.h (TC_START_LABEL): Don't define.
+ (tc_frob_label): Define.
+
+Thu Oct 9 00:07:23 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * config/tc-d10v.c (write_2_short): Fix bug that wouldn't allow
+ to pair a branch and link with anything but an exe instruction.
+
+Wed Oct 8 16:28:53 1997 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-alpha.c (load_expression): Disable the sym+const .got
+ optimization to reduce the alignment surprises for gcc.
+
+Wed Oct 8 16:11:15 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/obj-coff.h (TC_SPARC): Don't define TARGET_FORMAT.
+ * config/tc-sparc.c (sparc_target_format): Handle coff here.
+ (sparc_ip): Add %hix,%lox.
+ (md_apply_fix3): Call as_bad_where, not as_bad.
+ Add support for BFD_RELOC_SPARC_{HIX22,LOX10}.
+ (tc_gen_reloc): Add support for BFD_RELOC_SPARC_{HIX22,LOX10}.
+
+Wed Oct 8 12:33:32 1997 Richard Henderson <rth@cygnus.com>
+
+ * configure.in: Change alpha-*-* to alpha*-*-*; config.guess now
+ recognizes alphaev5 etc.
+ * configure: Rebuild.
+
+Wed Oct 8 00:04:05 1997 Gavin Koch <gavin@cygnus.com>
+
+ * config/tc-mips.c (md_begin): Replace the TARGET_CPU value
+ of mipsr3900 with mipstx39.
+
+ * config/tc-mips.c (mips_ip): Don't print the 'opcode requires
+ -mipsXX message' if the insn isn't an ISA insn.
+
+Tue Oct 7 12:48:30 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/tc-sparc.h (TARGET_FORMAT support): Moved to tc-sparc.c.
+ Redefine TARGET_FORMAT to call sparc_target_format.
+ * config/tc-sparc.c (in_unsigned_range): New function.
+ (sparc_arch_size): Make static.
+ (sparc_target_format): New function.
+ (sparc_ip): Delete variable immediate_max. Rewrite %hi/etc reloc
+ handling. Add support for %hh,%hm,%lm,%h44,%m44,%l44.
+ (output_insn): Set `fx_no_overflow'.
+ (md_apply_fix3): Handle BFD_RELOC_SPARC_{7,H44,M44,L44}.
+ (tc_gen_reloc): Likewise.
+
+Mon Oct 6 14:04:50 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (v850_section): Remove.
+
+ * config/obj-elf.c (obj_elf_section): Enhance error message.
+
+Fri Oct 3 15:40:38 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c: Undef OBJ_COPY_SYMBOL_ATTRIBUTES before
+ including obj-elf.h in OBJ_MAYBE_ELF case.
+ (mips_target_format): Return NULL after abort to avoid warning.
+
+ * ecoff.c (generate_ecoff_stab): Remove unused static function.
+
+ * expr.c (operator): Accept ==. From Anders Blomdell
+ <anders.blomdell@control.lth.se>.
+
+ * config/atof-ieee.c (gen_to_words): When generating a denormal
+ number, handle an overflow into the smallest normalized number.
+
+Mon Sep 29 15:24:52 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * as.h, input-scrub.c (new_logical_line): New return value.
+ * read.c (s_app_file): Don't note the same file several times
+ in a row.
+
+Thu Sep 25 13:08:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-m68k.c (m68k_ip): Remove ` operand specifier.
+
+Wed Sep 24 16:54:40 1997 Joel Sherrill <joel@oarcorp.com>
+
+ * configure.in (sh*-*-rtems*): New target, like sh-*-elf*.
+ * configure: Rebuild.
+
+Wed Sep 24 11:30:25 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-m68k.c (m68k_ip): Handle q and v operand specifiers.
+
+ * doc/c-i386.texi (i386-Float): Remove incorrect assertion that
+ fn* instructions do not insert implicit fwait. This was changed
+ Jan 29, 1996.
+
+ * config/m68k-parse.y (yylex): Permit an expression to be used for
+ the scale factor.
+
+ * Makefile.am (EXTRA_as_new_SOURCES): Set to config/m68k-parse.y,
+ not m68k-parse.y.
+ * Makefile.in: Rebuild.
+
+ * aclocal.m4: Rebuild with new libtool.
+ * configure: Rebuild.
+
+Tue Sep 23 17:48:09 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * app.c (do_scrub_chars): Clear mri_state at end of .mri
+ pseudo-op.
+
+ * config/tc-mips.c (hilo_interlocks): Change from a static
+ variable to a macro, so that it varies with the variables upon
+ which it depends.
+ (gpr_interlocks, cop_interlocks): Likewise.
+ (md_begin): Don't initialize them.
+
+Fri Sep 19 17:08:41 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mn10300.c (md_assemble): Use strcasecomp instead
+ of strcmp where appropriate.
+
+Thu Sep 18 14:11:56 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (md_assemble): Cope with a zero data area
+ relocation with a constant offset.
+ (md_assemble): Produce error message when special data area
+ relocations are used on instructions which do not support them.
+ (md_assemble): Reset processor mask if defined by command line
+ switch.
+
+Thu Sep 18 11:24:01 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/tc-sparc.c: Reorganize file.
+ (parse_keyword_arg): Allow numbers in reg names.
+ (SPECIAL_CASE_NONE): New macro.
+ (md_assemble): Use it.
+ (lookup_arch,init_default_arch): New functions.
+ (default_arch,default_init_p,sparc_arch_table): New static locals.
+ (sparc_arch_size): New static local.
+ (max_architecture): Initialize in init_default_arch.
+ (md_parse_options): Call init_default_arch if necessary.
+ Rewrite -xarch/-A processing.
+ (md_show_usage): Print -A values from sparc_arch_table.
+ (md_begin): Call init_default_arch if necessary.
+ (sparc_md_end): Handle both 32 and 64 bit environments.
+ * config/tc-sparc.h (TARGET_FORMAT): Likewise.
+ * acconfig.h (SPARC_V9,SPARC_ARCH64): Delete.
+ (DEFAULT_ARCH): Add.
+ * config.in: Regenerate.
+ * configure.in (sparc): Default DEFAULT_ARCH based on target cpu.
+ (SPARC_V9,SPARC_ARCH64): Delete.
+ * configure: Regenerate.
+ * config/vms-conf.h (SPARC_V9,SPARC_ARCH64): Delete.
+
+Wed Sep 17 16:54:20 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (v850_reloc_prefix): Recoded to use CHECK_ ()
+ macro.
+ (handle_tdaoff, handle_zdaoff, handle_sdaoff): New functions.
+
+Tue Sep 16 14:18:22 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (v850_reloc_prefix): Add support for a 16 bit
+ displacement from the tiny data area pointer.
+
+Mon Sep 15 21:28:09 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-hppa.c (fix_new_hppa): Make declaration match
+ definition.
+
+Mon Sep 15 18:33:06 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (processor_mask): New variable.
+ (set_machine, md_parse_option): Set processor_mask.
+ (md_assemble): Check that instruction is available to target
+ processor.
+
+ * config/tc-v850.h (TARGET_PROCESSOR): New constant.
+
+Wed Sep 10 10:07:08 1997 Nick Clifton <nickc@cygnus.com>
+
+ * configure.in (emulations): Add v850 emulation.
+
+Tue Sep 9 17:14:33 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.am (CPU_TYPES): Add arc.
+ (TARGET_CPU_CFILES): Add tc-arc.c.
+ (TARGET_CPU_HFILES): Add tc-arc.h.
+ (dependencies): Rebuild.
+ * Makefile.in: Rebuild.
+ * configure.in: Recognize arc-*-elf*.
+ * configure: Regenerated.
+ * config/tc-arc.[ch]: New files.
+
+Tue Sep 9 10:19:37 1997 Nick Clifton <nickc@cygnus.com>
+
+ * doc/c-v850.texi (V850 Opcodes): Document hi0() reloc prefix.
+ Correct description of hi() reloc prefix.
+
+
+ * doc/c-v850.texi: Document new pseudo ops and command line
+ options.
+
+ * config/tc-v850.c (set_machine): New function.
+ * config/tc-v850.c (.v850): New pseudo op.
+
+
+Mon Sep 8 23:08:04 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ Support -alh and -ald for DWARF 1:
+ * listing.c (struct list_info_struct): Add debugging field.
+ (listing_newline): Initialize the debugging field. If ELF, if the
+ section starts with .debug or .line, set the debugging field in
+ the listing structure.
+ (debugging_pseudo): Add list parameter. Change all callers. If
+ the debugging field is set, consider it to be a debugging pseudo.
+ If ELF, skip blank lines between debugging lines.
+ * read.c (emit_expr): If ELF, look for line numbers.
+ (stringer): If ELF, look for file names.
+
+Mon Sep 8 12:33:40 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (v850_insert_operand): Only test for overflow
+ if there is no insert function.
+
+ * config/tc-v850.h (TARGET_MACHINE): New constant.
+
+ * config/tc-v850.c (v850_insert_operand): Add
+ -mwarn_unsigned_overflow.
+ (md_begin): Set BFD machine number based on machine variable.
+ (md_parse_option): Add -mv850, -mv850e and -mv850ea options.
+
+Mon Sep 8 11:20:46 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * as.h: Don't declare alloca if it is a macro.
+ * macro.c: Likewise.
+
+Sun Sep 7 00:30:19 1997 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-alpha.c (md_parse_option): Move m[] out to top level and
+ rename to cpu_types[].
+ (s_alpha_arch): New function.
+ (md_pseudo_table): Add "arch".
+
+ * config/tc-alpha.c (md_begin): Merge the two loops through the
+ opcode table.
+ (s_alpha_proc): Add initial SKIP_WHITESPACE.
+ (s_alpha_set): Likewise. Use get_symbol_end instead local while loop.
+
+Sat Sep 6 19:38:12 1997 Fred Fish <fnf@cygnus.com>
+
+ * read.h (s_lcomm_bytes): Add prototype (for real this time).
+
+Thu Sep 4 12:10:01 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-elf.c (elf_frob_symbol): Only set BSF_OBJECT for
+ symbols on Irix.
+
+Wed Sep 3 11:21:33 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c: Remove BFD_RELOC_V850_16_PCREL.
+
+Tue Sep 2 18:32:30 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mn10200.c (md_convert_frag): PC relative instructions arex
+ relative to the next instruction, not the current instruction.
+ (md_assemble): Similarly.
+
+Tue Sep 2 15:58:52 1997 Nick Clifton <nickc@cygnus.com>
+
+ * doc/c-v850.texi: Explanations of offsets in SDA/ZDA areas
+ correcetd.
+
+ * config/tc-v850.c: Add support for SDA/TDA/ZDA sections.
+ (v850_reloc_prefix): Duplicate code eliminated. Add code to
+ recognise special instructions.
+ (md_assemble): Calculation of the size of a fixups corrected.
+
+ * config/tc-v850.h (ELF_TC_SPECIAL_SECTIONS): Add SDA/TDA/ZDA
+ sections.
+
+Tue Sep 2 15:40:56 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/tc-v850.c (md_assemble): Use opcode->name instead of
+ opcode->opcode as the sentinal. Zero is a valid opcode.
+
+Tue Aug 26 16:51:14 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * doc/as.texinfo (Machine Dependencies): Add v850 to menu.
+ * doc/c-v850.texi: Change node name to match other chapter nodes.
+
+Tue Aug 26 09:46:22 1997 Nick Clifton <nickc@cygnus.com>
+
+ * doc/c-v850.texi (V850 Opcodes): Correct name for tiny data area
+ pointer.
+
+Tue Aug 26 12:23:25 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * expr.c (integer_constant): If BFD64, don't make a bignum if the
+ number will fit in 64 bits.
+
+ * config/tc-alpha.c (load_expression): Check explicitly for O_big,
+ rather than calling abort.
+
+ * as.h: Don't define alloca if __GNUC__. Just declare it.
+ * macro.c: Copy alloca handling from as.h.
+
+ * config/tc-i386.c (i386_align_code): Correct 16 bit noops. From
+ Gabriel Paubert <paubert@iram.es>.
+
+ * config/tc-i386.c (md_assemble): In JumpByte case, when looking
+ for a WORD_PREFIX_OPCODE, change it to ADDR_PREFIX_OPCODE if this
+ is jcxz or a loop instruction.
+
+Mon Aug 25 16:04:14 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (pre_defined_registers): Add 'hp' as alias for
+ r2.
+ (md_begin): Set up machine architecture and type.
+
+Mon Aug 25 14:25:48 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * symbols.c (resolve_symbol_value): Store the value back into the
+ symbol expression, to handle add or subtract simplification
+ correctly. Handle O_symbol_rva. Add default case.
+
+ * config/tc-ppc.c (ppc_change_csect): Temporarily lower the
+ chunksize while creating the new subsection.
+ * as.c (chunksize): Initialize to zero.
+ * subsegs.c (subseg_set_rest): Change 5000 to chunksize when
+ calling obstack_begin.
+
+Mon Aug 25 11:21:48 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (md_assemble): Restore input_line_pointer upon
+ exit.
+
+
+Mon Aug 25 10:19:34 1997 Nick Clifton <nickc@cygnus.com>
+
+ * doc/c-v850.texi: Change the major node to v850 Machine
+ Dependencies.
+
+Fri Aug 22 11:16:14 1997 Nick Clifton <nickc@cygnus.com>
+
+ * doc/as.texinfo: Add inclusion of c-v850.texi
+
+ * doc/c-v850.texi: New file.
+
+ * read.c (is_end_of_line): Make NUL character be considered to be
+ a line terminator.
+
+Fri Aug 22 10:45:33 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (parse_register_list): Add support for curly
+ brace syntax.
+ (cc_names): Add "e" and "ne" conditions.
+
+Thu Aug 21 11:00:36 1997 Nick Clifton <nickc@cygnus.com>
+
+ * app.c (do_scrub_chars): Support a double dash as starting a
+ comment that extends to end of line.
+
+Thu Aug 21 10:54:27 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (v850_section, v850_bss, v850_offset): New
+ functions.
+ (md_pseudo_table): New pseudo ops: .bss, .offset, .section
+
+Thu Aug 21 00:59:53 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/tc-m32r.c (md_estimate_size_before_relax): Update recorded
+ insn when changing to a different instruction.
+
+Wed Aug 20 00:45:20 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * tc-sh.c (parse_reg, get_specific, build_Mytes): Add SH4
+ floating point extensions.
+ (parse_reg): parse sgr and dbr.
+
+Tue Aug 19 17:07:34 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (system_register_name): Support numbers for
+ system register IDs.
+
+Tue Aug 19 08:59:12 1997 Fred Fish <fnf@cygnus.com>
+
+ * read.c (s_lcomm_internal): Renamed from s_lcomm, added arg to
+ flag when alignment is in bytes instead of power of 2, and code to
+ use that flag to convert alignment to bytes.
+ (s_lcomm, s_lcomm_bytes): New helpers that call s_lcomm_internal.
+ * read.h (s_lcomm_bytes): Add prototype.
+ * config/obj-coff.c (write_object_file): If ALIGNMENT_IN_S_FLAGS is
+ defined, write alignment to alignment bits in section header s_flags
+ rather than the s_align field.
+
+Mon Aug 18 20:42:23 1997 Richard Henderson <rth@cygnus.com>
+
+ * macro.c (check_macro): use alloca instead of xmalloc to plug leak.
+
+Mon Aug 18 20:33:06 1997 Richard Henderson <rth@cygnus.com>
+
+ * as.c (show_usage): Add -am.
+ * input-scrub.c (input_scrub_include_sb): Don't add leading \n
+ if we've already got one.
+ * listing.c (struct list_info_struct): Add line_contents.
+ (listing_newline): Put unused argument to work: if non-null, save it...
+ (listing_listing): ... and regurgitate during listing instead of line
+ from file.
+ * listing.h (LISTING_MACEXP): New define.
+ (LISTING_NEWLINE): Argument is NULL.
+ * read.c (read_a_source_file): If expanding macros, break up input
+ lines and pass them to listing_newline.
+ * doc/as.texinfo: Document -ac and -am.
+
+ * cond.c (s_ifc): Add missing demand_empty_rest_of_line.
+
+Mon Aug 18 11:26:36 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-v850.c (md_apply_fix3): Add support for new 16 bit PC
+ relative reloc.
+
+
+Fri Aug 15 14:00:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (check-DEJAGNU): Don't cd into testsuite until after
+ setting EXPECT and TCL_LIBRARY.
+ * Makefile.in: Rebuild.
+
+ * as.h (enum debug_info_type): Define.
+ (debug_type): Declare.
+ * as.c (debug_type): New global variable.
+ (show_usage): Add --gstabs.
+ (parse_args): Handle --gstabs.
+ * read.c (generate_asm_lineno): Remove.
+ (read_a_source_file): Output stabs debugging if appropriate.
+ Change checks of generate_asm_lineno to check debug_type. Only
+ generate ECOFF debugging if ECOFF_DEBUGGING is defined.
+ * read.h (generate_asm_lineno): Don't declare.
+ (stabs_generate_asm_lineno): Declare.
+ * stabs.c (stabs_generate_asm_lineno): New function.
+ * ecoff.c (add_file): Use debug_type, not generate_asm_lineno.
+ Don't turn off debugging.
+ (add_file): Remove old #if 0 code.
+ (ecoff_new_file): Set debug_type, not generate_asm_lineno.
+ (ecoff_directive_end): Don't generate stabs line symbols.
+ (ecoff_generate_asm_lineno): Don't check stabs_seen. Don't set
+ generate_asm_lineno.
+ (line_label_cnt): Remove.
+ (ecoff_generate_asm_line_stab): Remove.
+ * ecoff.h (ecoff_generate_asm_line_stab): Don't declare.
+ * doc/as.texinfo, doc/as.1: Document --gstabs.
+
+Wed Aug 13 18:58:56 1997 Nick Clifton <nickc@cygnus.com>
+
+
+ * config/tc-v850.c (md_assemble): Fix error recovery to reload
+ text of entire opcode.
+
+Tue Aug 12 10:27:34 1997 Richard Henderson <rth@cygnus.com>
+
+ * doc/internals.texi: Document rs_leb128.
+
+Tue Aug 12 12:17:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-m68k.c (m68k_ip): Give an error message for SIZE_BYTE
+ in ABSL case, rather than calling abort.
+
+Mon Aug 11 21:48:00 1997 Richard Henderson <rth@cygnus.com>
+
+ * as.h (enum _relax_state): Add rs_leb128.
+ * read.c (potable): Add sleb128 and uleb128.
+ (sizeof_*leb128, output_*leb128, emit_leb128_expr, s_leb128): New
+ functions.
+ * read.h: Update prototypes.
+ * symbols.c (resolve_symbol_value): Streamline quite a bit. Return
+ the symbol value, add a second FINALIZE argument that prevents
+ changes from being comitted. Update all callers.
+ * write.c (cvt_frag_to_fill, relax_segment): Handle rs_leb128.
+ * doc/as.texinfo: Document the new pseudos.
+
+Sun Aug 10 14:51:49 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (MOSTLYCLEANFILES): Add site.bak, site.exp, stage,
+ stage1, and stage2.
+ (DISTCLEANFILES): Define.
+ * doc/Makefile.am (DISTCLEANFILES): Define.
+ * Makefile.in, doc/Makefile.in: Rebuild.
+
+Wed Aug 6 00:30:30 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Define TARGET_BYTES_BIG_ENDIAN if endian is set.
+ Don't set targ or gas_target. Define SCO_ELF and
+ TARGET_SOLARIS_COMMENT when appropriate. Don't substitute for
+ target_frag.
+ * Makefile.am: Remove @target_frag@.
+ (INCLUDES): Remove $(INTERNAL_CFLAGS), $(CROSS), $(HDEFINES), and
+ $(TDEFINES).
+ (dep-am): Mark as phony.
+ * acconfig.h: Add TARGET_BYTES_BIG_ENDIAN, TARGET_SOLARIS_COMMENT,
+ and SCO_ELF.
+ * config/arm-big.mt, config/arm-lit.mt: Remove.
+ * config/mips-big.mt, config/mips-lit.mt: Remove.
+ * config/ppc-big.mt, config/ppc-lit.mt: Remove.
+ * config/ppc-sol.mt: Remove.
+ * config/i386coff.mt, config/m68kcoff.mt: Remove.
+ * config/m88kcoff.mt: Remove.
+ * config/sco5.mt: Remove.
+ * configure, config.in, Makefile.in: Rebuild.
+
+ * Makefile.am ($(srcdir)/config/m68k-parse.h): New target, to
+ further try to circumvent the .y.h rule.
+ * Makefile.in: Rebuild.
+
+Tue Aug 5 12:32:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: New file, based on old Makefile.in.
+ * acinclude.m4: New file, from old aclocal.m4.
+ * configure.in: Call AM_INIT_AUTOMAKE and AM_PROG_LIBTOOL. Remove
+ shared library handling; now handled by libtool. Replace
+ AC_CONFIG_HEADER with AM_CONFIG_HEADER. Call AC_PROG_YACC,
+ AC_PROG_LEX, and AC_DECL_YYTEXT. Call AM_MAINTAINER_MODE,
+ AM_CYGWIN32, and AM_EXEEXT. Don't call CY_CYGWIN32 or CY_EXEEXT.
+ * config.in: New file, created by autoheader.
+ * conf.in: Remove.
+ * acconfig.h: Mention PACKAGE, VERSION, and USING_CGEN.
+ * stamp-h.in: New file.
+ * as.c (print_version_id): Change GAS_VERSION to VERSION.
+ (parse_args): Likewise.
+ * config/obj-vms.c: (Write_VMS_MHD_Records): Likewise.
+ * doc/Makefile.am: New file, based on old doc/Makefile.in.
+ * Makefile.in, doc/Makefile.in: Now built with automake.
+ * aclocal.m4: Now built with aclocal.
+ * configure: Rebuild.
+
+ * cond.c (s_else): If not listing false conditionals, turn listing
+ off in the false branch of the else.
+
+Mon Aug 4 11:28:35 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (macro): Fix handling of a double load from a
+ symbol plus an offset.
+
+ * ecoff.c (ecoff_build_symbols): Set fMerge to 0 for an FDR which
+ has an associated external symbol.
+
+Sun Aug 3 23:23:59 1997 Richard Henderson <rth@cygnus.com>
+
+ * config/tc-alpha.c (s_alpha_ucons): New function.
+ (md_pseudo_table): Add unaligned data pseudos for DWARF.
+
+Thu Jul 31 15:13:43 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_assemble): Ignore the rest of the current
+ line if we encounter an error.
+
+ * config/tc-v850.c (md_assemble): Sign extend constants value
+ for hi and hi0 expressions.
+ (v850_insert_operand): Enable range checking for generic 16bit
+ operands.
+
+Tue Jul 29 14:20:43 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_assemble): Turn on fx_no_overflow for
+ LO16, HI16 and HI16_S relocs.
+
+Mon Jul 28 18:41:41 1997 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * configure.in: Use CYGWIN and EXEEXT autoconf macro to look for
+ win32 dependencies.
+ * configure: Regenerated with autoconf 2.12.
+ * Makefile.in: Add $(EXEEXT) to all executables.
+
+Fri Jul 25 10:54:43 1997 Jeffrey A Law (law@cygnus.com)
+
+ * tc-hppa.c (md_apply_fix): Improve warnings for out of range
+ unconditional branches.
+ (hppa_fix_adjustable): Don't adjust anything with a RR% or LR%
+ field selector.
+
+Thu Jul 24 15:21:49 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * tc-sparc.c (md_begin): Cast sparc_opcodes to PTR for hash_insert.
+
+Thu Jul 24 17:51:29 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * macro.c (define_macro): Make sure the index is in range before
+ checking for '('.
+
+Tue Jul 22 18:38:56 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * config/te-go32.h (USE_ALIGN_PTWO): Define.
+ * config/tc-i386.c (md_pseudo_table): If USE_ALIGN_PTWO is
+ defined, use s_align_ptwo for .align.
+ * configure.in (i386-*-msdosdjgpp*): New target.
+ (i386-*-go32*): Set em to go32 and targ to coffgo32.
+ * configure: Rebuild.
+
+Tue Jul 22 12:41:40 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/tc-sparc.c (last_opcode): New static local.
+ (md_assemble): Don't issue "FP branch in delay slot" warning if
+ the delay slot has been annulled.
+
+Tue Jul 22 13:25:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-m68k.c (md_apply_fix_2): Check for PC relative reloc
+ code if BFD_ASSEMBLER.
+
+Mon Jul 21 08:57:17 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (system_registers): Fix ordering of registers.
+
+Mon Jul 14 23:10:58 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (macro_build): Restore check of fmt argument.
+ (mips_ip): Fix ISA checks.
+
+Sun Jul 13 20:43:46 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (check_absolute_expr): Change warning to
+ error.
+
+Fri Jul 11 10:18:47 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mips.c (macro_build): Refine code to check if an
+ instruction is available on a particular cpu variant.
+ (mips_ip): Likewise.
+
+Mon Jul 7 22:53:08 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-i386.c (tc_i386_fix_adjustable): Change ifndef
+ OBJ_AOUT to ifdef OBJ_ELF.
+ (md_apply_fix3): When mangling 32 bit PC relative reloc for
+ BFD_ASSEMBLER, handle one ELF case for COFF as well, and add a PE
+ case.
+ * write.c (fixup_segment): Change special case for i386-coff to
+ not apply for i386-pe.
+ * config/obj-coff.c (coff_adjust_section_syms): Only count fixups
+ which were not done.
+ (coff_frob_file_after_relocs): Rename from coff_frob_file.
+ (coff_format_ops): Initialize frob_file_after_relocs field rather
+ than frob_file field.
+ * config/obj-coff.h (coff_frob_file): Don't declare.
+ (coff_frob_file_after_relocs): Declare.
+ (obj_frob_file): Don't define.
+ (obj_frob_file_after_relocs): Define.
+ * configure.in: Set bfd_gas to yes for i386-*-cygwin32.
+ * configure: Rebuild.
+
+Wed Jul 2 12:05:00 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.c (fixup_segment): Never subtract section
+ address from PC relative reloc which will be fully resolved.
+
+Tue Jul 1 15:23:07 1997 Jeffrey A Law (law@cygnus.com)
+
+ * ecoff.c (page_type): Renamed from page_t to avoid conflict
+ with hpux10 header files.
+
+Mon Jun 30 12:27:28 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Jason Merrill <jason@cygnus.com>:
+ * read.c (do_align): If BFD_ASSEMBLER, only use NOP_OPCODE if
+ SEC_CODE is set.
+ * config/tc-i386.h (md_maybe_text): Define.
+ (md_do_align): Use md_maybe_text.
+
+Fri Jun 27 19:15:27 1997 Michael Meissner <meissner@cygnus.com>
+
+ * config/tc-ppc.h (tc_fix_adjustable): Only check for GOT type
+ relocations, don't check for symbol being external, weak, etc.
+
+Mon Jun 16 19:12:51 1997 Geoff Keating <geoffk@ozemail.com.au>
+
+ * config/tc-ppc.h (tc_fix_adjustable): Don't let the assembler
+ calculate relocations to any external symbol, because we might be
+ linking a shared object and the symbol might be overriden or moved
+ (for instance, moved into a static executable's .bss section).
+ (GLOBAL_OFFSET_TABLE_NAME): Delete. This is an i386 wierdness.
+
+ * config/tc-ppc.h (tc_fix_adjustable): GOT-based relocations can't
+ be calculated by the assembler.
+
+ * config/tc-ppc.c (md_apply_fix3): Handle @plt or @local branch
+ whose destination lies in the same file, by ignoring the @plt or
+ @local and aiming the branch at its destination.
+
+Mon Jun 16 13:59:18 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * symbols.c (copy_symbol_attributes): Copy BSF_OBJECT flag.
+ * config/obj-elf.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Copy size
+ expression.
+
+ * config/obj-multi.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Define instead
+ of obj_copy_symbol_attributes.
+
+Mon Jun 16 12:45:56 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-ppc.c (ppc_insert_operand): In 32 bit mode, with a
+ signed operand, sign extend a 32 bit value to the host size.
+
+ * Makefile.in (CFLAGS): Subsitute from configure script. From
+ Jeff Makey <jeff@cts.com>.
+
+ * config/tc-i386.c (i386_operand): Use alloca rather than a fixed
+ buffer size to make a copy of the symbol.
+
+ * Makefile.in (OBJS): Put @extra_objects@ on the same line as
+ macro.o.
+
+Thu Jun 12 12:16:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * write.c (write_object_file): In non BFD_ASSEMBLER code, as we
+ step through the frags calling cvt_frag_to_fill, switch to
+ SEG_DATA when we reach data_frag_root.
+
+Tue Jun 10 17:08:34 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mn10300.c (md_assemble): Allow an empty register
+ list for instructions which use register lists.
+
+Tue Jun 10 11:18:09 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * config/tc-arm.c (md_apply_fix3): Make temp unsigned long.
+
+ * config/tc-arm.c (arm_adjust_symtab): Only set storage classes if
+ OBJ_COFF.
+
+ * config/tc-arm.c: Add prototypes for many static functions.
+ (struct asm_opcode ): Add prototypes for parms field.
+ (struct thumb_opcode ): Likewise.
+ (fp_op2): Remove unused flags parameter.
+ (output_inst): Make static.
+ (arm_after_pass_hook): Remove unused ignore parameter.
+ * config/tc-arm.h (arm_after_pass_hook): Declare.
+ (arm_start_line_hook): Declare.
+ (arm_frob_label): Declare.
+
+Mon Jun 9 12:55:45 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * depend.c (wrap_output): new prototype.
+
+Mon Jun 9 12:52:44 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sh.c (md_apply_fix): Check for overflow.
+
+ * config/tc-m68k.c (md_section_align): If a.out and BFD, force
+ section size to be aligned.
+
+Fri Jun 6 17:15:55 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-sh.h (md_cons_align): Define.
+ (sh_cons_align): Declare.
+ * config/tc-sh.c (md_pseudo_table): Add .uaword and .ualong.
+ (sh_no_align_cons): New static variable.
+ (s_uacons): New static function.
+ (sh_cons_align): New function.
+ (sh_handle_align): Warn about misaligned data.
+ * doc/c-sh.texi: Document .uaword and .ualong.
+
+Thu Jun 5 15:38:17 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * macro.c (macro_expand): In MRI mode, treat single quote as a
+ separator character when checking for a positional argument.
+
+Tue Jun 3 16:15:13 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-arm.c (md_parse_option): Merge in changes from
+ armT-970328-branch.
+
+ * config/tc-arm.h: Merge in changes from armT-970328-branch.
+
+ * configure.in (emulations): Add Thumb architecture support from
+ armT-9703-28-branch.
+
+Mon Jun 2 16:25:07 1997 Nick Clifton <nickc@cygnus.com>
+
+ * doc/all.texi: Add enabling of ARM documentation.
+
+ * doc/as.texinfo: Add ARM documentation from armT-970328-branch.
+
+Mon Jun 2 11:55:12 1997 Gavin Koch <gavin@cygnus.com>
+
+ * config/tc-mips.c: Added r3900 support.
+
+Thu May 29 12:58:26 1997 Ben Pfaff <pfaffben@pilot.msu.edu>
+
+ * as.c: (parse_args) `-t' option requires an argument.
+
+Wed May 28 15:45:07 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-arm.c (md_begin): Change call to
+ coff_arm_bfd_set_private_flags() to a call to
+ bfd_set_private_flags().
+
+Wed May 28 16:17:34 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Rebuild dependencies.
+
+ * config/tc-i386.c (tc_gen_reloc): Don't try to convert the type
+ of a BFD_RELOC_RVA reloc.
+
+Wed May 28 10:48:14 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-hppa.c (tc_fix_adjustable): Reject absolute calls/jumps.
+ (hppa_force_relocation): Force a relocation for an absolute
+ call/jump.
+
Mon May 26 13:24:25 1997 Ian Lance Taylor <ian@cygnus.com>
* doc/as.texinfo: Don't use @value in section names or index
entries; it confuses texinfo.tex.
-Tue May 13 10:42:20 1997 Ian Lance Taylor <ian@cygnus.com>
+Fri May 23 00:09:35 1997 Tom Tromey <tromey@cygnus.com>
- * Makefile.in (VERSION): Set to 2.8.1.
+ * doc/as.texinfo: Updated for -MD option.
+ * Makefile.in (CFILES): Added depend.c.
+ (OBJS): Added depend.o.
+ * as.h (start_dependencies, register_dependency,
+ print_dependencies): New declarations.
+ * depend.c: New file.
+ * as.c (parse_args): Added -MD option.
+ (main): Call print_dependencies.
+ (show_usage): Added help for -MD.
+ * read.c (s_app_file): Call register_dependency.
+ (s_include): Call register_dependency when file is found.
+ (read_a_source_file): Call register_dependency.
+
+Wed May 21 17:39:28 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/obj-coff.c (symbol_to_chars): If TE_PE, don't add the
+ section address to the symbol value.
+
+Tue May 20 11:23:31 1997 Gavin Koch <gavin@cygnus.com>
+
+ * config/tc-mips.c (macro_build,mips_ip): Move the INSN_ISA field
+ into the new membership field.
+
+Thu May 15 10:00:53 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-arm.c (md_begin): If no cpu type is specified on the
+ command line then the ARM7 is now chosen by default when setting
+ the BFD machine and architecture.
+
+Wed May 14 09:54:53 1997 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-arm.c (global variables): Added 'uses_apcs_26' flag to
+ hold APCS selection.
+ (md_begin): Added code to generate flags to be set into the COFF
+ header and the calls to the BFD functions to do this.
+ (md_parse_option, md_show_usage): Added new command line
+ options -mapcs-32, -mapcs-26, -marmv2, -marmv2a, -marmv3,
+ -marmv3m, -marmv4, -marmv4t.
+
+ * tc-arm.h (LOCAL_LABEL): Removed the definition of this macro
+ as it is never used.
+
+Tue May 13 22:26:14 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mn10200.c (md_convert_frag): Prefix temporary
+ label name with ".".
+ * config/tc-mn10300.c (md_convert_frag): Likewise.
+
+Tue May 13 14:44:39 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-mips.c (set_at): Check for bignum.
+ (check_absolute_expr, macro, mips16_macro): Likewise.
Mon May 12 13:33:08 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
@@ -21,6 +1967,12 @@ Wed May 7 15:39:48 1997 Ian Lance Taylor <ian@cygnus.com>
* config/obj-coff.c (write_object_file): Just pass NULL to
md_do_align, not the address of a char holding NOP_OPCODE.
+ * config/tc-mips.c (macro): Handle constants for M_LI_D and
+ M_LI_DD.
+ (mips_ip): For 'F', 'L', 'f', and 'l', generate a constant rather
+ than an address if the floating point value looks sufficiently
+ simple.
+
Tue May 6 12:18:09 1997 Ian Lance Taylor <ian@cygnus.com>
* config/tc-i386.c (md_section_align): If a.out and BFD, force
@@ -57,6 +2009,11 @@ Tue Apr 29 20:23:10 1997 Jim Wilson <wilson@cygnus.com>
(load_address, macro, md_estimate_size_before_relax): Fix all
callers.
+Tue Apr 29 19:54:36 1997 Richard Henderson <rth@tamu.edu>
+
+ * config/obj-elf.c (elf_pseudo_table): Add "subsection".
+ (obj_elf_subsection): New static function.
+
Tue Apr 29 19:52:47 1997 Ian Lance Taylor <ian@cygnus.com>
* config/obj-coff.c (coff_header_append): Don't reset string_size
@@ -72,6 +2029,16 @@ Fri Apr 25 12:03:15 1997 Ian Lance Taylor <ian@cygnus.com>
current configure handling of targ-cpu.h, et. al.
(CPU backend): Document listing macros.
+ * listing.c (data_buffer): Set size based on other listing macros,
+ rather than always using 100.
+ (data_buffer_size): Remove static variable.
+ (calc_hex): Make data_buffer_size a local variable. Don't leave
+ any slop when filling data_buffer.
+
+Mon Apr 21 15:33:19 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * doc/c-mips.texi: Document .set autoextend.
+
Sat Apr 19 23:09:25 1997 Niklas Hallqvist <niklas@petra.appli.se>
* configure.in (i386-*-openbsd*, m68k-*-openbsd*,
@@ -84,6 +2051,11 @@ Sat Apr 19 22:52:03 1997 Jim Wilson <wilson@cygnus.com>
* config/obj-elf.c (elf_frob_symbol): If TC_MIPS, set BSF_OBJECT
for all undefined symbols.
+Fri Apr 18 13:37:35 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/tc-ppc.c (ppc_fix_adjustable): Handle zero length csects
+ correctly.
+
Fri Apr 18 11:51:35 1997 Niklas Hallqvist <niklas@appli.se>
* configure.in (alpha*-*-openbsd*): New target.
@@ -98,8 +2070,30 @@ Tue Apr 15 18:11:44 1997 Gavin Koch <gavin@cygnus.com>
* config/tc-mips.c (insn_uses_reg): Correct test for fpr pairs.
+Tue Apr 15 13:04:47 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (srcroot): Remove.
+ (INSTALL): Set to @INSTALL@.
+ (INSTALL_XFORM, INSTALL_XFORM1): Remove.
+ (all, dvi): Don't set srcroot.
+ (install): Depend upon as.new, gasp.new, and installdirs. Use
+ $(program_transform_name) directly, rather than using
+ $(INSTALL_XFORM) and $(INSTALL_XFORM1).
+ (installdirs): New target.
+ * doc/Makefile.in (INSTALL_XFORM1): Remove.
+ (install): Depend upon installdirs. Use $(program_transform_name)
+ directly, rather than using $(INSTALL_XFORM) and
+ $(INSTALL_XFORM1).
+ (installdirs): New target.
+ (install-info-as): Run mkinstalldirs.
+ (install-info-gasp): Likewise.
+
Mon Apr 14 11:59:08 1997 Ian Lance Taylor <ian@cygnus.com>
+ * Makefile.in (INSTALL): Change install.sh to install-sh.
+
+ * symbols.c (resolve_symbol_value): Check for division by zero.
+
From Thomas Graichen <graichen@rzpd.de>:
* Makefile.in: Always use $(SHELL) when running move-if-change.
* configure.in: Use ${CONFIG_SHELL} when running $ac_config_sub.
@@ -118,6 +2112,11 @@ Wed Apr 9 11:49:41 1997 Ian Lance Taylor <ian@cygnus.com>
* config/tc-m68k.c (m68k_ip): Handle #j.
+Tue Apr 8 16:37:57 1997 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mn10300.c (md_convert_frag): Create fixup at the
+ right address for call label:32,regs,imm.
+
Mon Apr 7 14:58:22 1997 Jeffrey A Law (law@cygnus.com)
* config/tc-hppa.c (pa_subspace_start): If OBJ_ELF, then always return
@@ -176,14 +2175,19 @@ Fri Apr 4 13:26:10 1997 Ian Lance Taylor <ian@cygnus.com>
* config/tc-hppa.h (TC_EOL_IN_INSN): Check explicitly for '!',
rather than for any end of line character.
+ * config/tc-hppa.c (tc_gen_reloc): If hppa_ren_reloc_type fails,
+ call abort (i.e., as_abort) rather than crashing.
+
* config/tc-mips.c: Protect uses of STO_MIPS16 with an ifdef of
OBJ_ELF, rather than of S_GET_OTHER.
* Makefile.in (DISTCLEAN_HERE): Add site.exp and site.bak.
-Thu Apr 3 18:52:39 1997 Ian Lance Taylor <ian@cygnus.com>
+Thu Apr 3 13:16:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (VERSION): Set to 2.8.1.
- * Makefile.in (VERSION): Set to 2.8.
+ * Branched binutils 2.8.
Wed Apr 2 12:24:10 1997 Ian Lance Taylor <ian@cygnus.com>
@@ -826,7 +2830,7 @@ Wed Feb 19 00:53:28 1997 Ian Lance Taylor <ian@cygnus.com>
* read.c (get_line_sb): Don't end the line on a semicolon inside a
string.
-Sun Feb 16 17:47:29 1997 Fred Fish <fnf@toadfish.ninemoons.com>
+Sun Feb 16 17:47:29 1997 Fred Fish <fnf@cygnus.com>
* config/tc-alpha.h (md_operand): Define with a null expansion,
like all the other targets.
@@ -881,7 +2885,7 @@ Fri Feb 14 15:56:06 1997 Gavin Koch <gavin@cygnus.com>
Thu Feb 13 20:02:16 1997 Fred Fish <fnf@cygnus.com>
- * config/{tc-alpha.h, tc-arc.h, tc-d10v.h, tc-generic.h, tc-i960.h,
+ * config/{tc-alpha.h, tc-d10v.h, tc-generic.h, tc-i960.h,
tc-mn10200.h, tc-mn10300.h, tc-sh.h, tc-vax.h, tc-w65.h}:
Add default definition of zero for TARGET_BYTES_BIG_ENDIAN.
* config/{tc-arm.h, tc-hppa.h, tc-i386.h, tc-mips.h, tc-ns32k.h,
@@ -1355,6 +3359,12 @@ Thu Jan 2 13:37:29 1997 Ian Lance Taylor <ian@cygnus.com>
(mips_elf_final_processing): Likewise.
(ELF_TC_SPECIAL_SECTIONS): Likewise.
+Tue Dec 31 15:12:35 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config/tc-v850.c (md_assemble): If this is sst.{h,w} or
+ sld.{h,w} and the operand is relocatable, adjust the adend by
+ shifting it right one bit.
+
Tue Dec 31 12:56:41 1996 Ian Lance Taylor <ian@cygnus.com>
* read.c (read_a_source_file): Check mri_pending_align after
@@ -1809,6 +3819,32 @@ Wed Oct 30 20:15:35 1996 Ian Lance Taylor <ian@cygnus.com>
* doc/internals.texi: Rewrite, and add a lot of documentation.
* doc/Makefile.in (internals.info): New target.
+Wed Oct 30 14:55:57 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.h (tc_fix_adjustable): Don't adjust relocs
+ against weak symbols.
+
+Tue Oct 29 12:28:16 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_assemble): Don't lose for relaxable
+ addresses like .+6.
+
+ * config/tc-v850.c (md_convert_frag): Make sure we insert the
+ fixup at the right address within the frag.
+
+ * config/tc-v850.c (md_convert_frag): Don't set fragP->fr_fix
+ to an absolute value, instead increment it as needed.
+
+ * config/tc-v850.h (TC_GENERIC_RELAX_TABLE): Define.
+ * config/tc-v850.c: Fix some indention problems.
+ (md_relax_table): Define for D9->D99 branch displacement
+ relaxing.
+ (md_convert_frag): Do something useful instead of aborting.
+ (md_estimate_size_before_relax): Likewise.
+ (md_assemble): Note if the matching instruction has a relaxable
+ operand. If it does, allocate frag with frag_var and don't
+ do any fixups.
+
Mon Oct 28 10:48:40 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* config/tc-d10v.h (md_cleanup): New function. This is needed to
@@ -1823,11 +3859,40 @@ Fri Oct 25 00:01:00 1996 Ian Lance Taylor <ian@cygnus.com>
* write.c (fix_new_exp): Use make_expr_symbol to build an
expression symbol for a complex fixup.
+Thu Oct 24 14:31:04 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (v850_reloc_prefix): Several disgusting
+ hacks to improve parsing of complex hi, lo, zda, etc
+ expressions.
+ (md_assemble): Don't demand and eat a trailing ')' after finding
+ a v850 relocation prefix. Sign extend the constant in a
+ BFD_RELOC_LO16 expression. Do eat a trailing ')' after a complete
+ operand.
+ (parse_cons_expression_v850): Don't eat a trailing ')' after
+ finding a v850 relocation prefix.
+
+ * config/tc-v850.h (TC_PARSE_CONS_EXPRESSION): Define.
+ (TC_CONS_FIX_NEW): Likewise.
+ * config/tc-v850.c (parse_cons_expression_v850): New function.
+ (cons_fix_new_v850): Likewise.
+
+ * config/tc-v850.h (tc_fix_adjustable): Don't adjust TDA relocs.
+
Wed Oct 23 18:20:29 1996 Ian Lance Taylor <ian@cygnus.com>
* config/tc-ppc.c (md_apply_fix3): Give a better warning message
for an unknown relocation type.
+Wed Oct 23 16:21:28 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_pseudo_table): Add .word; allocates
+ 4 bytes of space.
+
+Tue Oct 22 22:01:25 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_assemble): Handle TDAOFF relocs
+ differently for movea & sst/sld insns.
+
Tue Oct 22 17:09:32 1996 Michael Meissner <meissner@tiktok.cygnus.com>
* config/tc-d10v.c (parallel_ok): Don't allow illegal combinations
@@ -1870,6 +3935,26 @@ Thu Oct 17 17:55:17 1996 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in ($(OBJS)): Depend upon libiberty.h.
+Wed Oct 16 11:28:31 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (v850_reloc_prefix): Recognize zdaoff, tdaoff
+ and sdaoff expressions.
+
+ * write.c (fixup_segment): Don't add symbol value to addend if
+ TC_V850 and OBJ_ELF.
+ * config/tc-v850.h (tc_fix_adjustable): Don't adjust any
+ pc-relative fixups.
+
+ * config/tc-v850.c (md_pcrel_from): Undo yesterday's changes.
+ (md_pcrel_from_section): Likewise.
+ * config/tc-v850.h (MD_PCREL_FROM_SECTION): Likewise.
+
+Tue Oct 15 23:19:00 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_pcrel_from): Delete unused function.
+ (md_pcrel_from_section): New function.
+ * config/tc-v850.h (MD_PCREL_FROM_SECTION): Define.
+
Mon Oct 14 13:59:12 1996 Ian Lance Taylor <ian@cygnus.com>
* config/tc-mips.c (load_register): Add cast to offsetT when using
@@ -2022,6 +4107,11 @@ Tue Oct 1 12:37:48 1996 Ian Lance Taylor <ian@cygnus.com>
(alpha_macros): Move to top of file. Make static.
(alpha_num_macros): Move to top of file.
+Tue Oct 1 09:36:19 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * tc-v850.h: Define LOCAL_LABEL to recognise _.L_* symbols
+ generated by DWARF.
+
Sat Sep 28 03:38:08 1996 Ian Lance Taylor <ian@cygnus.com>
* listing.c (list_symbol_table): Remove bogus code in BFD64 case,
@@ -2159,6 +4249,42 @@ Tue Sep 3 13:52:56 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* config/tc-d10v.c: Added changes to support function
pointers and "@word" syntax.
+Tue Sep 3 11:57:18 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c: Remove commented out and #if 0'd code.
+ (v850_reloc_prefix): Provide prototype.
+ (postfix, get_reloc, build_insn): Remove prototypes for nonexistant
+ functions.
+ (md_begin, md_assemble, md_apply_fix3): Remove unused variables.
+ (md_assemble): Add default to case statement.
+
+Sat Aug 31 16:03:00 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_assemble): Compute size of the instrction
+ from the opcode.
+
+ * config/tc-v850.c (md_apply_fix3): Do simple byte, short and
+ word fixups too.
+
+Fri Aug 30 23:50:08 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_apply_fix3): Use little endian get/put
+ routines to fetch/store the updated instruction from/to memory.
+ (v850_insert_operand): If the operand has a specialized insert
+ routine, call it.
+
+Fri Aug 30 18:35:26 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * config/tc-v850.c (reg_name_search): Align calling convention to
+ be like identical function found in tc-ppc.c.
+ (get_reloc): Removed.
+ (v850_reloc_prefix): New function, parse lo(), hi() and hi0().
+ (md_assemble): emit fixups.
+ (md_pcrel_from): renamed from md_pcrel_from_section, emit proper
+ displacement.
+ (md_apply_fix3): handle fixups/relocs.
+ * config/tc-v850.h (MD_PCREL_FROM_SECTION): Removed definition.
+
Fri Aug 30 18:12:00 1996 Ian Lance Taylor <ian@cygnus.com>
Add SH ELF support.
@@ -2212,6 +4338,16 @@ Fri Aug 30 14:47:38 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* config/tc-d10v.c (find_opcode): Fix problem with calculating
branch sizes in across sections.
+Fri Aug 30 00:44:13 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-850.c (md_assemble): Handle hi() correctly. Handle
+ hi0() too.
+
+Wed Aug 28 23:11:08 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_begin): Deal with end of opcode
+ table marker.
+
Wed Aug 28 19:20:04 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* config/tc-d10v.c (find_opcode): Fix a bug which could generate
@@ -2261,6 +4397,34 @@ Fri Aug 23 11:40:47 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* doc/c-d10v.texi: Fix typo.
+Fri Aug 23 10:41:32 1996 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-v850.c (md_assemble): Correct bit masking for
+ hi and lo expressions.
+
+ * config/tc-v850.c (md_assemble): Rough cut at demanding
+ "ep" or "r30" in sst and sld instructions.
+ (md_apply_fix3): Don't abort. Just warn that we don't
+ have relocs yet.
+
+ * config/tc-v850.c (CC_NAME_CNT): Define.
+ (cc_name): New function.
+ (md_assemble): Handle V850_OPERAND_CC correctly.
+
+ * config/tc-v850.c (md_assemble): Don't forget to initialize
+ "insn"!
+
+ * config/tc-v850.c (reg_name_search): Generalize to search
+ any given register table.
+ (register_name): Pass appropriate table and size to reg_name_search.
+ (system_register_name): New function.
+ (SYSREG_NAME_CNT): Define.
+ (md_assemble): Handle operands which are system registers.
+
+ * config/tc-v850.c (md_assemble): If we find a register, but the
+ opcode doesn't want a register, then we don't have a match.
+ (md_assemble): Get size of the instruction from the opcode table.
+
Thu Aug 22 10:20:30 1996 Ian Lance Taylor <ian@cygnus.com>
* configure.in: Set and substitute HLDENV.
@@ -2276,6 +4440,13 @@ Thu Aug 22 10:50:00 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* config/tc-d10v.c: Fix a reloc bug caused by my last change.
* doc/c-d10v.texi: Cleanup.
+Tue Aug 20 15:15:16 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * config/tc-v850.c: New file.
+ * config/tc-v850.h: New file.
+ * configure (v850-*-elf): New target.
+ * configure.in (v850-*-elf): New target.
+
Wed Aug 21 15:50:54 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* doc/c-d10v.texi: New file.
diff --git a/contrib/binutils/gas/Makefile.am b/contrib/binutils/gas/Makefile.am
new file mode 100644
index 0000000..e645c2c
--- /dev/null
+++ b/contrib/binutils/gas/Makefile.am
@@ -0,0 +1,1549 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus dejagnu
+
+SUBDIRS = doc
+
+tooldir = $(exec_prefix)/$(target_alias)
+
+YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
+LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
+
+DEP = mkdep
+
+TARG_CPU = @target_cpu_type@
+TARG_CPU_C = $(srcdir)/config/tc-@target_cpu_type@.c
+TARG_CPU_O = tc-@target_cpu_type@.o
+TARG_CPU_H = $(srcdir)/config/tc-@target_cpu_type@.h
+OBJ_FORMAT_C = $(srcdir)/config/obj-@obj_format@.c
+OBJ_FORMAT_O = obj-@obj_format@.o
+OBJ_FORMAT_H = $(srcdir)/config/obj-@obj_format@.h
+TARG_ENV_H = $(srcdir)/config/te-@te_file@.h
+ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c
+ATOF_TARG_O = atof-@atof@.o
+
+# use @target_cpu_type@ for refering to configured target name
+IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h
+IT_SRCS=itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c
+IT_DEPS=$(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h
+IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o
+
+# CPU types. This is only used for dependency information.
+
+CPU_TYPES = \
+ a29k \
+ alpha \
+ arc \
+ arm \
+ d10v \
+ h8300 \
+ h8500 \
+ hppa \
+ i386 \
+ i860 \
+ i960 \
+ m32r \
+ m68k \
+ m88k \
+ mips \
+ mn10200 \
+ mn10300 \
+ ns32k \
+ ppc \
+ sh \
+ sparc \
+ tahoe \
+ tic30 \
+ vax \
+ w65 \
+ v850 \
+ z8k
+
+# Object format types. This is only used for dependency information.
+# We deliberately omit som, since it does not work as a cross assembler.
+
+OBJ_FORMATS = \
+ aout \
+ bout \
+ coff \
+ ecoff \
+ elf \
+ evax \
+ hp300 \
+ ieee \
+ vms
+
+# This is an sh case which sets valid according to whether the CPU
+# type in the shell variable c and the OS type in the shell variable o
+# are supported. This helps cuts down on the amount of dependency
+# information.
+
+CPU_OBJ_VALID = \
+ valid= ; \
+ case $$o in \
+ aout) \
+ case $$c in \
+ a29k | arm | i386 | i860 | m68k | mips | ns32k | sparc | tahoe | tic30 | vax) \
+ valid=yes ;; \
+ esac ;; \
+ bout) \
+ case $$c in \
+ i960) valid=yes ;; \
+ esac ;; \
+ coff) valid=yes ;; \
+ ecoff) \
+ case $$c in \
+ mips | alpha) valid=yes ;; \
+ esac ;; \
+ elf) valid=yes ;; \
+ evax) \
+ case $$c in \
+ alpha) valid=yes ;; \
+ esac ;; \
+ hp300) \
+ case $$c in \
+ m68k) valid=yes ;; \
+ esac ;; \
+ vms) \
+ case $$c in \
+ vax) valid=yes ;; \
+ esac ;; \
+ esac;
+
+# This is like CPU_OBJ_VALID, for the obj=multi case.
+
+CPU_MULTI_VALID = \
+ valid= ; \
+ case $$c in \
+ i386 | mips) valid=yes ;; \
+ esac;
+
+# Regular source files.
+
+GAS_CFILES = \
+ app.c \
+ as.c \
+ atof-generic.c \
+ bignum-copy.c \
+ cond.c \
+ depend.c \
+ ecoff.c \
+ ehopt.c \
+ expr.c \
+ flonum-copy.c \
+ flonum-konst.c \
+ flonum-mult.c \
+ frags.c \
+ hash.c \
+ input-file.c \
+ input-scrub.c \
+ listing.c \
+ literal.c \
+ macro.c \
+ messages.c \
+ output-file.c \
+ read.c \
+ sb.c \
+ stabs.c \
+ subsegs.c \
+ symbols.c \
+ write.c
+
+CFILES = $(GAS_CFILES) gasp.c itbl-ops.c
+
+HFILES = \
+ as.h \
+ bignum.h \
+ bit_fix.h \
+ ecoff.h \
+ emul-target.h \
+ emul.h \
+ expr.h \
+ flonum.h \
+ frags.h \
+ hash.h \
+ input-file.h \
+ itbl-ops.h \
+ listing.h \
+ macro.h \
+ obj.h \
+ output-file.h \
+ read.h \
+ sb.h \
+ struc-symbol.h \
+ subsegs.h \
+ symbols.h \
+ tc.h \
+ write.h
+
+# CPU files in config.
+
+TARGET_CPU_CFILES = \
+ config/tc-a29k.c \
+ config/tc-alpha.c \
+ config/tc-arc.c \
+ config/tc-arm.c \
+ config/tc-d10v.c \
+ config/tc-h8300.c \
+ config/tc-h8500.c \
+ config/tc-hppa.c \
+ config/tc-i386.c \
+ config/tc-i860.c \
+ config/tc-i960.c \
+ config/tc-m32r.c \
+ config/tc-m68k.c \
+ config/tc-m88k.c \
+ config/tc-mips.c \
+ config/tc-mn10200.c \
+ config/tc-mn10300.c \
+ config/tc-ns32k.c \
+ config/tc-ppc.c \
+ config/tc-sh.c \
+ config/tc-sparc.c \
+ config/tc-tahoe.c \
+ config/tc-tic30.c \
+ config/tc-vax.c \
+ config/tc-w65.c \
+ config/tc-v850.c \
+ config/tc-z8k.c
+
+TARGET_CPU_HFILES = \
+ config/tc-a29k.h \
+ config/tc-alpha.h \
+ config/tc-arc.h \
+ config/tc-arm.h \
+ config/tc-d10v.h \
+ config/tc-h8300.h \
+ config/tc-h8500.h \
+ config/tc-hppa.h \
+ config/tc-i386.h \
+ config/tc-i860.h \
+ config/tc-i960.h \
+ config/tc-m32r.h \
+ config/tc-m68k.h \
+ config/tc-m88k.h \
+ config/tc-mips.h \
+ config/tc-mn10200.h \
+ config/tc-mn10300.h \
+ config/tc-ns32k.h \
+ config/tc-ppc.h \
+ config/tc-sh.h \
+ config/tc-sparc.h \
+ config/tc-tahoe.h \
+ config/tc-tic30.h \
+ config/tc-vax.h \
+ config/tc-w65.h \
+ config/tc-v850.h \
+ config/tc-z8k.h
+
+# OBJ files in config
+
+OBJ_FORMAT_CFILES = \
+ config/obj-aout.c \
+ config/obj-bout.c \
+ config/obj-coff.c \
+ config/obj-ecoff.c \
+ config/obj-elf.c \
+ config/obj-evax.c \
+ config/obj-hp300.c \
+ config/obj-ieee.c \
+ config/obj-som.c \
+ config/obj-vms.c
+
+OBJ_FORMAT_HFILES = \
+ config/obj-aout.h \
+ config/obj-bout.h \
+ config/obj-coff.h \
+ config/obj-ecoff.h \
+ config/obj-elf.h \
+ config/obj-evax.h \
+ config/obj-hp300.h \
+ config/obj-ieee.h \
+ config/obj-som.h \
+ config/obj-vms.h
+
+# Emulation header files in config
+
+TARG_ENV_HFILES = \
+ config/te-386bsd.h \
+ config/te-aux.h \
+ config/te-delta.h \
+ config/te-delt88.h \
+ config/te-dpx2.h \
+ config/te-dynix.h \
+ config/te-generic.h \
+ config/te-go32.h \
+ config/te-hp300.h \
+ config/te-hppa.h \
+ config/te-i386aix.h \
+ config/te-ic960.h \
+ config/te-linux.h \
+ config/te-lnews.h \
+ config/te-lynx.h \
+ config/te-mach.h \
+ config/te-macos.h \
+ config/te-multi.h \
+ config/te-nbsd.h \
+ config/te-nbsd532.h \
+ config/te-pc532mach.h \
+ config/te-pe.h \
+ config/te-ppcnw.h \
+ config/te-psos.h \
+ config/te-riscix.h \
+ config/te-sparcaout.h \
+ config/te-sun3.h \
+ config/te-svr4.h \
+ config/te-sysv32.h
+
+# Multi files in config
+
+MULTI_CFILES = \
+ config/e-i386coff.c \
+ config/e-i386elf.c \
+ config/e-mipsecoff.c \
+ config/e-mipself.c
+
+CONFIG_OBJS = \
+ $(TARG_CPU_O) \
+ $(OBJ_FORMAT_O) \
+ $(ATOF_TARG_O) \
+ $(extra_objects)
+
+GENERIC_OBJS = \
+ app.o \
+ as.o \
+ atof-generic.o \
+ bignum-copy.o \
+ cond.o \
+ depend.o \
+ ehopt.o \
+ expr.o \
+ flonum-konst.o \
+ flonum-copy.o \
+ flonum-mult.o \
+ frags.o \
+ hash.o \
+ input-file.o \
+ input-scrub.o \
+ literal.o \
+ messages.o \
+ output-file.o \
+ read.o \
+ subsegs.o \
+ symbols.o \
+ write.o \
+ listing.o \
+ ecoff.o \
+ stabs.o \
+ sb.o \
+ macro.o
+
+OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
+
+noinst_PROGRAMS = as-new gasp-new
+noinst_SCRIPTS = .gdbinit
+
+$(srcdir)/make-gas.com: stamp-mk.com
+stamp-mk.com: vmsconf.sh Makefile
+ sh $(srcdir)/vmsconf.sh $(GENERIC_OBJS) > new-make.com
+ $(SHELL) $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com
+ touch stamp-mk.com
+
+EXTRA_DIST = make-gas.com
+
+DISTSTUFF = make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c
+diststuff: $(DISTSTUFF) info
+
+DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-opc.h
+
+# Now figure out from those variables how to compile and link.
+
+BASEDIR = $(srcdir)/..
+BFDDIR = $(BASEDIR)/bfd
+INCDIR = $(BASEDIR)/include
+
+# This is the variable actually used when we compile.
+# Specify the directories to be searched for header files.
+# Both . and srcdir are used, in that order,
+# so that tm.h and config.h will be found in the compilation
+# subdirectory rather than in the source directory.
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR)
+
+# This should be parallel to INCLUDES, but should replace $(srcdir)
+# with $${srcdir}, and should work in a subdirectory. This is used
+# when building dependencies, because the dependency building is done
+# in a subdirectory.
+DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd
+
+# How to link with both our special library facilities
+# and the system's installed libraries.
+
+GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a
+
+# Files to be copied away after each stage in building.
+STAGESTUFF = *.o $(noinst_PROGRAMS)
+
+$(OBJS): @ALL_OBJ_DEPS@
+
+as_new_SOURCES = $(GAS_CFILES)
+as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
+ $(extra_objects) $(GASLIBS)
+as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
+ $(extra_objects) $(GASLIBS)
+
+# Stuff that every object file depends upon. If anything is removed
+# from this list, remove it from dep-in.sed as well.
+$(OBJS): config.h as.h $(TARG_ENV_H) $(OBJ_FORMAT_H) $(TARG_CPU_H) flonum.h \
+ expr.h struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h \
+ obj.h listing.h bignum.h bit_fix.h $(INCDIR)/libiberty.h
+
+gasp_new_SOURCES = gasp.c macro.c sb.c hash.c
+gasp_new_LDADD = ../libiberty/libiberty.a
+
+EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
+ echo $${rootme}/../expect/expect ; \
+ else echo expect ; fi`
+
+RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
+ echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \
+ fi`
+RUNTESTFLAGS=
+
+check-DEJAGNU: site.exp
+ if [ -d testsuite ]; then \
+ true; \
+ else \
+ mkdir testsuite; \
+ fi
+ rm -f testsuite/site.exp
+ cp site.exp testsuite/site.exp
+ rootme=`pwd`; export rootme; \
+ srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
+ EXPECT=${EXPECT} ; export EXPECT ; \
+ if [ -f $(top_builddir)/../expect/expect ]; then \
+ TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
+ export TCL_LIBRARY; \
+ fi; \
+ runtest=$(RUNTEST); \
+ cd testsuite; \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
+ $(RUNTESTFLAGS); \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi
+
+# The implicit .c.o rule doesn't work for these, perhaps because of
+# the variables, or perhaps because the sources are not on vpath.
+$(TARG_CPU_O): $(TARG_CPU_C) $(TARG_CPU_DEP_@target_cpu_type@)
+ $(COMPILE) -c $(TARG_CPU_C)
+$(ATOF_TARG_O): $(ATOF_TARG_C)
+ $(COMPILE) -c $(ATOF_TARG_C)
+
+# ecoff.c only has full dependencies when ECOFF_DEBUGGING is defined,
+# so the automatic dependency stuff doesn't work.
+ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
+ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/symconst.h \
+ $(INCDIR)/aout/stab_gnu.h
+
+# We need all these explicit rules for the multi stuff. Because of
+# these rules, we don't need one for OBJ_FORMAT_O.
+
+obj-aout.o : $(srcdir)/config/obj-aout.c
+ $(COMPILE) -c $(srcdir)/config/obj-aout.c
+obj-bout.o : $(srcdir)/config/obj-bout.c
+ $(COMPILE) -c $(srcdir)/config/obj-bout.c
+obj-coff.o: $(srcdir)/config/obj-coff.c
+ $(COMPILE) -c $(srcdir)/config/obj-coff.c
+obj-ecoff.o : $(srcdir)/config/obj-ecoff.c
+ $(COMPILE) -c $(srcdir)/config/obj-ecoff.c
+obj-elf.o : $(srcdir)/config/obj-elf.c
+ $(COMPILE) -c $(srcdir)/config/obj-elf.c
+obj-evax.o : $(srcdir)/config/obj-evax.c
+ $(COMPILE) -c $(srcdir)/config/obj-evax.c
+obj-hp300.o : $(srcdir)/config/obj-hp300.c
+ $(COMPILE) -c $(srcdir)/config/obj-hp300.c
+obj-ieee.o : $(srcdir)/config/obj-ieee.c
+ $(COMPILE) -c $(srcdir)/config/obj-ieee.c
+obj-multi.o : $(srcdir)/config/obj-multi.c
+ $(COMPILE) -c $(srcdir)/config/obj-multi.c
+obj-som.o : $(srcdir)/config/obj-som.c
+ $(COMPILE) -c $(srcdir)/config/obj-som.c
+obj-vms.o : $(srcdir)/config/obj-vms.c
+ $(COMPILE) -c $(srcdir)/config/obj-vms.c
+
+e-mipself.o : $(srcdir)/config/e-mipself.c
+ $(COMPILE) -c $(srcdir)/config/e-mipself.c
+e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
+ $(COMPILE) -c $(srcdir)/config/e-mipsecoff.c
+e-i386coff.o: $(srcdir)/config/e-i386coff.c
+ $(COMPILE) -c $(srcdir)/config/e-i386coff.c
+e-i386elf.o: $(srcdir)/config/e-i386elf.c
+ $(COMPILE) -c $(srcdir)/config/e-i386elf.c
+
+# The m68k operand parser.
+
+EXTRA_as_new_SOURCES = config/m68k-parse.y
+
+m68k-parse.c: $(srcdir)/config/m68k-parse.y
+ $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/config/m68k-parse.y y.tab.c m68k-parse.c --
+m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h
+
+# Don't let the .y.h rule clobber m68k-parse.h.
+m68k-parse.h: ; @true
+$(srcdir)/config/m68k-parse.h: ; @true
+
+# The instruction table specification lexical analyzer and parser.
+
+itbl-lex.c: $(srcdir)/itbl-lex.l
+itbl-lex.o: itbl-lex.c itbl-parse.h
+
+itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h
+
+itbl-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
+
+itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
+ $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- -d
+
+# stand-alone itbl assembler & disassembler
+
+EXTRA_PROGRAMS = itbl-test
+itbl_test_SOURCES = itbl-parse.y itbl-lex.l
+itbl_test_LDADD = itbl-test-ops.o itbl-test.o $(GASLIBS) @LEXLIB@
+
+itbl-test-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
+ $(COMPILE) -o itbl-test-ops.o -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
+
+itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c $(srcdir)/itbl-ops.h
+ $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
+
+# CGEN interface.
+
+cgen.o: cgen.c cgen-opc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
+ $(srcdir)/../opcodes/$(TARG_CPU)-opc.h
+
+# Remake the info files.
+
+MOSTLYCLEANFILES = $(STAGESTUFF) core stamp-mk.com \
+ testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
+ testsuite/site.exp site.bak site.exp stage stage1 stage2
+
+CLEANFILES = dep.sed .tcdep .objdep .dep2 .dep1 .depa .dep .depdir
+
+.PHONY: install-exec-local install-data-local
+
+install-exec-local: $(noinst_PROGRAMS)
+ $(mkinstalldirs) $(bindir) $(tooldir)/bin
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`"; \
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`; \
+ else :; fi; \
+ done
+ rm -f $(tooldir)/bin/as$(EXEEXT)
+ n=`echo as | sed '$(transform)'`; \
+ if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
+ ln $(bindir)/$$n$(EXEEXT) $(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
+ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(tooldir)/bin/as$(EXEEXT); \
+ fi
+
+# These exist for maintenance purposes.
+
+.PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
+
+bootstrap: as-new
+ $(MAKE) stage1
+ rm -f stage && ln -s stage1 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) stage2
+ rm -f stage && ln -s stage2 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) comparison against=stage2
+
+bootstrap2:
+ rm -f stage && ln -s stage1 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) stage2
+ rm -f stage && ln -s stage2 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) comparison against=stage2
+
+bootstrap3:
+ rm -f stage && ln -s stage2 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) comparison against=stage2
+
+# Copy the object files from a particular stage into a subdirectory.
+stage1:
+ -mkdir stage1
+ -mv $(STAGESTUFF) stage1
+ if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
+
+stage2:
+ -mkdir stage2
+ -mv $(STAGESTUFF) stage2
+ if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
+
+stage3:
+ -mkdir stage3
+ -mv $(STAGESTUFF) stage3
+ if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
+
+against=stage2
+
+# This rule is derived from corresponding code in the Makefile.in for gcc.
+# The "tail +16c" is to bypass headers which may include timestamps or
+# temporary assembly file names.
+comparison:
+ x=0 ; \
+ for file in *.o ; do \
+ tail +16c ./$$file > tmp-foo1; \
+ if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
+ if cmp tmp-foo1 tmp-foo2 ; then \
+ true ; \
+ else \
+ echo $$file differs ; \
+ x=1 ; \
+ fi ; \
+ else true; fi ; \
+ done ; \
+ exit $$x
+ -rm -f tmp-foo*
+
+.PHONY: de-stage1 de-stage2 de-stage3
+
+de-stage1:
+ - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
+ - rmdir stage1
+
+de-stage2:
+ - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
+ - rmdir stage2
+
+de-stage3:
+ - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
+ - rmdir stage3
+
+# Automatic dependency computation. This is a real pain, because the
+# dependencies change based on target_cpu_type and obj_format. We
+# currently ignore any dependencies caused by emulation files.
+
+DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
+ $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES)
+
+.dep: dep.sed $(DEP_FILE_DEPS) .tcdep .objdep .dep2
+ rm -f .dep1
+ srcdir=`cd $(srcdir); pwd`; \
+ $(MAKE) DEP=$(DEP) srcdir=$${srcdir} VPATH=$${srcdir} .dep1
+ rm -rf .depdir
+ sed -f dep.sed < .dep1 > .depa
+ sed -f dep.sed < .tcdep >> .depa
+ sed -f dep.sed < .objdep >> .depa
+ sed -f dep.sed < .dep2 >> .depa
+ echo '$$(OBJS): $$(DEP_@target''_cpu_type@_@obj''_format@)' >> .depa
+ echo '$$(TARG_CPU_O): $$(TCDEP_@target''_cpu_type@_@obj''_format@)' >> .depa
+ echo '$$(OBJ_FORMAT_O): $$(OBJDEP_@target''_cpu_type@_@obj''_format@)' >> .depa
+ echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> .depa
+ $(SHELL) $(srcdir)/../move-if-change .depa .dep
+
+# This rule needs a mkdep that runs "gcc -MM".
+.dep1: $(CFILES) $(MULTI_CFILES)
+ if [ -d .depdir ]; then true; else mkdir .depdir; fi
+ srcdir=`cd $(srcdir); pwd`; \
+ cd .depdir; \
+ echo '' > targ-cpu.h; \
+ echo '' > obj-format.h; \
+ echo '' > targ-env.h; \
+ echo '' > itbl-cpu.h; \
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
+ $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $?
+ sed -e '/IF YOU PUT ANYTHING/,$$d' < .depdir/.dep > .dep1
+ rm -f .depdir/.dep
+
+# Work out the special dependencies for the tc-*.c files.
+.tcdep: $(TARGET_CPU_CFILES)
+ rm -f .tcdepa
+ if [ -d .depdir ]; then true; else mkdir .depdir; fi
+ srcdir=`cd $(srcdir); pwd`; \
+ cd .depdir; \
+ for c in $(CPU_TYPES); do \
+ for o in $(OBJ_FORMATS); do \
+ $(CPU_OBJ_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
+ echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
+ echo '#include "te-generic.h"' > targ-env.h; \
+ echo '' > itbl-cpu.h; \
+ echo '#include "opcodes/'"$${c}"'-opc.h"' > cgen-opc.h; \
+ rm -f dummy.c; \
+ cp $${srcdir}/config/tc-$${c}.c dummy.c; \
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
+ $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c; \
+ sed -e "s/dummy.o: dummy.c/TCDEP_$${c}_$${o} =/" \
+ -e '1,/DO NOT PUT ANYTHING AFTER/d' \
+ -e '/IF YOU PUT ANYTHING/,$$d' \
+ -e '/^$$/d' < .dep >> ../.tcdepa; \
+ rm -f dummy.c; \
+ else true; fi; \
+ done; \
+ done
+ echo 'TCDEP_hppa_som = $$(srcdir)/config/tc-hppa.h subsegs.h \' >> .tcdepa
+ echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> .tcdepa
+ echo ' $$(INCDIR)/opcode/hppa.h $$(BFDDIR)/som.h' >> .tcdepa
+ # We don't try to handle all multi cases.
+ for c in $(CPU_TYPES); do \
+ $(CPU_MULTI_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ o=ecoff; \
+ $(CPU_OBJ_VALID) \
+ echo 'TCDEP_'"$${c}"'_multi = \' >> .tcdepa; \
+ echo '$$(TCDEP_'"$${c}"'_coff) \' >> .tcdepa; \
+ if [ x$${valid} = xyes ]; then \
+ echo '$$(TCDEP_'"$${c}"'_ecoff) \' >> .tcdepa; \
+ else true; fi; \
+ echo '$$(TCDEP_'"$${c}"'_elf)' >> .tcdepa; \
+ else true; fi; \
+ done
+ mv -f .tcdepa .tcdep
+
+# Work out the special dependencies for the obj-*.c files.
+.objdep: $(OBJ_FORMAT_CFILES)
+ rm -f .objdepa
+ if [ -d .depdir ]; then true; else mkdir .depdir; fi
+ srcdir=`cd $(srcdir); pwd`; \
+ cd .depdir; \
+ for c in $(CPU_TYPES); do \
+ for o in $(OBJ_FORMATS); do \
+ $(CPU_OBJ_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
+ echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
+ echo '#include "te-generic.h"' > targ-env.h; \
+ echo '' > itbl-cpu.h; \
+ rm -f dummy.c; \
+ cp $${srcdir}/config/obj-$${o}.c dummy.c; \
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
+ $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c; \
+ sed -e "s/dummy.o: dummy.c/OBJDEP_$${c}_$${o} =/" \
+ -e '1,/DO NOT PUT ANYTHING AFTER/d' \
+ -e '/IF YOU PUT ANYTHING/,$$d' \
+ -e '/^$$/d' < .dep >> ../.objdepa; \
+ rm -f dummy.c; \
+ else true; fi; \
+ done; \
+ done
+ echo 'OBJDEP_hppa_som = $$(srcdir)/config/obj-som.h subsegs.h \' >> .objdepa
+ echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> .objdepa
+ echo ' $$(BFDDIR)/som.h $$(INCDIR)/aout/stab_gnu.h \' >> .objdepa
+ echo ' $$(INCDIR)/aout/stab.def' >> .objdepa
+ # We don't try to handle all multi cases.
+ for c in $(CPU_TYPES); do \
+ $(CPU_MULTI_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ o=ecoff; \
+ $(CPU_OBJ_VALID) \
+ echo 'OBJDEP_'"$${c}"'_multi = \' >> .objdepa; \
+ echo '$$(OBJDEP_'"$${c}"'_coff) \' >> .objdepa; \
+ if [ x$${valid} = xyes ]; then \
+ echo '$$(OBJDEP_'"$${c}"'_ecoff) \' >> .objdepa; \
+ else true; fi; \
+ echo '$$(OBJDEP_'"$${c}"'_elf)' >> .objdepa; \
+ else true; fi; \
+ done
+ mv -f .objdepa .objdep
+
+# Work out the dependencies for each CPU/OBJ combination.
+# Note that SOM is a special case, because it only works native.
+.dep2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES)
+ rm -f .dep2a
+ if [ -d .depdir ]; then true; else mkdir .depdir; fi
+ srcdir=`cd $(srcdir); pwd`; \
+ cd .depdir; \
+ for c in $(CPU_TYPES); do \
+ for o in $(OBJ_FORMATS); do \
+ $(CPU_OBJ_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
+ echo '#include "obj-'"$${o}"'.h"' > dummy.c; \
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
+ $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c; \
+ sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" \
+ -e '1,/DO NOT PUT ANYTHING AFTER/d' \
+ -e '/IF YOU PUT ANYTHING/,$$d' \
+ -e '/^$$/d' < .dep >> ../.dep2a; \
+ else true; fi; \
+ done; \
+ done
+ echo 'DEP_hppa_som = $$(BFDDIR)/som.h' >> .dep2a
+ # We don't try to handle all multi cases.
+ for c in $(CPU_TYPES); do \
+ $(CPU_MULTI_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ o=ecoff; \
+ $(CPU_OBJ_VALID) \
+ echo 'DEP_'"$${c}"'_multi = \' >> .dep2a; \
+ echo '$$(DEP_'"$${c}"'_coff) \' >> .dep2a; \
+ if [ x$${valid} = xyes ]; then \
+ echo '$$(DEP_'"$${c}"'_ecoff) \' >> .dep2a; \
+ else true; fi; \
+ echo '$$(DEP_'"$${c}"'_elf)' >> .dep2a; \
+ else true; fi; \
+ done
+ mv -f .dep2a .dep2
+
+dep.sed: dep-in.sed config.status
+ srcdir=`cd $(srcdir); pwd`; \
+ sed <$(srcdir)/dep-in.sed >dep.sed \
+ -e "s!@INCDIR@!$${srcdir}/../include!" \
+ -e "s!@BFDDIR@!$${srcdir}/../bfd!" \
+ -e "s!@SRCDIR@!$${srcdir}!"
+
+dep: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
+ cat .dep >> tmp-Makefile
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
+
+dep-in: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
+ cat .dep >> tmp-Makefile.in
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
+
+dep-am: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
+ cat .dep >> tmp-Makefile.am
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
+
+.PHONY: dep dep-in dep-am
+
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+
+app.o: app.c
+as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \
+ sb.h macro.h
+atof-generic.o: atof-generic.c
+bignum-copy.o: bignum-copy.c
+cond.o: cond.c macro.h sb.h $(INCDIR)/obstack.h
+depend.o: depend.c
+ecoff.o: ecoff.c
+ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h
+expr.o: expr.c $(INCDIR)/obstack.h
+flonum-copy.o: flonum-copy.c
+flonum-konst.o: flonum-konst.c
+flonum-mult.o: flonum-mult.c
+frags.o: frags.c subsegs.h $(INCDIR)/obstack.h
+hash.o: hash.c
+input-file.o: input-file.c input-file.h
+input-scrub.o: input-scrub.c input-file.h sb.h
+listing.o: listing.c input-file.h subsegs.h
+literal.o: literal.c subsegs.h $(INCDIR)/obstack.h
+macro.o: macro.c sb.h macro.h
+messages.o: messages.c
+output-file.o: output-file.c output-file.h
+read.o: read.c subsegs.h $(INCDIR)/obstack.h sb.h macro.h \
+ ecoff.h
+sb.o: sb.c sb.h
+stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
+subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h
+symbols.o: symbols.c $(INCDIR)/obstack.h subsegs.h
+write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h
+gasp.o: gasp.c sb.h macro.h
+e-i386coff.o: $(srcdir)/config/e-i386coff.c emul.h \
+ emul-target.h
+e-i386elf.o: $(srcdir)/config/e-i386elf.c emul.h emul-target.h
+e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul.h \
+ emul-target.h
+e-mipself.o: $(srcdir)/config/e-mipself.c emul.h emul-target.h
+
+TCDEP_a29k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-a29k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/a29k.h
+TCDEP_a29k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-a29k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/opcode/a29k.h
+TCDEP_a29k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h $(INCDIR)/opcode/a29k.h
+TCDEP_alpha_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-alpha.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/alpha.h \
+ $(srcdir)/config/atof-vax.c
+TCDEP_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \
+ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/alpha.h \
+ $(srcdir)/config/atof-vax.c
+TCDEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h \
+ $(srcdir)/config/atof-vax.c
+TCDEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/alpha.h \
+ $(srcdir)/config/atof-vax.c
+TCDEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \
+ $(INCDIR)/elf/arc.h
+TCDEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h $(INCDIR)/elf/arc.h
+TCDEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h
+TCDEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h
+TCDEP_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h subsegs.h \
+ $(INCDIR)/obstack.h
+TCDEP_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \
+ $(INCDIR)/elf/ppc.h
+TCDEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h $(INCDIR)/elf/ppc.h
+TCDEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h
+TCDEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h
+TCDEP_h8500_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8500.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h
+TCDEP_h8500_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h subsegs.h \
+ $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h
+TCDEP_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/libbfd.h \
+ $(INCDIR)/opcode/hppa.h
+TCDEP_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \
+ $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h subsegs.h \
+ $(INCDIR)/obstack.h $(BFDDIR)/libbfd.h $(INCDIR)/opcode/hppa.h
+TCDEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
+ $(INCDIR)/opcode/i386.h
+TCDEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i386.h
+TCDEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/i386.h
+TCDEP_i860_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i860.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/i860.h
+TCDEP_i860_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i860.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/opcode/i860.h
+TCDEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h $(INCDIR)/opcode/i860.h
+TCDEP_i960_bout = $(srcdir)/config/obj-bout.h $(srcdir)/config/tc-i960.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h
+TCDEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h
+TCDEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h $(INCDIR)/obstack.h \
+ $(INCDIR)/opcode/i960.h
+TCDEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/symcat.h cgen-opc.h \
+ $(srcdir)/../opcodes/m32r-opc.h $(INCDIR)/opcode/cgen.h
+TCDEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/symcat.h cgen-opc.h $(srcdir)/../opcodes/m32r-opc.h \
+ $(INCDIR)/opcode/cgen.h
+TCDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
+ subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
+TCDEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h \
+ $(srcdir)/config/m68k-parse.h
+TCDEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/obstack.h \
+ subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
+TCDEP_m68k_hp300 = $(srcdir)/config/obj-hp300.h $(srcdir)/config/obj-aout.h \
+ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h \
+ $(srcdir)/config/m68k-parse.h
+TCDEP_m88k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m88k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m88k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.h
+TCDEP_m88k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h subsegs.h \
+ $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.h
+TCDEP_mips_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-mips.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
+ $(INCDIR)/opcode/mips.h itbl-ops.h ecoff.h $(INCDIR)/coff/sym.h \
+ $(INCDIR)/coff/ecoff.h
+TCDEP_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mips.h \
+ itbl-ops.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
+TCDEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
+ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mips.h \
+ itbl-ops.h
+TCDEP_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/mips.h itbl-ops.h \
+ $(INCDIR)/elf/mips.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
+TCDEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10200.h
+TCDEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10200.h
+TCDEP_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h
+TCDEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h
+TCDEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \
+ $(INCDIR)/obstack.h
+TCDEP_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h
+TCDEP_ns32k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h $(INCDIR)/opcode/ns32k.h \
+ $(INCDIR)/obstack.h
+TCDEP_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ppc.h
+TCDEP_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/ppc.h $(INCDIR)/elf/ppc.h
+TCDEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h
+TCDEP_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h subsegs.h \
+ $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h
+TCDEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
+ $(INCDIR)/opcode/sparc.h
+TCDEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h
+TCDEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h $(INCDIR)/elf/sparc.h
+TCDEP_tahoe_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tahoe.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
+ $(INCDIR)/opcode/tahoe.h
+TCDEP_tahoe_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tahoe.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h
+TCDEP_tahoe_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h $(INCDIR)/obstack.h \
+ $(INCDIR)/opcode/tahoe.h
+TCDEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic30.h
+TCDEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic30.h
+TCDEP_tic30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h $(INCDIR)/opcode/tic30.h
+TCDEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/vax.h
+TCDEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h $(INCDIR)/opcode/vax.h
+TCDEP_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h $(srcdir)/config/vax-inst.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/vax.h
+TCDEP_vax_vms = $(srcdir)/config/obj-vms.h $(srcdir)/config/tc-vax.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(srcdir)/config/vax-inst.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/vax.h
+TCDEP_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h
+TCDEP_w65_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h subsegs.h \
+ $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h
+TCDEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h
+TCDEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h
+TCDEP_z8k_coff = $(srcdir)/../opcodes/z8k-opc.h $(srcdir)/config/obj-coff.h \
+ $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/z8k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+TCDEP_z8k_elf = $(srcdir)/../opcodes/z8k-opc.h $(srcdir)/config/obj-elf.h \
+ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h
+TCDEP_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \
+ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \
+ $(BFDDIR)/som.h
+TCDEP_i386_multi = $(TCDEP_i386_coff) $(TCDEP_i386_elf)
+TCDEP_mips_multi = $(TCDEP_mips_coff) $(TCDEP_mips_ecoff) \
+ $(TCDEP_mips_elf)
+OBJDEP_a29k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-a29k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_a29k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-a29k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_a29k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_alpha_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-alpha.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \
+ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(BFDDIR)/libecoff.h
+OBJDEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h subsegs.h \
+ $(INCDIR)/obstack.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
+ $(INCDIR)/elf/alpha.h $(INCDIR)/aout/aout64.h
+OBJDEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h
+OBJDEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_h8500_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8500.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_h8500_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \
+ $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_i860_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i860.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_i860_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i860.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_i960_bout = $(srcdir)/config/obj-bout.h $(srcdir)/config/tc-i960.h \
+ $(INCDIR)/obstack.h
+OBJDEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_m68k_hp300 = $(srcdir)/config/obj-aout.c $(srcdir)/config/obj-hp300.h \
+ $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_m88k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m88k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m88k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_m88k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_mips_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-mips.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
+ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(BFDDIR)/libecoff.h
+OBJDEP_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h subsegs.h \
+ $(INCDIR)/obstack.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
+ $(INCDIR)/elf/mips.h $(INCDIR)/aout/aout64.h
+OBJDEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_ns32k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/elf/ppc.h $(INCDIR)/aout/aout64.h
+OBJDEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_tahoe_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tahoe.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_tahoe_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tahoe.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_tahoe_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_tic30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_vax_vms = $(srcdir)/config/obj-vms.h $(srcdir)/config/tc-vax.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def subsegs.h \
+ $(INCDIR)/obstack.h
+OBJDEP_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_w65_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_z8k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \
+ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
+OBJDEP_i386_multi = $(OBJDEP_i386_coff) $(OBJDEP_i386_elf)
+OBJDEP_mips_multi = $(OBJDEP_mips_coff) $(OBJDEP_mips_ecoff) \
+ $(OBJDEP_mips_elf)
+DEP_a29k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-a29k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_a29k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-a29k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_a29k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h
+DEP_alpha_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-alpha.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \
+ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
+DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h
+DEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h
+DEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h
+DEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h
+DEP_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h
+DEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h
+DEP_h8500_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8500.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_h8500_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h
+DEP_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \
+ $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h
+DEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h
+DEP_i860_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i860.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_i860_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i860.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h
+DEP_i960_bout = $(srcdir)/config/obj-bout.h $(srcdir)/config/tc-i960.h
+DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h
+DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h
+DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h
+DEP_m68k_hp300 = $(srcdir)/config/obj-hp300.h $(srcdir)/config/obj-aout.h \
+ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_m88k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m88k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m88k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_m88k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h
+DEP_mips_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-mips.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
+ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
+DEP_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h
+DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h
+DEP_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h
+DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_ns32k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h
+DEP_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h
+DEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h
+DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h
+DEP_tahoe_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tahoe.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_tahoe_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tahoe.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_tahoe_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h
+DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h
+DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h
+DEP_vax_vms = $(srcdir)/config/obj-vms.h $(srcdir)/config/tc-vax.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
+DEP_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_w65_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h
+DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h
+DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_z8k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h
+DEP_hppa_som = $(BFDDIR)/som.h
+DEP_i386_multi = $(DEP_i386_coff) $(DEP_i386_elf)
+DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \
+ $(DEP_mips_elf)
+$(OBJS): $(DEP_@target_cpu_type@_@obj_format@)
+$(TARG_CPU_O): $(TCDEP_@target_cpu_type@_@obj_format@)
+$(OBJ_FORMAT_O): $(OBJDEP_@target_cpu_type@_@obj_format@)
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/contrib/binutils/gas/Makefile.in b/contrib/binutils/gas/Makefile.in
index f381c3f..51eb930 100644
--- a/contrib/binutils/gas/Makefile.in
+++ b/contrib/binutils/gas/Makefile.in
@@ -1,115 +1,96 @@
-# Makefile for GNU Assembler
-# Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 1997
-# Free Software Foundation, Inc.
+# Makefile.in generated automatically by automake 1.2e from Makefile.am
-# This file is part of GNU GAS.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
-# GNU GAS is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-# GNU GAS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-# You should have received a copy of the GNU General Public License
-# along with GNU GAS; see the file COPYING. If not, write to the Free
-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+SHELL = @SHELL@
-# The targets for external use include:
-# all, doc, proto, install, uninstall, includes, TAGS,
-# clean, mostlyclean, distclean, realclean, stage1, stage2, stage3, stage4.
-
-# Variables that exist for you to override.
-# See below for how to change them for certain systems.
-
-VPATH = @srcdir@
srcdir = @srcdir@
-srcroot = $(srcdir)/..
-
-target_alias = @target_alias@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
prefix = @prefix@
-
-program_transform_name = @program_transform_name@
exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-tooldir = $(exec_prefix)/$(target_alias)
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
datadir = @datadir@
-mandir = @mandir@
-man1dir = $(mandir)/man1
-man2dir = $(mandir)/man2
-man3dir = $(mandir)/man3
-man4dir = $(mandir)/man4
-man5dir = $(mandir)/man5
-man6dir = $(mandir)/man6
-man7dir = $(mandir)/man7
-man8dir = $(mandir)/man8
-man9dir = $(mandir)/man9
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
infodir = @infodir@
+mandir = @mandir@
includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
-VERSION=2.8.1
+top_builddir = .
-SHELL = /bin/sh
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
-INSTALL = $${srcroot}/install.sh -c
+INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
-INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
-
-DISTSTUFF= make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c
-
-AR = ar
-AR_FLAGS = qv
-BISON = bison -y
-BISONFLAGS =
-LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
-LEXFLAGS =
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-RANLIB = ranlib
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+ALL_OBJ_DEPS = @ALL_OBJ_DEPS@
+BFDLIB = @BFDLIB@
CC = @CC@
-HLDFLAGS = @HLDFLAGS@
-HLDENV = @HLDENV@
-RPATH_ENVVAR = @RPATH_ENVVAR@
-CFLAGS = -g
-LDFLAGS =
-DEP = mkdep
-
-MAKEOVERRIDES=
+EXEEXT = @EXEEXT@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OPCODES_LIB = @OPCODES_LIB@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+atof = @atof@
+extra_objects = @extra_objects@
+obj_format = @obj_format@
+target_cpu_type = @target_cpu_type@
+te_file = @te_file@
+
+AUTOMAKE_OPTIONS = cygnus dejagnu
+
+SUBDIRS = doc
-EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
- echo $${rootme}/../expect/expect ; \
- else echo expect ; fi`
+tooldir = $(exec_prefix)/$(target_alias)
-FLAGS_TO_PASS = \
- "prefix=$(prefix)" \
- "exec_prefix=$(exec_prefix)" \
- "tooldir=$(tooldir)" \
- "AR=$(AR)" \
- "AR_FLAGS=$(AR_FLAGS)" \
- "CC=$(CC)" \
- "CFLAGS=$(CFLAGS)" \
- "RANLIB=$(RANLIB)" \
- "LOADLIBES=$(LOADLIBES)" \
- "LDFLAGS=$(LDFLAGS)" \
- "BISON=$(BISON)" \
- "LEX=$(LEX)" \
- "MAKEINFO=$(MAKEINFO)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
+YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
+LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
-RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
- echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \
- fi`
-RUNTESTFLAGS=
+DEP = mkdep
TARG_CPU = @target_cpu_type@
TARG_CPU_C = $(srcdir)/config/tc-@target_cpu_type@.c
@@ -133,6 +114,7 @@ IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o
CPU_TYPES = \
a29k \
alpha \
+ arc \
arm \
d10v \
h8300 \
@@ -152,8 +134,10 @@ CPU_TYPES = \
sh \
sparc \
tahoe \
+ tic30 \
vax \
w65 \
+ v850 \
z8k
# Object format types. This is only used for dependency information.
@@ -180,7 +164,7 @@ CPU_OBJ_VALID = \
case $$o in \
aout) \
case $$c in \
- a29k | arm | i386 | i860 | m68k | mips | ns32k | sparc | tahoe | vax) \
+ a29k | arm | i386 | i860 | m68k | mips | ns32k | sparc | tahoe | tic30 | vax) \
valid=yes ;; \
esac ;; \
bout) \
@@ -217,23 +201,23 @@ CPU_MULTI_VALID = \
# Regular source files.
-CFILES = \
+GAS_CFILES = \
app.c \
as.c \
atof-generic.c \
bignum-copy.c \
cond.c \
+ depend.c \
ecoff.c \
+ ehopt.c \
expr.c \
flonum-copy.c \
flonum-konst.c \
flonum-mult.c \
frags.c \
- gasp.c \
hash.c \
input-file.c \
input-scrub.c \
- itbl-ops.c \
listing.c \
literal.c \
macro.c \
@@ -246,6 +230,8 @@ CFILES = \
symbols.c \
write.c
+CFILES = $(GAS_CFILES) gasp.c itbl-ops.c
+
HFILES = \
as.h \
bignum.h \
@@ -276,6 +262,7 @@ HFILES = \
TARGET_CPU_CFILES = \
config/tc-a29k.c \
config/tc-alpha.c \
+ config/tc-arc.c \
config/tc-arm.c \
config/tc-d10v.c \
config/tc-h8300.c \
@@ -295,13 +282,16 @@ TARGET_CPU_CFILES = \
config/tc-sh.c \
config/tc-sparc.c \
config/tc-tahoe.c \
+ config/tc-tic30.c \
config/tc-vax.c \
config/tc-w65.c \
+ config/tc-v850.c \
config/tc-z8k.c
TARGET_CPU_HFILES = \
config/tc-a29k.h \
config/tc-alpha.h \
+ config/tc-arc.h \
config/tc-arm.h \
config/tc-d10v.h \
config/tc-h8300.h \
@@ -321,8 +311,10 @@ TARGET_CPU_HFILES = \
config/tc-sh.h \
config/tc-sparc.h \
config/tc-tahoe.h \
+ config/tc-tic30.h \
config/tc-vax.h \
config/tc-w65.h \
+ config/tc-v850.h \
config/tc-z8k.h
# OBJ files in config
@@ -392,17 +384,20 @@ MULTI_CFILES = \
config/e-mipsecoff.c \
config/e-mipself.c
-# @target_frag@
-
-OBJS = \
+CONFIG_OBJS = \
$(TARG_CPU_O) \
$(OBJ_FORMAT_O) \
$(ATOF_TARG_O) \
+ $(extra_objects)
+
+GENERIC_OBJS = \
app.o \
as.o \
atof-generic.o \
bignum-copy.o \
cond.o \
+ depend.o \
+ ehopt.o \
expr.o \
flonum-konst.o \
flonum-copy.o \
@@ -422,379 +417,84 @@ OBJS = \
ecoff.o \
stabs.o \
sb.o \
- macro.o \
- @extra_objects@
+ macro.o
-GASPOBJS = \
- gasp.o \
- macro.o \
- sb.o \
- hash.o
+OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
-all: .gdbinit as.new gasp.new
- @srcroot=`cd $(srcroot); pwd`; export srcroot; \
- (cd doc ; $(MAKE) $(FLAGS_TO_PASS) all)
+noinst_PROGRAMS = as-new gasp-new
+noinst_SCRIPTS = .gdbinit
-dvi info install-info clean-info:
- @srcroot=`cd $(srcroot); pwd`; export srcroot; \
- (cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@)
+EXTRA_DIST = make-gas.com
-make-gas.com: stamp-mk.com
-stamp-mk.com: vmsconf.sh Makefile
- sh $(srcdir)/vmsconf.sh $(OBJS) > new-make.com
- $(SHELL) $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com
- touch stamp-mk.com
+DISTSTUFF = make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c
-# Now figure out from those variables how to compile and link.
-
-# This is the variable actually used when we compile.
-ALL_CFLAGS = -D_GNU_SOURCE $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES)
-
-# How to link with both our special library facilities
-# and the system's installed libraries.
+DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-opc.h
-LIBDEPS = @OPCODES_DEP@ @BFDDEP@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a
-LIBS = @OPCODES_LIB@ @BFDLIB@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a
+# Now figure out from those variables how to compile and link.
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include
+# This is the variable actually used when we compile.
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
# subdirectory rather than in the source directory.
-INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR)
-
-# Always use -I$(srcdir)/config when compiling.
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR)
-# This tells GNU make version 3 not to export all the variables
-# defined in this file into the environment.
-.NOEXPORT:
+# This should be parallel to INCLUDES, but should replace $(srcdir)
+# with $${srcdir}, and should work in a subdirectory. This is used
+# when building dependencies, because the dependency building is done
+# in a subdirectory.
+DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd
-# Files to be copied away after each stage in building.
-STAGESTUFF = *.o as.new gasp.new
-
-$(OBJS): @ALL_OBJ_DEPS@
-
-as.new: $(OBJS) $(LIBDEPS)
- $(HLDENV) $(CC) $(HLDFLAGS) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
-
-# Stuff that every object file depends upon. If anything is removed
-# from this list, remove it from dep-in.sed as well.
-$(OBJS): config.h as.h $(TARG_ENV_H) $(OBJ_FORMAT_H) $(TARG_CPU_H) flonum.h \
- expr.h struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h \
- obj.h listing.h bignum.h bit_fix.h $(INCDIR)/libiberty.h
-
-gasp.new: $(GASPOBJS) ../libiberty/libiberty.a
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gasp.new $(GASPOBJS) ../libiberty/libiberty.a $(LOADLIBES)
-
-installcheck:
- @echo No installcheck target is available yet for the GNU assembler.
+# How to link with both our special library facilities
+# and the system's installed libraries.
-site.exp: ./Makefile
- @echo "Making a new config file..."
- -@rm -f ./tmp?
- @touch site.exp
- -@mv site.exp site.bak
- @echo "## these variables are automatically generated by make ##" > ./tmp0
- @echo "# Do not edit here. If you wish to override these values," >> ./tmp0
- @echo "# do so in the last section." >> ./tmp0
- @echo set host_os @host_os@ >> ./tmp0
- @echo set host_alias @host_alias@ >> ./tmp0
- @echo set host_cpu @host_cpu@ >> ./tmp0
- @echo set host_vendor @host_vendor@ >> ./tmp0
- @echo set target_os @target_os@ >> ./tmp0
- @echo set target_alias @target_alias@ >> ./tmp0
- @echo set target_cpu @target_cpu@ >> ./tmp0
- @echo set target_vendor @target_vendor@ >> ./tmp0
- @echo set host_triplet @host@ >> ./tmp0
- @echo set target_triplet @target@ >> ./tmp0
- @echo set target_canonical @target@ >> ./tmp0
- @echo set srcdir ${srcdir}/testsuite >> ./tmp0
- @echo set exec_prefix ${exec_prefix} >> ./tmp0
- @echo set objdir `pwd` >> ./tmp0
- @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
- @sed -e '1,/^## All variables above are.*##/ d' < site.bak >> ./tmp0
- @mv -f ./tmp0 site.exp
-
-check: site.exp
- if [ -d testsuite ]; then \
- true; \
- else \
- mkdir testsuite; \
- fi
- rm -f testsuite/site.exp
- cp site.exp testsuite/site.exp
- rootme=`pwd`; export rootme; \
- srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
- $(RPATH_ENVVAR)=$$rootme/../bfd:$$rootme/../opcodes:$$$(RPATH_ENVVAR); \
- export $(RPATH_ENVVAR); \
- cd testsuite; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../expect/expect ] ; then \
- TCL_LIBRARY=$${srcdir}/../tcl/library ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool gas --srcdir $${srcdir}/testsuite $(RUNTESTFLAGS)
-
-config.status: configure
- $(SHELL) config.status --recheck
-
-config.h: config-stamp ; @true
-config-stamp: Makefile conf
- -rm -f config.new config-stamp
- echo '/* config.h. Generated automatically by make. */' > config.new
- echo '#ifndef GAS_VERSION' >> config.new
- echo '#define GAS_VERSION "$(VERSION)"' >> config.new
- echo '' >> config.new
- cat conf >> config.new
- echo '#endif /* GAS_VERSION */' >> config.new
- $(SHELL) $(srcdir)/../move-if-change config.new config.h
- touch config-stamp
+GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a
-# The implicit .c.o rule doesn't work for these, perhaps because of
-# the variables, or perhaps because the sources are not on vpath.
-$(TARG_CPU_O): $(TARG_CPU_C) $(TARG_CPU_DEP_@target_cpu_type@)
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(TARG_CPU_C)
-$(ATOF_TARG_O): $(ATOF_TARG_C)
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(ATOF_TARG_C)
+# Files to be copied away after each stage in building.
+STAGESTUFF = *.o $(noinst_PROGRAMS)
-# ecoff.c only has full dependencies when ECOFF_DEBUGGING is defined,
-# so the automatic dependency stuff doesn't work.
-ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/symconst.h \
- $(INCDIR)/aout/stab_gnu.h
+as_new_SOURCES = $(GAS_CFILES)
+as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
+ $(extra_objects) $(GASLIBS)
+as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
+ $(extra_objects) $(GASLIBS)
-# We need all these explicit rules for the multi stuff. Because of
-# these rules, we don't need one for OBJ_FORMAT_O.
+gasp_new_SOURCES = gasp.c macro.c sb.c hash.c
+gasp_new_LDADD = ../libiberty/libiberty.a
-obj-aout.o : $(srcdir)/config/obj-aout.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-aout.c
-obj-bout.o : $(srcdir)/config/obj-bout.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-bout.c
-obj-coff.o: $(srcdir)/config/obj-coff.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-coff.c
-obj-ecoff.o : $(srcdir)/config/obj-ecoff.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-ecoff.c
-obj-elf.o : $(srcdir)/config/obj-elf.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-elf.c
-obj-evax.o : $(srcdir)/config/obj-evax.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-evax.c
-obj-hp300.o : $(srcdir)/config/obj-hp300.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-hp300.c
-obj-ieee.o : $(srcdir)/config/obj-ieee.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-ieee.c
-obj-multi.o : $(srcdir)/config/obj-multi.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-multi.c
-obj-som.o : $(srcdir)/config/obj-som.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-som.c
-obj-vms.o : $(srcdir)/config/obj-vms.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-vms.c
+EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
+ echo $${rootme}/../expect/expect ; \
+ else echo expect ; fi`
-e-mipself.o : $(srcdir)/config/e-mipself.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipself.c
-e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipsecoff.c
-e-i386coff.o: $(srcdir)/config/e-i386coff.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-i386coff.c
-e-i386elf.o: $(srcdir)/config/e-i386elf.c
- $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-i386elf.c
+RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
+ echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \
+ fi`
+RUNTESTFLAGS=
# The m68k operand parser.
-# Depend upon itbl-parse.c to serialize a parallel make.
-m68k-parse.c: $(srcdir)/config/m68k-parse.y itbl-parse.c
- $(BISON) $(BISONFLAGS) $(srcdir)/config/m68k-parse.y
- mv -f y.tab.c m68k-parse.c
-m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h
-
-# The instruction table specification lexical analyzer and parser.
-
-itbl-lex.c: $(srcdir)/itbl-lex.l
- $(LEX) $(LEXFLAGS) $(srcdir)/itbl-lex.l
- mv -f lex.yy.c itbl-lex.c
-
-itbl-lex.o: itbl-lex.c itbl-parse.h
-
-itbl-parse.c: $(srcdir)/itbl-parse.y
- $(BISON) -d $(BISONFLAGS) $(srcdir)/itbl-parse.y
- mv -f y.tab.c itbl-parse.c
- mv -f y.tab.h itbl-parse.h
-
-itbl-parse.h: itbl-parse.c
-
-itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h
-
-itbl-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
+EXTRA_as_new_SOURCES = config/m68k-parse.y
# stand-alone itbl assembler & disassembler
-itbl-test-ops.o: $(srcdir)/itbl-ops.c \
- $(srcdir)/itbl-ops.h itbl-parse.h
- $(CC) -o itbl-test-ops.o -DSTAND_ALONE -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/itbl-ops.c
-itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c $(srcdir)/itbl-ops.h
- $(CC) -c -DSTAND_ALONE $(ALL_CFLAGS) $(INCLUDES)\
- $(srcdir)/testsuite/gas/all/itbl-test.c
-
-IT_TEST_OBJS= itbl-parse.o itbl-lex.o itbl-test-ops.o
-itbl-test: $(IT_TEST_OBJS) itbl-test.o $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o itbl-test itbl-test.o $(IT_TEST_OBJS) $(LIBS)
-
-# CGEN interface.
-
-cgen.o: cgen.c cgen-opc.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
- $(srcdir)/../opcodes/$(TARG_CPU)-opc.h
+EXTRA_PROGRAMS = itbl-test
+itbl_test_SOURCES = itbl-parse.y itbl-lex.l
+itbl_test_LDADD = itbl-test-ops.o itbl-test.o $(GASLIBS) @LEXLIB@
# Remake the info files.
-doc: $(srcdir)/as.info
-
-$(srcdir)/as.info: $(srcdir)/doc/as.texinfo
- @(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir)
-
-diststuff: $(DISTSTUFF) info
-
-clean-here:
- -rm -f $(STAGESTUFF) core stamp-mk.com
- -rm -f testsuite/*.o testsuite/*.out \
- testsuite/gas.log testsuite/gas.sum testsuite/site.exp
- -rm -rf dep.sed .tcdep .objdep .dep2 .dep1 .depa .dep .depdir
-
-clean mostlyclean: clean-here
- @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
-
-# Like clean but also delete the links made to configure gas.
-
-DISTCLEAN_HERE = config.status Makefile targ-env.h targ-cpu.h obj-format.h \
- TAGS itbl-cpu.h cgen-opc.h site.exp site.bak \
- config-stamp config.h conf config.log config.cache .gdbinit \
- testsuite/Makefile testsuite/config.status
-
-distclean: clean-here
- @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
- -rm -f $(DISTCLEAN_HERE)
-
-maintainer-clean realclean: clean-here
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
- -rm -rf $(DISTCLEAN_HERE) $(DISTSTUFF)
-
-# Entry points `install', `includes' and `uninstall'.
-
-# Copy the files into directories where they will be run.
-install:
- srcroot=`cd $(srcroot); pwd`; export srcroot; \
- $(INSTALL_XFORM) as.new $(bindir)/as; \
- $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \
- test -d $(tooldir) || mkdir $(tooldir); \
- test -d $(tooldir)/bin || mkdir $(tooldir)/bin; \
- n=`echo as | sed '$(program_transform_name)'`; \
- rm -f $(tooldir)/bin/as; \
- ln $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as
- srcroot=`cd $(srcroot); pwd`; export srcroot; \
- $(INSTALL_XFORM) gasp.new $(bindir)/gasp
-
-# Cancel installation by deleting the installed files.
-uninstall:
- -n=`t='$(program_transform_name)'; echo as | sed $$t`; \
- rm -f $(bindir)/$$n; \
- rm -f $(mandir)/$$n.1
- -n=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
- rm -f $(bindir)/$$n; \
-
-# These exist for maintenance purposes.
-
-tags TAGS: force
- etags $(HFILES) $(CFILES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in
-
-bootstrap: as.new force
- $(MAKE) stage1
- rm -f stage && ln -s stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) stage2
- rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) comparison against=stage2
-
-bootstrap2: force
- rm -f stage && ln -s stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) stage2
- rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) comparison against=stage2
+MOSTLYCLEANFILES = $(STAGESTUFF) core stamp-mk.com \
+ testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
+ testsuite/site.exp site.bak site.exp stage stage1 stage2
-bootstrap3: force
- rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
- $(MAKE) comparison against=stage2
-
-# Copy the object files from a particular stage into a subdirectory.
-stage1: force
- -mkdir stage1
- -mv $(STAGESTUFF) stage1
- if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi
-
-stage2: force
- -mkdir stage2
- -mv $(STAGESTUFF) stage2
- if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi
-
-stage3: force
- -mkdir stage3
- -mv $(STAGESTUFF) stage3
- if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi
+CLEANFILES = dep.sed .tcdep .objdep .dep2 .dep1 .depa .dep .depdir
against=stage2
-# This rule is derived from corresponding code in the Makefile.in for gcc.
-# The "tail +16c" is to bypass headers which may include timestamps or
-# temporary assembly file names.
-comparison: force
- x=0 ; \
- for file in *.o ; do \
- tail +16c ./$$file > tmp-foo1; \
- if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
- if cmp tmp-foo1 tmp-foo2 ; then \
- true ; \
- else \
- echo $$file differs ; \
- x=1 ; \
- fi ; \
- else true; fi ; \
- done ; \
- exit $$x
- -rm -f tmp-foo*
-
-de-stage1: force
- - (cd stage1 ; rm -f as ; mv -f * ..)
- - rmdir stage1
-
-de-stage2: force
- - (cd stage2 ; rm -f as ; mv -f * ..)
- - rmdir stage2
-
-de-stage3: force
- - (cd stage3 ; rm -f as ; mv -f * ..)
- - rmdir stage3
-
-#In GNU Make, ignore whether `stage*' exists.
-.PHONY: stage1 stage2 stage3 stage4 clean mostlyclean realclean distclean
-.PHONY: TAGS bootstrap
-
-force:
-
-Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
- $(srcdir)/configure.in config.status conf.in
- $(SHELL) ./config.status
-.gdbinit: $(srcdir)/gdbinit.in config.status
- $(SHELL) ./config.status
-
# Automatic dependency computation. This is a real pain, because the
# dependencies change based on target_cpu_type and obj_format. We
# currently ignore any dependencies caused by emulation files.
@@ -802,221 +502,6 @@ Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
$(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES)
-.dep: dep.sed $(DEP_FILE_DEPS) .tcdep .objdep .dep2
- rm -f .dep1
- $(MAKE) DEP=$(DEP) .dep1
- rm -rf .depdir
- sed -f dep.sed < .dep1 > .depa
- sed -f dep.sed < .tcdep >> .depa
- sed -f dep.sed < .objdep >> .depa
- sed -f dep.sed < .dep2 >> .depa
- echo '$$(OBJS): $$(DEP_@target''_cpu_type@_@obj''_format@)' >> .depa
- echo '$$(TARG_CPU_O): $$(TCDEP_@target''_cpu_type@_@obj''_format@)' >> .depa
- echo '$$(OBJ_FORMAT_O): $$(OBJDEP_@target''_cpu_type@_@obj''_format@)' >> .depa
- echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> .depa
- $(SHELL) $(srcdir)/../move-if-change .depa .dep
-
-# This rule needs a mkdep that runs "gcc -MM".
-# FIXME: This only works correctly if $(srcdir) is an absolute path.
-.dep1: $(CFILES) $(MULTI_CFILES)
- if [ -d .depdir ]; then true; else mkdir .depdir; fi
- cd .depdir; \
- echo '' > targ-cpu.h; \
- echo '' > obj-format.h; \
- echo '' > targ-env.h; \
- echo '' > itbl-cpu.h; \
- echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
- $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$(srcdir) -I../../bfd $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $?
- mv -f .depdir/.dep .dep1
-
-# Work out the special dependencies for the tc-*.c files.
-.tcdep: $(TARGET_CPU_CFILES)
- rm -f .tcdepa
- if [ -d .depdir ]; then true; else mkdir .depdir; fi
- cd .depdir; \
- for c in $(CPU_TYPES); do \
- for o in $(OBJ_FORMATS); do \
- $(CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
- echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
- echo '#include "te-generic.h"' > targ-env.h; \
- echo '' > itbl-cpu.h; \
- echo '#include "opcodes/'"$${c}"'-opc.h"' > cgen-opc.h; \
- rm -f dummy.c; \
- cp $(srcdir)/config/tc-$${c}.c dummy.c; \
- echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
- $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$(srcdir) -I../../bfd $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) dummy.c; \
- sed -e "s/dummy.o: dummy.c/TCDEP_$${c}_$${o} =/" \
- -e '1,/DO NOT PUT ANYTHING AFTER/d' \
- -e '/IF YOU PUT ANYTHING/,$$d' \
- -e '/^$$/d' < .dep >> ../.tcdepa; \
- rm -f dummy.c; \
- else true; fi; \
- done; \
- done
- echo 'TCDEP_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \' >> .tcdepa
- echo ' $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h \' >> .tcdepa
- echo ' $(INCDIR)/opcode/hppa.h $(BFDDIR)/som.h' >> .tcdepa
- # We don't try to handle all multi cases.
- for c in $(CPU_TYPES); do \
- $(CPU_MULTI_VALID) \
- if [ x$${valid} = xyes ]; then \
- o=ecoff; \
- $(CPU_OBJ_VALID) \
- echo 'TCDEP_'"$${c}"'_multi = \' >> .tcdepa; \
- echo '$$(TCDEP_'"$${c}"'_coff) \' >> .tcdepa; \
- if [ x$${valid} = xyes ]; then \
- echo '$$(TCDEP_'"$${c}"'_ecoff) \' >> .tcdepa; \
- else true; fi; \
- echo '$$(TCDEP_'"$${c}"'_elf)' >> .tcdepa; \
- else true; fi; \
- done
- mv -f .tcdepa .tcdep
-
-# Work out the special dependencies for the obj-*.c files.
-.objdep: $(OBJ_FORMAT_CFILES)
- rm -f .objdepa
- if [ -d .depdir ]; then true; else mkdir .depdir; fi
- cd .depdir; \
- for c in $(CPU_TYPES); do \
- for o in $(OBJ_FORMATS); do \
- $(CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
- echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
- echo '#include "te-generic.h"' > targ-env.h; \
- echo '' > itbl-cpu.h; \
- rm -f dummy.c; \
- cp $(srcdir)/config/obj-$${o}.c dummy.c; \
- echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
- $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$(srcdir) -I../../bfd $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) dummy.c; \
- sed -e "s/dummy.o: dummy.c/OBJDEP_$${c}_$${o} =/" \
- -e '1,/DO NOT PUT ANYTHING AFTER/d' \
- -e '/IF YOU PUT ANYTHING/,$$d' \
- -e '/^$$/d' < .dep >> ../.objdepa; \
- rm -f dummy.c; \
- else true; fi; \
- done; \
- done
- echo 'OBJDEP_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \' >> .objdepa
- echo ' $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h \' >> .objdepa
- echo ' $(BFDDIR)/som.h $(INCDIR)/aout/stab_gnu.h \' >> .objdepa
- echo ' $(INCDIR)/aout/stab.def' >> .objdepa
- # We don't try to handle all multi cases.
- for c in $(CPU_TYPES); do \
- $(CPU_MULTI_VALID) \
- if [ x$${valid} = xyes ]; then \
- o=ecoff; \
- $(CPU_OBJ_VALID) \
- echo 'OBJDEP_'"$${c}"'_multi = \' >> .objdepa; \
- echo '$$(OBJDEP_'"$${c}"'_coff) \' >> .objdepa; \
- if [ x$${valid} = xyes ]; then \
- echo '$$(OBJDEP_'"$${c}"'_ecoff) \' >> .objdepa; \
- else true; fi; \
- echo '$$(OBJDEP_'"$${c}"'_elf)' >> .objdepa; \
- else true; fi; \
- done
- mv -f .objdepa .objdep
-
-# Work out the dependencies for each CPU/OBJ combination.
-# Note that SOM is a special case, because it only works native.
-# FIXME: This only works correctly if $(srcdir) is an absolute path.
-.dep2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES)
- rm -f .dep2a
- if [ -d .depdir ]; then true; else mkdir .depdir; fi
- cd .depdir; \
- for c in $(CPU_TYPES); do \
- for o in $(OBJ_FORMATS); do \
- $(CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
- echo '#include "obj-'"$${o}"'.h"' > dummy.c; \
- echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
- $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$(srcdir) -I../../bfd $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) dummy.c; \
- sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" \
- -e '1,/DO NOT PUT ANYTHING AFTER/d' \
- -e '/IF YOU PUT ANYTHING/,$$d' \
- -e '/^$$/d' < .dep >> ../.dep2a; \
- else true; fi; \
- done; \
- done
- echo 'DEP_hppa_som = $(srcdir)/../bfd/som.h' >> .dep2a
- # We don't try to handle all multi cases.
- for c in $(CPU_TYPES); do \
- $(CPU_MULTI_VALID) \
- if [ x$${valid} = xyes ]; then \
- o=ecoff; \
- $(CPU_OBJ_VALID) \
- echo 'DEP_'"$${c}"'_multi = \' >> .dep2a; \
- echo '$$(DEP_'"$${c}"'_coff) \' >> .dep2a; \
- if [ x$${valid} = xyes ]; then \
- echo '$$(DEP_'"$${c}"'_ecoff) \' >> .dep2a; \
- else true; fi; \
- echo '$$(DEP_'"$${c}"'_elf)' >> .dep2a; \
- else true; fi; \
- done
- mv -f .dep2a .dep2
-
-dep.sed: dep-in.sed config.status
- sed <$(srcdir)/dep-in.sed >dep.sed \
- -e 's!@INCDIR@!$(INCDIR)!' \
- -e 's!@BFDDIR@!$(BFDDIR)!' \
- -e 's!@SRCDIR@!$(srcdir)!'
-
-dep: .dep
- sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
- cat .dep >> tmp-Makefile
- $(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
-
-dep-in: .dep
- sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
- cat .dep >> tmp-Makefile.in
- $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
-
-.PHONY: dep dep-in
-
-
-# DO NOT DELETE THIS LINE -- mkdep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-app.o: app.c
-as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \
- sb.h macro.h
-atof-generic.o: atof-generic.c
-bignum-copy.o: bignum-copy.c
-cond.o: cond.c $(INCDIR)/obstack.h
-ecoff.o: ecoff.c
-expr.o: expr.c $(INCDIR)/obstack.h
-flonum-copy.o: flonum-copy.c
-flonum-konst.o: flonum-konst.c
-flonum-mult.o: flonum-mult.c
-frags.o: frags.c subsegs.h $(INCDIR)/obstack.h
-gasp.o: gasp.c sb.h macro.h
-hash.o: hash.c
-input-file.o: input-file.c input-file.h
-input-scrub.o: input-scrub.c input-file.h sb.h
-listing.o: listing.c input-file.h subsegs.h
-literal.o: literal.c subsegs.h $(INCDIR)/obstack.h
-macro.o: macro.c sb.h macro.h
-messages.o: messages.c
-output-file.o: output-file.c output-file.h
-read.o: read.c subsegs.h $(INCDIR)/obstack.h sb.h macro.h \
- ecoff.h
-sb.o: sb.c sb.h
-stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \
- $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
-subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h
-symbols.o: symbols.c $(INCDIR)/obstack.h subsegs.h
-write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h
-e-i386coff.o: $(srcdir)/config/e-i386coff.c emul.h \
- emul-target.h
-e-i386elf.o: $(srcdir)/config/e-i386elf.c emul.h emul-target.h
-e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul.h \
- emul-target.h
-e-mipself.o: $(srcdir)/config/e-mipself.c emul.h emul-target.h
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
TCDEP_a29k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-a29k.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/a29k.h
TCDEP_a29k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-a29k.h \
@@ -1041,6 +526,14 @@ TCDEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
TCDEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/alpha.h \
$(srcdir)/config/atof-vax.c
+TCDEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \
+ $(INCDIR)/elf/arc.h
+TCDEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h $(INCDIR)/elf/arc.h
TCDEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h
TCDEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
@@ -1060,10 +553,11 @@ TCDEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h $(INCDIR)/elf/ppc.h
TCDEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/opcode/h8300.h
+ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h
TCDEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h $(INCDIR)/opcode/h8300.h
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h
TCDEP_h8500_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8500.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h
@@ -1109,12 +603,12 @@ TCDEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/opcode/i960.h
TCDEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \
$(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- subsegs.h $(INCDIR)/obstack.h cgen-opc.h $(srcdir)/../opcodes/m32r-opc.h \
- $(INCDIR)/opcode/cgen.h
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/symcat.h cgen-opc.h \
+ $(srcdir)/../opcodes/m32r-opc.h $(INCDIR)/opcode/cgen.h
TCDEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
- $(INCDIR)/obstack.h cgen-opc.h $(srcdir)/../opcodes/m32r-opc.h \
+ $(INCDIR)/obstack.h $(INCDIR)/symcat.h cgen-opc.h $(srcdir)/../opcodes/m32r-opc.h \
$(INCDIR)/opcode/cgen.h
TCDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
@@ -1202,7 +696,7 @@ TCDEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
TCDEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h $(INCDIR)/elf/sparc.h
TCDEP_tahoe_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tahoe.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
$(INCDIR)/opcode/tahoe.h
@@ -1213,6 +707,14 @@ TCDEP_tahoe_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h $(INCDIR)/obstack.h \
$(INCDIR)/opcode/tahoe.h
+TCDEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic30.h
+TCDEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic30.h
+TCDEP_tic30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h $(INCDIR)/opcode/tic30.h
TCDEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \
$(INCDIR)/obstack.h $(INCDIR)/opcode/vax.h
@@ -1233,6 +735,13 @@ TCDEP_w65_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h subsegs.h \
$(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h
+TCDEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h
+TCDEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h
TCDEP_z8k_coff = $(srcdir)/../opcodes/z8k-opc.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/z8k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
@@ -1266,8 +775,15 @@ OBJDEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h subsegs.h \
$(INCDIR)/obstack.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/aout/aout64.h
+ $(INCDIR)/elf/alpha.h $(INCDIR)/aout/aout64.h
OBJDEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h
+OBJDEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
OBJDEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/obstack.h
@@ -1437,6 +953,16 @@ OBJDEP_tahoe_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h subsegs.h \
$(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+ $(INCDIR)/obstack.h
+OBJDEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
+OBJDEP_tic30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
OBJDEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/obstack.h
@@ -1457,6 +983,13 @@ OBJDEP_w65_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h subsegs.h \
$(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
OBJDEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
@@ -1486,6 +1019,11 @@ DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h
DEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h
+DEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h
DEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
DEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
@@ -1613,6 +1151,14 @@ DEP_tahoe_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tahoe.h \
DEP_tahoe_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h
+DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
+ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
+DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h \
+ $(INCDIR)/bfdlink.h
+DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h
DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
DEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \
@@ -1628,6 +1174,11 @@ DEP_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \
DEP_w65_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h
+DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h
DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h
@@ -1638,7 +1189,830 @@ DEP_hppa_som = $(BFDDIR)/som.h
DEP_i386_multi = $(DEP_i386_coff) $(DEP_i386_elf)
DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \
$(DEP_mips_elf)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = .gdbinit
+noinst_PROGRAMS = as-new$(EXEEXT) gasp-new$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I.
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+itbl_test_OBJECTS = itbl-parse.o itbl-lex.o
+itbl_test_DEPENDENCIES = itbl-test-ops.o itbl-test.o \
+../libiberty/libiberty.a
+itbl_test_LDFLAGS =
+as_new_OBJECTS = app.o as.o atof-generic.o bignum-copy.o cond.o \
+depend.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o \
+flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o \
+literal.o macro.o messages.o output-file.o read.o sb.o stabs.o \
+subsegs.o symbols.o write.o
+as_new_LDFLAGS =
+gasp_new_OBJECTS = gasp.o macro.o sb.o hash.o
+gasp_new_DEPENDENCIES = ../libiberty/libiberty.a
+gasp_new_LDFLAGS =
+SCRIPTS = $(noinst_SCRIPTS)
+
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LEXLIB = @LEXLIB@
+YLWRAP = $(top_srcdir)/../ylwrap
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \
+acconfig.h acinclude.m4 aclocal.m4 config.in config/m68k-parse.c \
+configure configure.in gdbinit.in itbl-lex.c itbl-parse.c stamp-h.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP = --best
+SOURCES = $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(gasp_new_SOURCES)
+OBJECTS = $(itbl_test_OBJECTS) $(as_new_OBJECTS) $(gasp_new_OBJECTS)
+
+default: all
+
+.SUFFIXES:
+.SUFFIXES: .S .c .l .lo .o .s .y
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINT@ configure.in acinclude.m4
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+ @:
+stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h
+$(srcdir)/config.in: @MAINT@$(srcdir)/stamp-h.in
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f config.h
+
+maintainer-clean-hdr:
+.gdbinit: $(top_builddir)/config.status gdbinit.in
+ cd $(top_builddir) && CONFIG_FILES=$@:gdbinit.in CONFIG_HEADERS= ./config.status
+
+mostlyclean-noinstPROGRAMS:
+
+clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+
+distclean-noinstPROGRAMS:
+
+maintainer-clean-noinstPROGRAMS:
+
+.c.o:
+ $(COMPILE) -c $<
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.c.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+itbl-test$(EXEEXT): $(itbl_test_OBJECTS) $(itbl_test_DEPENDENCIES)
+ @rm -f itbl-test$(EXEEXT)
+ $(LINK) $(itbl_test_LDFLAGS) $(itbl_test_OBJECTS) $(itbl_test_LDADD) $(LIBS)
+
+as-new$(EXEEXT): $(as_new_OBJECTS) $(as_new_DEPENDENCIES)
+ @rm -f as-new$(EXEEXT)
+ $(LINK) $(as_new_LDFLAGS) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS)
+
+gasp-new$(EXEEXT): $(gasp_new_OBJECTS) $(gasp_new_DEPENDENCIES)
+ @rm -f gasp-new$(EXEEXT)
+ $(LINK) $(gasp_new_LDFLAGS) $(gasp_new_OBJECTS) $(gasp_new_LDADD) $(LIBS)
+.y.c:
+ $(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
+config/m68k-parse.h: config/m68k-parse.c
+itbl-parse.h: itbl-parse.c
+
+.l.c:
+ $(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ target=`echo $@ | sed s/-recursive//`; \
+ echo "Making $$target in $$subdir"; \
+ (cd $$subdir && $(MAKE) $$target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ done; \
+ for subdir in $$rev; do \
+ target=`echo $@ | sed s/-recursive//`; \
+ echo "Making $$target in $$subdir"; \
+ (cd $$subdir && $(MAKE) $$target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ (cd $$subdir && $(MAKE) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) \
+ && $(MAKE) dvi \
+ && $(MAKE) check \
+ && $(MAKE) install \
+ && $(MAKE) installcheck \
+ && $(MAKE) dist
+ -rm -rf $(distdir)
+ @echo "========================"; \
+ echo "$(distdir).tar.gz is ready for distribution"; \
+ echo "========================"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done
+ for subdir in $(SUBDIRS); do \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ done
+
+DEJATOOL = $(PACKAGE)
+
+RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
+site.exp: Makefile
+ @echo 'Making a new site.exp file...'
+ -@rm -f site.bak
+ @echo '## these variables are automatically generated by make ##' > $@-t
+ @echo '# Do not edit here. If you wish to override these values' >> $@-t
+ @echo '# edit the last section' >> $@-t
+ @echo 'set tool $(DEJATOOL)' >> $@-t
+ @echo 'set srcdir $(srcdir)' >> $@-t
+ @echo 'set objdir' `pwd` >> $@-t
+ @echo 'set host_alias $(host_alias)' >> $@-t
+ @echo 'set host_triplet $(host_triplet)' >> $@-t
+ @echo 'set target_alias $(target_alias)' >> $@-t
+ @echo 'set target_triplet $(target_triplet)' >> $@-t
+ @echo 'set build_alias $(build_alias)' >> $@-t
+ @echo 'set build_triplet $(build_triplet)' >> $@-t
+ @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
+ -@sed '1,/^## All variables above are.*##/ d' site.bak >> $@-t
+ -@mv site.exp site.bak
+ @mv $@-t site.exp
+info: info-recursive
+dvi: dvi-recursive
+check:
+ $(MAKE) check-recursive check-DEJAGNU
+installcheck: installcheck-recursive
+install-info: install-info-recursive
+all-recursive-am: config.h
+ $(MAKE) all-recursive
+
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) config.h
+
+install-exec-am: install-exec-local
+
+install-exec: install-exec-recursive install-exec-am
+ @$(NORMAL_INSTALL)
+
+install-data: install-data-recursive
+ @$(NORMAL_INSTALL)
+
+install: install-recursive install-exec-am
+ @:
+
+uninstall: uninstall-recursive
+
+all: all-recursive-am all-am
+
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs: installdirs-recursive
+
+
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean-am: mostlyclean-hdr mostlyclean-noinstPROGRAMS \
+ mostlyclean-compile mostlyclean-libtool \
+ mostlyclean-tags mostlyclean-generic
+
+clean-am: clean-hdr clean-noinstPROGRAMS clean-compile clean-libtool \
+ clean-tags clean-generic mostlyclean-am
+
+distclean-am: distclean-hdr distclean-noinstPROGRAMS distclean-compile \
+ distclean-libtool distclean-tags distclean-generic \
+ clean-am
+
+maintainer-clean-am: maintainer-clean-hdr \
+ maintainer-clean-noinstPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-tags maintainer-clean-generic \
+ distclean-am
+
+mostlyclean: mostlyclean-recursive mostlyclean-am
+
+clean: clean-recursive clean-am
+
+distclean: distclean-recursive distclean-am
+ -rm -f config.status
+ -rm -f libtool
+
+maintainer-clean: maintainer-clean-recursive maintainer-clean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f config.status
+
+.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
+maintainer-clean-hdr mostlyclean-noinstPROGRAMS \
+distclean-noinstPROGRAMS clean-noinstPROGRAMS \
+maintainer-clean-noinstPROGRAMS mostlyclean-compile distclean-compile \
+clean-compile maintainer-clean-compile mostlyclean-libtool \
+distclean-libtool clean-libtool maintainer-clean-libtool \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \
+info dvi installcheck install-info all-recursive-am all-am \
+install-exec-am install-exec install-data install uninstall all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+$(srcdir)/make-gas.com: stamp-mk.com
+stamp-mk.com: vmsconf.sh Makefile
+ sh $(srcdir)/vmsconf.sh $(GENERIC_OBJS) > new-make.com
+ $(SHELL) $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com
+ touch stamp-mk.com
+diststuff: $(DISTSTUFF) info
+
+$(OBJS): @ALL_OBJ_DEPS@
+
+# Stuff that every object file depends upon. If anything is removed
+# from this list, remove it from dep-in.sed as well.
+$(OBJS): config.h as.h $(TARG_ENV_H) $(OBJ_FORMAT_H) $(TARG_CPU_H) flonum.h \
+ expr.h struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h \
+ obj.h listing.h bignum.h bit_fix.h $(INCDIR)/libiberty.h
+
+check-DEJAGNU: site.exp
+ if [ -d testsuite ]; then \
+ true; \
+ else \
+ mkdir testsuite; \
+ fi
+ rm -f testsuite/site.exp
+ cp site.exp testsuite/site.exp
+ rootme=`pwd`; export rootme; \
+ srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
+ EXPECT=${EXPECT} ; export EXPECT ; \
+ if [ -f $(top_builddir)/../expect/expect ]; then \
+ TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
+ export TCL_LIBRARY; \
+ fi; \
+ runtest=$(RUNTEST); \
+ cd testsuite; \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
+ $(RUNTESTFLAGS); \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi
+
+# The implicit .c.o rule doesn't work for these, perhaps because of
+# the variables, or perhaps because the sources are not on vpath.
+$(TARG_CPU_O): $(TARG_CPU_C) $(TARG_CPU_DEP_@target_cpu_type@)
+ $(COMPILE) -c $(TARG_CPU_C)
+$(ATOF_TARG_O): $(ATOF_TARG_C)
+ $(COMPILE) -c $(ATOF_TARG_C)
+
+# ecoff.c only has full dependencies when ECOFF_DEBUGGING is defined,
+# so the automatic dependency stuff doesn't work.
+ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
+ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/symconst.h \
+ $(INCDIR)/aout/stab_gnu.h
+
+# We need all these explicit rules for the multi stuff. Because of
+# these rules, we don't need one for OBJ_FORMAT_O.
+
+obj-aout.o : $(srcdir)/config/obj-aout.c
+ $(COMPILE) -c $(srcdir)/config/obj-aout.c
+obj-bout.o : $(srcdir)/config/obj-bout.c
+ $(COMPILE) -c $(srcdir)/config/obj-bout.c
+obj-coff.o: $(srcdir)/config/obj-coff.c
+ $(COMPILE) -c $(srcdir)/config/obj-coff.c
+obj-ecoff.o : $(srcdir)/config/obj-ecoff.c
+ $(COMPILE) -c $(srcdir)/config/obj-ecoff.c
+obj-elf.o : $(srcdir)/config/obj-elf.c
+ $(COMPILE) -c $(srcdir)/config/obj-elf.c
+obj-evax.o : $(srcdir)/config/obj-evax.c
+ $(COMPILE) -c $(srcdir)/config/obj-evax.c
+obj-hp300.o : $(srcdir)/config/obj-hp300.c
+ $(COMPILE) -c $(srcdir)/config/obj-hp300.c
+obj-ieee.o : $(srcdir)/config/obj-ieee.c
+ $(COMPILE) -c $(srcdir)/config/obj-ieee.c
+obj-multi.o : $(srcdir)/config/obj-multi.c
+ $(COMPILE) -c $(srcdir)/config/obj-multi.c
+obj-som.o : $(srcdir)/config/obj-som.c
+ $(COMPILE) -c $(srcdir)/config/obj-som.c
+obj-vms.o : $(srcdir)/config/obj-vms.c
+ $(COMPILE) -c $(srcdir)/config/obj-vms.c
+
+e-mipself.o : $(srcdir)/config/e-mipself.c
+ $(COMPILE) -c $(srcdir)/config/e-mipself.c
+e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
+ $(COMPILE) -c $(srcdir)/config/e-mipsecoff.c
+e-i386coff.o: $(srcdir)/config/e-i386coff.c
+ $(COMPILE) -c $(srcdir)/config/e-i386coff.c
+e-i386elf.o: $(srcdir)/config/e-i386elf.c
+ $(COMPILE) -c $(srcdir)/config/e-i386elf.c
+
+m68k-parse.c: $(srcdir)/config/m68k-parse.y
+ $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/config/m68k-parse.y y.tab.c m68k-parse.c --
+m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h
+
+# Don't let the .y.h rule clobber m68k-parse.h.
+m68k-parse.h: ; @true
+$(srcdir)/config/m68k-parse.h: ; @true
+
+# The instruction table specification lexical analyzer and parser.
+
+itbl-lex.c: $(srcdir)/itbl-lex.l
+itbl-lex.o: itbl-lex.c itbl-parse.h
+
+itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h
+
+itbl-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
+
+itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
+ $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- -d
+
+itbl-test-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
+ $(COMPILE) -o itbl-test-ops.o -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
+
+itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c $(srcdir)/itbl-ops.h
+ $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
+
+# CGEN interface.
+
+cgen.o: cgen.c cgen-opc.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
+ $(srcdir)/../opcodes/$(TARG_CPU)-opc.h
+
+.PHONY: install-exec-local install-data-local
+
+install-exec-local: $(noinst_PROGRAMS)
+ $(mkinstalldirs) $(bindir) $(tooldir)/bin
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`"; \
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`; \
+ else :; fi; \
+ done
+ rm -f $(tooldir)/bin/as$(EXEEXT)
+ n=`echo as | sed '$(transform)'`; \
+ if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
+ ln $(bindir)/$$n$(EXEEXT) $(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
+ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(tooldir)/bin/as$(EXEEXT); \
+ fi
+
+# These exist for maintenance purposes.
+
+.PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
+
+bootstrap: as-new
+ $(MAKE) stage1
+ rm -f stage && ln -s stage1 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) stage2
+ rm -f stage && ln -s stage2 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) comparison against=stage2
+
+bootstrap2:
+ rm -f stage && ln -s stage1 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) stage2
+ rm -f stage && ln -s stage2 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) comparison against=stage2
+
+bootstrap3:
+ rm -f stage && ln -s stage2 stage
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
+ $(MAKE) comparison against=stage2
+
+# Copy the object files from a particular stage into a subdirectory.
+stage1:
+ -mkdir stage1
+ -mv $(STAGESTUFF) stage1
+ if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
+
+stage2:
+ -mkdir stage2
+ -mv $(STAGESTUFF) stage2
+ if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
+
+stage3:
+ -mkdir stage3
+ -mv $(STAGESTUFF) stage3
+ if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
+
+# This rule is derived from corresponding code in the Makefile.in for gcc.
+# The "tail +16c" is to bypass headers which may include timestamps or
+# temporary assembly file names.
+comparison:
+ x=0 ; \
+ for file in *.o ; do \
+ tail +16c ./$$file > tmp-foo1; \
+ if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
+ if cmp tmp-foo1 tmp-foo2 ; then \
+ true ; \
+ else \
+ echo $$file differs ; \
+ x=1 ; \
+ fi ; \
+ else true; fi ; \
+ done ; \
+ exit $$x
+ -rm -f tmp-foo*
+
+.PHONY: de-stage1 de-stage2 de-stage3
+
+de-stage1:
+ - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
+ - rmdir stage1
+
+de-stage2:
+ - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
+ - rmdir stage2
+
+de-stage3:
+ - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
+ - rmdir stage3
+
+.dep: dep.sed $(DEP_FILE_DEPS) .tcdep .objdep .dep2
+ rm -f .dep1
+ srcdir=`cd $(srcdir); pwd`; \
+ $(MAKE) DEP=$(DEP) srcdir=$${srcdir} VPATH=$${srcdir} .dep1
+ rm -rf .depdir
+ sed -f dep.sed < .dep1 > .depa
+ sed -f dep.sed < .tcdep >> .depa
+ sed -f dep.sed < .objdep >> .depa
+ sed -f dep.sed < .dep2 >> .depa
+ echo '$$(OBJS): $$(DEP_@target''_cpu_type@_@obj''_format@)' >> .depa
+ echo '$$(TARG_CPU_O): $$(TCDEP_@target''_cpu_type@_@obj''_format@)' >> .depa
+ echo '$$(OBJ_FORMAT_O): $$(OBJDEP_@target''_cpu_type@_@obj''_format@)' >> .depa
+ echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> .depa
+ $(SHELL) $(srcdir)/../move-if-change .depa .dep
+
+# This rule needs a mkdep that runs "gcc -MM".
+.dep1: $(CFILES) $(MULTI_CFILES)
+ if [ -d .depdir ]; then true; else mkdir .depdir; fi
+ srcdir=`cd $(srcdir); pwd`; \
+ cd .depdir; \
+ echo '' > targ-cpu.h; \
+ echo '' > obj-format.h; \
+ echo '' > targ-env.h; \
+ echo '' > itbl-cpu.h; \
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
+ $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $?
+ sed -e '/IF YOU PUT ANYTHING/,$$d' < .depdir/.dep > .dep1
+ rm -f .depdir/.dep
+
+# Work out the special dependencies for the tc-*.c files.
+.tcdep: $(TARGET_CPU_CFILES)
+ rm -f .tcdepa
+ if [ -d .depdir ]; then true; else mkdir .depdir; fi
+ srcdir=`cd $(srcdir); pwd`; \
+ cd .depdir; \
+ for c in $(CPU_TYPES); do \
+ for o in $(OBJ_FORMATS); do \
+ $(CPU_OBJ_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
+ echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
+ echo '#include "te-generic.h"' > targ-env.h; \
+ echo '' > itbl-cpu.h; \
+ echo '#include "opcodes/'"$${c}"'-opc.h"' > cgen-opc.h; \
+ rm -f dummy.c; \
+ cp $${srcdir}/config/tc-$${c}.c dummy.c; \
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
+ $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c; \
+ sed -e "s/dummy.o: dummy.c/TCDEP_$${c}_$${o} =/" \
+ -e '1,/DO NOT PUT ANYTHING AFTER/d' \
+ -e '/IF YOU PUT ANYTHING/,$$d' \
+ -e '/^$$/d' < .dep >> ../.tcdepa; \
+ rm -f dummy.c; \
+ else true; fi; \
+ done; \
+ done
+ echo 'TCDEP_hppa_som = $$(srcdir)/config/tc-hppa.h subsegs.h \' >> .tcdepa
+ echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> .tcdepa
+ echo ' $$(INCDIR)/opcode/hppa.h $$(BFDDIR)/som.h' >> .tcdepa
+ # We don't try to handle all multi cases.
+ for c in $(CPU_TYPES); do \
+ $(CPU_MULTI_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ o=ecoff; \
+ $(CPU_OBJ_VALID) \
+ echo 'TCDEP_'"$${c}"'_multi = \' >> .tcdepa; \
+ echo '$$(TCDEP_'"$${c}"'_coff) \' >> .tcdepa; \
+ if [ x$${valid} = xyes ]; then \
+ echo '$$(TCDEP_'"$${c}"'_ecoff) \' >> .tcdepa; \
+ else true; fi; \
+ echo '$$(TCDEP_'"$${c}"'_elf)' >> .tcdepa; \
+ else true; fi; \
+ done
+ mv -f .tcdepa .tcdep
+
+# Work out the special dependencies for the obj-*.c files.
+.objdep: $(OBJ_FORMAT_CFILES)
+ rm -f .objdepa
+ if [ -d .depdir ]; then true; else mkdir .depdir; fi
+ srcdir=`cd $(srcdir); pwd`; \
+ cd .depdir; \
+ for c in $(CPU_TYPES); do \
+ for o in $(OBJ_FORMATS); do \
+ $(CPU_OBJ_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
+ echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
+ echo '#include "te-generic.h"' > targ-env.h; \
+ echo '' > itbl-cpu.h; \
+ rm -f dummy.c; \
+ cp $${srcdir}/config/obj-$${o}.c dummy.c; \
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
+ $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c; \
+ sed -e "s/dummy.o: dummy.c/OBJDEP_$${c}_$${o} =/" \
+ -e '1,/DO NOT PUT ANYTHING AFTER/d' \
+ -e '/IF YOU PUT ANYTHING/,$$d' \
+ -e '/^$$/d' < .dep >> ../.objdepa; \
+ rm -f dummy.c; \
+ else true; fi; \
+ done; \
+ done
+ echo 'OBJDEP_hppa_som = $$(srcdir)/config/obj-som.h subsegs.h \' >> .objdepa
+ echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> .objdepa
+ echo ' $$(BFDDIR)/som.h $$(INCDIR)/aout/stab_gnu.h \' >> .objdepa
+ echo ' $$(INCDIR)/aout/stab.def' >> .objdepa
+ # We don't try to handle all multi cases.
+ for c in $(CPU_TYPES); do \
+ $(CPU_MULTI_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ o=ecoff; \
+ $(CPU_OBJ_VALID) \
+ echo 'OBJDEP_'"$${c}"'_multi = \' >> .objdepa; \
+ echo '$$(OBJDEP_'"$${c}"'_coff) \' >> .objdepa; \
+ if [ x$${valid} = xyes ]; then \
+ echo '$$(OBJDEP_'"$${c}"'_ecoff) \' >> .objdepa; \
+ else true; fi; \
+ echo '$$(OBJDEP_'"$${c}"'_elf)' >> .objdepa; \
+ else true; fi; \
+ done
+ mv -f .objdepa .objdep
+
+# Work out the dependencies for each CPU/OBJ combination.
+# Note that SOM is a special case, because it only works native.
+.dep2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES)
+ rm -f .dep2a
+ if [ -d .depdir ]; then true; else mkdir .depdir; fi
+ srcdir=`cd $(srcdir); pwd`; \
+ cd .depdir; \
+ for c in $(CPU_TYPES); do \
+ for o in $(OBJ_FORMATS); do \
+ $(CPU_OBJ_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
+ echo '#include "obj-'"$${o}"'.h"' > dummy.c; \
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
+ $(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) dummy.c; \
+ sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" \
+ -e '1,/DO NOT PUT ANYTHING AFTER/d' \
+ -e '/IF YOU PUT ANYTHING/,$$d' \
+ -e '/^$$/d' < .dep >> ../.dep2a; \
+ else true; fi; \
+ done; \
+ done
+ echo 'DEP_hppa_som = $$(BFDDIR)/som.h' >> .dep2a
+ # We don't try to handle all multi cases.
+ for c in $(CPU_TYPES); do \
+ $(CPU_MULTI_VALID) \
+ if [ x$${valid} = xyes ]; then \
+ o=ecoff; \
+ $(CPU_OBJ_VALID) \
+ echo 'DEP_'"$${c}"'_multi = \' >> .dep2a; \
+ echo '$$(DEP_'"$${c}"'_coff) \' >> .dep2a; \
+ if [ x$${valid} = xyes ]; then \
+ echo '$$(DEP_'"$${c}"'_ecoff) \' >> .dep2a; \
+ else true; fi; \
+ echo '$$(DEP_'"$${c}"'_elf)' >> .dep2a; \
+ else true; fi; \
+ done
+ mv -f .dep2a .dep2
+
+dep.sed: dep-in.sed config.status
+ srcdir=`cd $(srcdir); pwd`; \
+ sed <$(srcdir)/dep-in.sed >dep.sed \
+ -e "s!@INCDIR@!$${srcdir}/../include!" \
+ -e "s!@BFDDIR@!$${srcdir}/../bfd!" \
+ -e "s!@SRCDIR@!$${srcdir}!"
+
+dep: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
+ cat .dep >> tmp-Makefile
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
+
+dep-in: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
+ cat .dep >> tmp-Makefile.in
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
+
+dep-am: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
+ cat .dep >> tmp-Makefile.am
+ $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
+
+.PHONY: dep dep-in dep-am
+
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+
+app.o: app.c
+as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \
+ sb.h macro.h
+atof-generic.o: atof-generic.c
+bignum-copy.o: bignum-copy.c
+cond.o: cond.c macro.h sb.h $(INCDIR)/obstack.h
+depend.o: depend.c
+ecoff.o: ecoff.c
+ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h
+expr.o: expr.c $(INCDIR)/obstack.h
+flonum-copy.o: flonum-copy.c
+flonum-konst.o: flonum-konst.c
+flonum-mult.o: flonum-mult.c
+frags.o: frags.c subsegs.h $(INCDIR)/obstack.h
+hash.o: hash.c
+input-file.o: input-file.c input-file.h
+input-scrub.o: input-scrub.c input-file.h sb.h
+listing.o: listing.c input-file.h subsegs.h
+literal.o: literal.c subsegs.h $(INCDIR)/obstack.h
+macro.o: macro.c sb.h macro.h
+messages.o: messages.c
+output-file.o: output-file.c output-file.h
+read.o: read.c subsegs.h $(INCDIR)/obstack.h sb.h macro.h \
+ ecoff.h
+sb.o: sb.c sb.h
+stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \
+ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
+subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h
+symbols.o: symbols.c $(INCDIR)/obstack.h subsegs.h
+write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h
+gasp.o: gasp.c sb.h macro.h
+e-i386coff.o: $(srcdir)/config/e-i386coff.c emul.h \
+ emul-target.h
+e-i386elf.o: $(srcdir)/config/e-i386elf.c emul.h emul-target.h
+e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul.h \
+ emul-target.h
+e-mipself.o: $(srcdir)/config/e-mipself.c emul.h emul-target.h
$(OBJS): $(DEP_@target_cpu_type@_@obj_format@)
$(TARG_CPU_O): $(TCDEP_@target_cpu_type@_@obj_format@)
$(OBJ_FORMAT_O): $(OBJDEP_@target_cpu_type@_@obj_format@)
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/binutils/gas/NEWS b/contrib/binutils/gas/NEWS
index c60c8b8..de21098 100644
--- a/contrib/binutils/gas/NEWS
+++ b/contrib/binutils/gas/NEWS
@@ -1,5 +1,19 @@
-*- text -*-
+Changes in 2.9:
+
+Texas Instruction c30 (tms320c30) support added.
+
+The assembler now optimizes the exception frame information generated by egcs
+and gcc 2.8. The new --traditional-format disables this optimization.
+
+Added --gstabs option to generate stabs debugging information.
+
+The -a option takes a new suboption, m (e.g., -alm) to expand macros in a
+listing.
+
+Added -MD option to print dependencies.
+
Changes in 2.8:
BeOS support added.
@@ -46,7 +60,7 @@ default is to build COFF-only support. To get a set of tools that generate ELF
(they'll understand both COFF and ELF), you must configure with
target=i386-unknown-sco3.2v5elf.
-m88k-motorola-sysv* support added.
+m88k-motorola-sysv3* support added.
Changes in 2.6:
diff --git a/contrib/binutils/gas/README b/contrib/binutils/gas/README
index 418b8bd..c7f3226 100644
--- a/contrib/binutils/gas/README
+++ b/contrib/binutils/gas/README
@@ -171,6 +171,7 @@ Native assembling should work on:
sco 3.2v4.2
sco openserver 5.0 (a.k.a. 3.2v5.0 )
sparc solaris
+ ns32k (netbsd, lites)
I believe that gas as a cross-assembler can currently be targetted for
most of the above hosts, plus
@@ -199,7 +200,7 @@ run gcc on it. Or run "gcc -xassembler-with-cpp foo.s".
Support for ELF should work now for sparc, hppa, i386, alpha, m68k,
MIPS, powerpc.
-Support for ns32k, tahoe, i860, m88k may be suffering from bitrot.
+Support for sequent (ns32k), tahoe, i860, m88k may be suffering from bitrot.
If you try out gas on some host or target not listed above, please let me know
the results, so I can update the list.
@@ -226,10 +227,10 @@ warning message when this happens.
REPORTING BUGS IN GAS
=====================
-Bugs in gas should be reported to bug-gnu-utils@prep.ai.mit.edu. They may be
-cross-posted to bug-gcc if they affect the use of gas with gcc. They should
-not be reported just to bug-gcc, since I don't read that list, and therefore
-wouldn't see them.
+Bugs in gas should be reported to bug-gnu-utils@gnu.org. They may be
+cross-posted to bug-gcc if they affect the use of gas with gcc. They
+should not be reported just to bug-gcc, since I don't read that list,
+and therefore wouldn't see them.
If you report a bug in GAS, please remember to include:
diff --git a/contrib/binutils/gas/acconfig.h b/contrib/binutils/gas/acconfig.h
index d2ca454..c9c6002 100644
--- a/contrib/binutils/gas/acconfig.h
+++ b/contrib/binutils/gas/acconfig.h
@@ -1,3 +1,9 @@
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
+
/* Should gas use high-level BFD interfaces? */
#undef BFD_ASSEMBLER
@@ -34,9 +40,9 @@
#undef MANY_SEGMENTS
-/* Needed only for sparc configuration. */
-#undef SPARC_V9
-#undef SPARC_ARCH64
+/* The configure script defines this for some targets based on the
+ target name used. It is not always defined. */
+#undef TARGET_BYTES_BIG_ENDIAN
/* Needed only for some configurations that can produce multiple output
formats. */
@@ -59,3 +65,15 @@
#undef I386COFF
#undef M68KCOFF
#undef M88KCOFF
+
+/* Using cgen code? */
+#undef USING_CGEN
+
+/* Needed only for sparc configuration. */
+#undef DEFAULT_ARCH
+
+/* Needed only for PowerPC Solaris. */
+#undef TARGET_SOLARIS_COMMENT
+
+/* Needed only for SCO 5. */
+#undef SCO_ELF
diff --git a/contrib/binutils/gas/acinclude.m4 b/contrib/binutils/gas/acinclude.m4
new file mode 100644
index 0000000..60f54e9
--- /dev/null
+++ b/contrib/binutils/gas/acinclude.m4
@@ -0,0 +1,58 @@
+dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
+AC_DEFUN(GAS_CHECK_DECL_NEEDED,[
+AC_MSG_CHECKING(whether declaration is required for $1)
+AC_CACHE_VAL(gas_cv_decl_needed_$1,
+AC_TRY_LINK([$4],
+[
+typedef $3;
+$2 x;
+x = ($2) $1;
+], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
+AC_MSG_RESULT($gas_cv_decl_needed_$1)
+test $gas_cv_decl_needed_$1 = no || {
+ ifelse(index($1,[$]),-1,
+ [AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]))],
+ [gas_decl_name_upcase=`echo $1 | tr '[a-z]' '[A-Z]'`
+ AC_DEFINE_UNQUOTED(NEED_DECLARATION_$gas_decl_name_upcase)])
+}
+])dnl
+dnl
+dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad
+dnl enough, but on some of those systems, the assert macro relies on requoting
+dnl working properly!
+dnl GAS_WORKING_ASSERT
+AC_DEFUN(GAS_WORKING_ASSERT,
+[AC_MSG_CHECKING([for working assert macro])
+AC_CACHE_VAL(gas_cv_assert_ok,
+AC_TRY_LINK([#include <assert.h>
+#include <stdio.h>], [
+/* check for requoting problems */
+static int a, b, c, d;
+static char *s;
+assert (!strcmp(s, "foo bar baz quux"));
+/* check for newline handling */
+assert (a == b
+ || c == d);
+], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
+AC_MSG_RESULT($gas_cv_assert_ok)
+test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT)
+])dnl
+dnl
+dnl Since many Bourne shell implementations lack subroutines, use this
+dnl hack to simplify the code in configure.in.
+dnl GAS_UNIQ(listvar)
+AC_DEFUN(GAS_UNIQ,
+[_gas_uniq_list="[$]$1"
+_gas_uniq_newlist=""
+dnl Protect against empty input list.
+for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do
+ case [$]_gas_uniq_i in
+ _gas_uniq_dummy) ;;
+ *) case " [$]_gas_uniq_newlist " in
+ *" [$]_gas_uniq_i "*) ;;
+ *) _gas_uniq_newlist="[$]_gas_uniq_newlist [$]_gas_uniq_i" ;;
+ esac ;;
+ esac
+done
+$1=[$]_gas_uniq_newlist
+])dnl
diff --git a/contrib/binutils/gas/aclocal.m4 b/contrib/binutils/gas/aclocal.m4
index 60f54e9..c60bd9f 100644
--- a/contrib/binutils/gas/aclocal.m4
+++ b/contrib/binutils/gas/aclocal.m4
@@ -1,3 +1,15 @@
+dnl aclocal.m4 generated automatically by aclocal 1.2e
+
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
AC_DEFUN(GAS_CHECK_DECL_NEEDED,[
AC_MSG_CHECKING(whether declaration is required for $1)
@@ -56,3 +68,450 @@ for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do
done
$1=[$]_gas_uniq_newlist
])dnl
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AM_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+
+# serial 1
+
+AC_DEFUN(AM_PROG_INSTALL,
+[AC_REQUIRE([AC_PROG_INSTALL])
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+AC_SUBST(INSTALL_SCRIPT)dnl
+])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+
+# serial 24 AM_PROG_LIBTOOL
+AC_DEFUN(AM_PROG_LIBTOOL,
+[AC_REQUIRE([AM_ENABLE_SHARED])dnl
+AC_REQUIRE([AM_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_RANLIB])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AM_PROG_LD])dnl
+AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+dnl
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+])
+
+# AM_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_SHARED,
+[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
+changequote([, ])dnl
+[ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AM_DISABLE_SHARED,
+[AM_ENABLE_SHARED(no)])
+
+# AM_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AM_DISABLE_STATIC,
+[AM_ENABLE_STATIC(no)])
+
+# AM_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_STATIC,
+[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
+changequote([, ])dnl
+[ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+])
+
+
+# AM_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AM_PROG_LD,
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+changequote(,)dnl
+ /* | [A-Za-z]:\\*)
+changequote([,])dnl
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(ac_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_SUBST(LD)
+AM_PROG_LD_GNU
+])
+
+AC_DEFUN(AM_PROG_LD_GNU,
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi])
+])
+
+# AM_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AM_PROG_NM,
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(ac_cv_path_NM,
+[case "$NM" in
+changequote(,)dnl
+/* | [A-Za-z]:\\*)
+changequote([,])dnl
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac])
+NM="$ac_cv_path_NM"
+AC_MSG_RESULT([$NM])
+AC_SUBST(NM)
+])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT($USE_MAINTAINER_MODE)
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+ AC_SUBST(MAINT)dnl
+]
+)
+
+# Check to see if we're running under Cygwin32, without using
+# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_CYGWIN32()
+AC_DEFUN(AM_CYGWIN32,
+[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
+[AC_TRY_COMPILE(,[return __CYGWIN32__;],
+am_cv_cygwin32=yes, am_cv_cygwin32=no)
+rm -f conftest*])
+CYGWIN32=
+test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
+
+# Check to see if we're running under Win32, without using
+# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
+# Otherwise set it to "".
+
+dnl AM_EXEEXT()
+dnl This knows we add .exe if we're building in the Cygwin32
+dnl environment. But if we're not, then it compiles a test program
+dnl to see if there is a suffix for executables.
+AC_DEFUN(AM_EXEEXT,
+[AC_REQUIRE([AM_CYGWIN32])
+AC_REQUIRE([AM_MINGW32])
+AC_MSG_CHECKING([for executable suffix])
+AC_CACHE_VAL(am_cv_exeext,
+[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*])
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+AC_MSG_RESULT(${am_cv_exeext})
+AC_SUBST(EXEEXT)])
+
+# Check to see if we're running under Mingw, without using
+# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_MINGW32()
+AC_DEFUN(AM_MINGW32,
+[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
+[AC_TRY_COMPILE(,[return __MINGW32__;],
+am_cv_mingw32=yes, am_cv_mingw32=no)
+rm -f conftest*])
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes])
+
diff --git a/contrib/binutils/gas/app.c b/contrib/binutils/gas/app.c
index a2551c6..b58f705 100644
--- a/contrib/binutils/gas/app.c
+++ b/contrib/binutils/gas/app.c
@@ -57,6 +57,12 @@ static const char symbol_chars[] =
#define LEX_IS_COLON 9
#define LEX_IS_NEWLINE 10
#define LEX_IS_ONECHAR_QUOTE 11
+#ifdef TC_V850
+#define LEX_IS_DOUBLEDASH_1ST 12
+#endif
+#ifdef TC_M32R
+#define LEX_IS_DOUBLEBAR_1ST 13
+#endif
#define IS_SYMBOL_COMPONENT(c) (lex[c] == LEX_IS_SYMBOL_COMPONENT)
#define IS_WHITESPACE(c) (lex[c] == LEX_IS_WHITESPACE)
#define IS_LINE_SEPARATOR(c) (lex[c] == LEX_IS_LINE_SEPARATOR)
@@ -80,6 +86,7 @@ do_scrub_begin (m68k_mri)
lex[' '] = LEX_IS_WHITESPACE;
lex['\t'] = LEX_IS_WHITESPACE;
+ lex['\r'] = LEX_IS_WHITESPACE;
lex['\n'] = LEX_IS_NEWLINE;
lex[';'] = LEX_IS_LINE_SEPARATOR;
lex[':'] = LEX_IS_COLON;
@@ -142,6 +149,13 @@ do_scrub_begin (m68k_mri)
then it can't be used in an expression. */
lex['!'] = LEX_IS_LINE_COMMENT_START;
}
+
+#ifdef TC_V850
+ lex['-'] = LEX_IS_DOUBLEDASH_1ST;
+#endif
+#ifdef TC_M32R
+ lex['|'] = LEX_IS_DOUBLEBAR_1ST;
+#endif
} /* do_scrub_begin() */
/* Saved state of the scrubber */
@@ -285,6 +299,12 @@ do_scrub_chars (get, tostart, tolen)
11: After seeing a symbol character in state 0 (eg a label definition)
-1: output string in out_string and go to the state in old_state
-2: flush text until a '*' '/' is seen, then go to state old_state
+#ifdef TC_V850
+ 12: After seeing a dash, looking for a second dash as a start of comment.
+#endif
+#ifdef TC_M32R
+ 13: After seeing a vertical bar, looking for a second vertical bar as a parallel expression seperator.
+#endif
*/
/* I added states 9 and 10 because the MIPS ECOFF assembler uses
@@ -295,7 +315,11 @@ do_scrub_chars (get, tostart, tolen)
I added state 11 so that something like "Lfoo add %r25,%r26,%r27" works
correctly on the PA (and any other target where colons are optional).
- Jeff Law, law@cs.utah.edu. */
+ Jeff Law, law@cs.utah.edu.
+
+ I added state 13 so that something like "cmp r1, r2 || trap #1" does not
+ get squashed into "cmp r1,r2||trap#1", with the all important space
+ between the 'trap' and the '#1' being eliminated. nickc@cygnus.com */
/* This macro gets the next input character. */
@@ -620,6 +644,7 @@ do_scrub_chars (get, tostart, tolen)
either '0' or '1' indicating whether to enter or
leave MRI mode. */
do_scrub_begin (mri_last_ch == '1');
+ mri_state = NULL;
/* We continue handling the character as usual. The
main gas reader must also handle the .mri pseudo-op
@@ -890,6 +915,43 @@ do_scrub_chars (get, tostart, tolen)
PUT (ch);
break;
+#ifdef TC_V850
+ case LEX_IS_DOUBLEDASH_1ST:
+ ch2 = GET();
+ if (ch2 != '-')
+ {
+ UNGET (ch2);
+ goto de_fault;
+ }
+ /* read and skip to end of line */
+ do
+ {
+ ch = GET ();
+ }
+ while (ch != EOF && ch != '\n');
+ if (ch == EOF)
+ {
+ as_warn ("end of file in comment; newline inserted");
+ }
+ state = 0;
+ PUT ('\n');
+ break;
+#endif
+#ifdef TC_M32R
+ case LEX_IS_DOUBLEBAR_1ST:
+ ch2 = GET();
+ if (ch2 != '|')
+ {
+ UNGET (ch2);
+ goto de_fault;
+ }
+ /* Reset back to state 1 and pretend that we are parsing a line from
+ just after the first white space. */
+ state = 1;
+ PUT ('|');
+ PUT ('|');
+ break;
+#endif
case LEX_IS_LINE_COMMENT_START:
/* FIXME-someday: The two character comment stuff was badly
thought out. On i386, we want '/' as line comment start
@@ -950,6 +1012,18 @@ do_scrub_chars (get, tostart, tolen)
break;
}
+#ifdef TC_D10V
+ /* All insns end in a char for which LEX_IS_SYMBOL_COMPONENT is true.
+ Trap is the only short insn that has a first operand that is
+ neither register nor label.
+ We must prevent exef0f ||trap #1 to degenerate to exef0f ||trap#1 .
+ We can't make '#' LEX_IS_SYMBOL_COMPONENT because it is already
+ LEX_IS_LINE_COMMENT_START. However, it is the only character in
+ line_comment_chars for d10v, hence we can recognize it as such. */
+ /* An alternative approach would be to reset the state to 1 when
+ we see '||', '<'- or '->', but that seems to be overkill. */
+ if (state == 10) PUT (' ');
+#endif
/* We have a line comment character which is not at the
start of a line. If this is also a normal comment
character, fall through. Otherwise treat it as a default
diff --git a/contrib/binutils/gas/as.c b/contrib/binutils/gas/as.c
index e1929e6..d7ed4b8 100644
--- a/contrib/binutils/gas/as.c
+++ b/contrib/binutils/gas/as.c
@@ -1,5 +1,5 @@
/* as.c - GAS main program.
- Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -64,6 +64,10 @@ int listing; /* true if a listing is wanted */
static char *listing_filename = NULL; /* Name of listing file. */
+/* Type of debugging to generate. */
+
+enum debug_info_type debug_type = DEBUG_NONE;
+
/* Maximum level of macro nesting. */
int max_macro_nest = 100;
@@ -74,7 +78,9 @@ segT reg_section, expr_section;
segT text_section, data_section, bss_section;
#endif
-int chunksize = 5000;
+/* The default obstack chunk size. If we set this to zero, the
+ obstack code will use whatever will fit in a 4096 byte block. */
+int chunksize = 0;
/* To monitor memory allocation more effectively, make this non-zero.
Then the chunk sizes for gas and bfd will be reduced. */
@@ -110,7 +116,7 @@ print_version_id ()
return;
printed = 1;
- fprintf (stderr, "GNU assembler version %s (%s)", GAS_VERSION, TARGET_ALIAS);
+ fprintf (stderr, "GNU assembler version %s (%s)", VERSION, TARGET_ALIAS);
#ifdef BFD_ASSEMBLER
fprintf (stderr, ", using BFD version %s", BFD_VERSION);
#endif
@@ -131,6 +137,7 @@ Options:\n\
d omit debugging directives\n\
h include high-level source\n\
l include assembly\n\
+ m include macro expansions\n\
n omit forms processing\n\
s include symbols\n\
=file set listing file name (must be last sub-option)\n");
@@ -138,17 +145,21 @@ Options:\n\
-D produce assembler debugging messages\n\
--defsym SYM=VAL define symbol SYM to given value\n\
-f skip whitespace and comment preprocessing\n\
+--gstabs generate stabs debugging information\n\
--help show this message and exit\n\
-I DIR add DIR to search list for .include directives\n\
-J don't warn about signed overflow\n\
-K warn when differences altered for long displacements\n\
--L keep local symbols (starting with `L')\n");
+-L,--keep-locals keep local symbols (e.g. starting with `L')\n");
fprintf (stream, "\
-M,--mri assemble in MRI compatibility mode\n\
+--MD FILE write dependency information in FILE (default none)\n\
-nocpp ignored\n\
-o OBJFILE name the object-file output OBJFILE (default a.out)\n\
-R fold data section into text section\n\
--statistics print various measured statistics from execution\n\
+--strip-local-absolute strip local absolute symbols\n\
+--traditional-format Use same format as native assembler when possible\n\
--version print assembler version number and exit\n\
-W suppress warnings\n\
--itbl INSTTBL extend instruction set to include instructions\n\
@@ -156,10 +167,20 @@ Options:\n\
-w ignored\n\
-X ignored\n\
-Z generate object file even after errors\n");
+ fprintf (stream, "\
+--listing-lhs-width set the width in words of the output data column of\n\
+ the listing\n\
+--listing-lhs-width2 set the width in words of the continuation lines\n\
+ of the output data column; ignored if smaller than\n\
+ the width of the first line\n\
+--listing-rhs-width set the max width in characters of the lines from\n\
+ the source file\n\
+--listing-cont-lines set the maximum number of continuation lines used\n\
+ for the output data column of the listing\n");
md_show_usage (stream);
- fprintf (stream, "\nReport bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ fprintf (stream, "\nReport bugs to bug-gnu-utils@gnu.org\n");
}
#ifdef USE_EMULATIONS
@@ -290,7 +311,7 @@ parse_args (pargc, pargv)
#endif
'w', 'X',
/* New option for extending instruction set (see also --itbl below) */
- 't',
+ 't', ':',
'\0'
};
struct option *longopts;
@@ -299,6 +320,7 @@ parse_args (pargc, pargv)
static const struct option std_longopts[] = {
#define OPTION_HELP (OPTION_STD_BASE)
{"help", no_argument, NULL, OPTION_HELP},
+ {"keep-locals", no_argument, NULL, 'L'},
{"mri", no_argument, NULL, 'M'},
#define OPTION_NOCPP (OPTION_STD_BASE + 1)
{"nocpp", no_argument, NULL, OPTION_NOCPP},
@@ -321,7 +343,23 @@ parse_args (pargc, pargv)
list of instruction formats. The additional opcodes and their
formats are added to the built-in set of instructions, and
mnemonics for new registers may also be defined. */
- {"itbl", required_argument, NULL, OPTION_INSTTBL}
+ {"itbl", required_argument, NULL, OPTION_INSTTBL},
+#define OPTION_LISTING_LHS_WIDTH (OPTION_STD_BASE + 9)
+ {"listing-lhs-width", required_argument, NULL, OPTION_LISTING_LHS_WIDTH},
+#define OPTION_LISTING_LHS_WIDTH2 (OPTION_STD_BASE + 10)
+ {"listing-lhs-width", required_argument, NULL, OPTION_LISTING_LHS_WIDTH2},
+#define OPTION_LISTING_RHS_WIDTH (OPTION_STD_BASE + 11)
+ {"listing-rhs-width", required_argument, NULL, OPTION_LISTING_RHS_WIDTH},
+#define OPTION_LISTING_CONT_LINES (OPTION_STD_BASE + 12)
+ {"listing-cont-lines", required_argument, NULL, OPTION_LISTING_CONT_LINES},
+#define OPTION_DEPFILE (OPTION_STD_BASE + 13)
+ {"MD", required_argument, NULL, OPTION_DEPFILE},
+#define OPTION_GSTABS (OPTION_STD_BASE + 14)
+ {"gstabs", no_argument, NULL, OPTION_GSTABS},
+#define OPTION_STRIP_LOCAL_ABSOLUTE (OPTION_STD_BASE + 15)
+ {"strip-local-absolute", no_argument, NULL, OPTION_STRIP_LOCAL_ABSOLUTE},
+#define OPTION_TRADITIONAL_FORMAT (OPTION_STD_BASE + 16)
+ {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT}
};
/* Construct the option lists from the standard list and the
@@ -402,9 +440,17 @@ parse_args (pargc, pargv)
flag_print_statistics = 1;
break;
+ case OPTION_STRIP_LOCAL_ABSOLUTE:
+ flag_strip_local_absolute = 1;
+ break;
+
+ case OPTION_TRADITIONAL_FORMAT:
+ flag_traditional_format = 1;
+ break;
+
case OPTION_VERSION:
/* This output is intended to follow the GNU standards document. */
- printf ("GNU assembler %s\n", GAS_VERSION);
+ printf ("GNU assembler %s\n", VERSION);
printf ("Copyright 1997 Free Software Foundation, Inc.\n");
printf ("\
This program is free software; you may redistribute it under the terms of\n\
@@ -461,6 +507,12 @@ the GNU General Public License. This program has absolutely no warranty.\n");
formats, opcodes, register names, etc. */
struct itbl_file_list *n;
+ if (optarg == NULL)
+ {
+ as_warn ( "No file name following -t option\n" );
+ break;
+ }
+
n = (struct itbl_file_list *) xmalloc (sizeof *n);
n->next = itbl_files;
n->name = optarg;
@@ -480,6 +532,14 @@ the GNU General Public License. This program has absolutely no warranty.\n");
}
break;
+ case OPTION_DEPFILE:
+ start_dependencies (optarg);
+ break;
+
+ case OPTION_GSTABS:
+ debug_type = DEBUG_STABS;
+ break;
+
case 'J':
flag_signed_overflow_ok = 1;
break;
@@ -494,6 +554,25 @@ the GNU General Public License. This program has absolutely no warranty.\n");
flag_keep_locals = 1;
break;
+ case OPTION_LISTING_LHS_WIDTH:
+ listing_lhs_width = atoi(optarg);
+ if (listing_lhs_width_second < listing_lhs_width)
+ listing_lhs_width_second = listing_lhs_width;
+ break;
+ case OPTION_LISTING_LHS_WIDTH2:
+ {
+ int tmp = atoi(optarg);
+ if (tmp > listing_lhs_width)
+ listing_lhs_width_second = tmp;
+ }
+ break;
+ case OPTION_LISTING_RHS_WIDTH:
+ listing_rhs_width = atoi(optarg);
+ break;
+ case OPTION_LISTING_CONT_LINES:
+ listing_lhs_cont_lines = atoi(optarg);
+ break;
+
case 'M':
flag_mri = 1;
#ifdef TC_M68K
@@ -532,6 +611,9 @@ the GNU General Public License. This program has absolutely no warranty.\n");
case 'l':
listing |= LISTING_LISTING;
break;
+ case 'm':
+ listing |= LISTING_MACEXP;
+ break;
case 'n':
listing |= LISTING_NOFORM;
break;
@@ -709,6 +791,14 @@ main (argc, argv)
else
keep_it = 0;
+#if defined (BFD_ASSEMBLER) || !defined (BFD)
+ /* This used to be done at the start of write_object_file in
+ write.c, but that caused problems when doing listings when
+ keep_it was zero. This could probably be moved above md_end, but
+ I didn't want to risk the change. */
+ subsegs_finish ();
+#endif
+
if (keep_it)
write_object_file ();
@@ -737,6 +827,10 @@ main (argc, argv)
may not place the same interpretation on the value given. */
if (had_errors () > 0)
xexit (EXIT_FAILURE);
+
+ /* Only generate dependency file if assembler was successful. */
+ print_dependencies ();
+
xexit (EXIT_SUCCESS);
}
@@ -827,9 +921,9 @@ perform_an_assembly_pass (argc, argv)
#else /* BFD_ASSEMBLER */
/* Create the standard sections, and those the assembler uses
internally. */
- text_section = subseg_new (".text", 0);
- data_section = subseg_new (".data", 0);
- bss_section = subseg_new (".bss", 0);
+ text_section = subseg_new (TEXT_SECTION_NAME, 0);
+ data_section = subseg_new (DATA_SECTION_NAME, 0);
+ bss_section = subseg_new (BSS_SECTION_NAME, 0);
/* @@ FIXME -- we're setting the RELOC flag so that sections are assumed
to have relocs, otherwise we don't find out in time. */
applicable = bfd_applicable_section_flags (stdoutput);
diff --git a/contrib/binutils/gas/as.h b/contrib/binutils/gas/as.h
index 60fccaa..3f457e9 100644
--- a/contrib/binutils/gas/as.h
+++ b/contrib/binutils/gas/as.h
@@ -1,5 +1,5 @@
/* as.h - global header file
- Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -52,8 +52,13 @@
/* AIX requires this to be the first thing in the file. */
#ifdef __GNUC__
-# undef alloca
-# define alloca __builtin_alloca
+# ifndef alloca
+# ifdef __STDC__
+extern void *alloca ();
+# else
+extern char *alloca ();
+# endif
+# endif
#else
# if HAVE_ALLOCA_H
# include <alloca.h>
@@ -63,9 +68,9 @@
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
# if !defined (__STDC__) && !defined (__hpux)
-char *alloca ();
+extern char *alloca ();
# else
-void *alloca ();
+extern void *alloca ();
# endif /* __STDC__, __hpux */
# endif /* alloca */
# endif /* _AIX */
@@ -163,8 +168,8 @@ extern void free ();
extern int errno;
#endif
-/* This is needed for VMS with DEC C. */
-#if ! defined (__GNUC__) && ! defined (HAVE_UNLINK) && defined (HAVE_REMOVE)
+/* This is needed for VMS. */
+#if ! defined (HAVE_UNLINK) && defined (HAVE_REMOVE)
#define unlink remove
#endif
@@ -372,7 +377,14 @@ enum _relax_state
later. Similar to rs_org, but different.
fr_symbol: operand
1 variable char: fill character */
- rs_space
+ rs_space,
+
+ /* A DWARF leb128 value; only ELF uses this. The subtype is 0 for
+ unsigned, 1 for signed. */
+ rs_leb128,
+
+ /* Exception frame information which we may be able to optimize. */
+ rs_cfa
};
typedef enum _relax_state relax_stateT;
@@ -385,92 +397,6 @@ typedef unsigned int relax_substateT;
Could be a problem, cross-assembling for 64-bit machines. */
typedef addressT relax_addressT;
-
-/* frags.c */
-
-/*
- * A code fragment (frag) is some known number of chars, followed by some
- * unknown number of chars. Typically the unknown number of chars is an
- * instruction address whose size is yet unknown. We always know the greatest
- * possible size the unknown number of chars may become, and reserve that
- * much room at the end of the frag.
- * Once created, frags do not change address during assembly.
- * We chain the frags in (a) forward-linked list(s). The object-file address
- * of the 1st char of a frag is generally not known until after relax().
- * Many things at assembly time describe an address by {object-file-address
- * of a particular frag}+offset.
-
- BUG: it may be smarter to have a single pointer off to various different
- notes for different frag kinds. See how code pans
- */
-struct frag
-{
- /* Object file address. */
- addressT fr_address;
- /* Chain forward; ascending address order. Rooted in frch_root. */
- struct frag *fr_next;
-
- /* (Fixed) number of chars we know we have. May be 0. */
- offsetT fr_fix;
- /* (Variable) number of chars after above. May be 0. */
- offsetT fr_var;
- /* For variable-length tail. */
- struct symbol *fr_symbol;
- /* For variable-length tail. */
- offsetT fr_offset;
- /* Points to opcode low addr byte, for relaxation. */
- char *fr_opcode;
-
-#ifndef NO_LISTING
- struct list_info_struct *line;
-#endif
-
- /* What state is my tail in? */
- relax_stateT fr_type;
- relax_substateT fr_subtype;
-
- union {
- /* These are needed only on the NS32K machines. But since we don't
- include targ-cpu.h until after this structure has been defined,
- we can't really conditionalize it. This code should be
- rearranged a bit to make that possible. */
- struct {
- char pcrel_adjust, bsr;
- } ns32k;
-#ifdef USING_CGEN
- /* Don't include this unless using CGEN to keep frag size down. */
- struct {
- const struct cgen_insn *insn;
- unsigned char opindex, opinfo;
- } cgen;
-#endif
- } fr_targ;
-
- /* Where the frag was created, or where it became a variant frag. */
- char *fr_file;
- unsigned int fr_line;
-
- /* Data begins here. */
- char fr_literal[1];
-};
-
-#define SIZEOF_STRUCT_FRAG \
-((char *)zero_address_frag.fr_literal-(char *)&zero_address_frag)
-/* We want to say fr_literal[0] above. */
-
-typedef struct frag fragS;
-
-/* Current frag we are building. This frag is incomplete. It is, however,
- included in frchain_now. The fr_fix field is bogus; instead, use:
- obstack_next_free(&frags)-frag_now->fr_literal. */
-COMMON fragS *frag_now;
-extern int frag_now_fix PARAMS ((void));
-
-/* For foreign-segment symbol fixups. */
-COMMON fragS zero_address_frag;
-/* For local common (N_BSS segment) fixups. */
-COMMON fragS bss_address_frag;
-
/* main program "as.c" (command arguments etc) */
COMMON unsigned char flag_no_comments; /* -f */
@@ -501,9 +427,14 @@ COMMON int flag_no_warnings; /* -W */
COMMON unsigned char flag_always_generate_output; /* -Z */
/* This is true if the assembler should output time and space usage. */
-
COMMON unsigned char flag_print_statistics;
+/* True if local absolute symbols are to be stripped. */
+COMMON int flag_strip_local_absolute;
+
+/* True if we should generate a traditional format object file. */
+COMMON int flag_traditional_format;
+
/* name of emitted object file */
COMMON char *out_file_name;
@@ -520,6 +451,13 @@ COMMON int linkrelax;
/* TRUE if we should produce a listing. */
extern int listing;
+/* Type of debugging information we should generate. We currently
+ only support stabs and ECOFF. */
+
+enum debug_info_type { DEBUG_NONE, DEBUG_STABS, DEBUG_ECOFF };
+
+extern enum debug_info_type debug_type;
+
/* Maximum level of macro nesting. */
extern int max_macro_nest;
@@ -555,21 +493,36 @@ typedef struct _pseudo_type pseudo_typeS;
#ifdef USE_STDARG
#if (__GNUC__ >= 2) && !defined(VMS)
/* for use with -Wformat */
-#define PRINTF_LIKE(FCN) void FCN (const char *format, ...) \
- __attribute__ ((format (printf, 1, 2)))
-#define PRINTF_WHERE_LIKE(FCN) void FCN (char *file, unsigned int line, \
- const char *format, ...) \
- __attribute__ ((format (printf, 3, 4)))
-#else /* ANSI C with stdarg, but not GNU C */
+
+#if __GNUC_MINOR__ < 6
+/* Support for double underscores in attribute names was added in gcc
+ 2.6, so avoid them if we are using an earlier version. */
+#define __printf__ printf
+#define __format__ format
+#endif
+
+#define PRINTF_LIKE(FCN) \
+ void FCN (const char *format, ...) \
+ __attribute__ ((__format__ (__printf__, 1, 2)))
+#define PRINTF_WHERE_LIKE(FCN) \
+ void FCN (char *file, unsigned int line, const char *format, ...) \
+ __attribute__ ((__format__ (__printf__, 3, 4)))
+
+#else /* __GNUC__ < 2 || defined(VMS) */
+
#define PRINTF_LIKE(FCN) void FCN PARAMS ((const char *format, ...))
#define PRINTF_WHERE_LIKE(FCN) void FCN PARAMS ((char *file, \
unsigned int line, \
const char *format, ...))
-#endif
-#else /* not using stdarg */
+
+#endif /* __GNUC__ < 2 || defined(VMS) */
+
+#else /* ! USE_STDARG */
+
#define PRINTF_LIKE(FCN) void FCN ()
#define PRINTF_WHERE_LIKE(FCN) void FCN ()
-#endif
+
+#endif /* ! USE_STDARG */
PRINTF_LIKE (as_bad);
PRINTF_LIKE (as_fatal);
@@ -577,6 +530,7 @@ PRINTF_LIKE (as_tsktsk);
PRINTF_LIKE (as_warn);
PRINTF_WHERE_LIKE (as_bad_where);
PRINTF_WHERE_LIKE (as_warn_where);
+
void as_assert PARAMS ((const char *, int, const char *));
void as_abort PARAMS ((const char *, int, const char *));
@@ -609,7 +563,7 @@ void do_scrub_begin PARAMS ((int));
void input_scrub_begin PARAMS ((void));
void input_scrub_close PARAMS ((void));
void input_scrub_end PARAMS ((void));
-void new_logical_line PARAMS ((char *fname, int line_number));
+int new_logical_line PARAMS ((char *fname, int line_number));
void subsegs_begin PARAMS ((void));
void subseg_change PARAMS ((segT seg, int subseg));
segT subseg_new PARAMS ((const char *name, subsegT subseg));
@@ -619,16 +573,26 @@ void subseg_set PARAMS ((segT seg, subsegT subseg));
segT subseg_get PARAMS ((const char *, int));
#endif
+void start_dependencies PARAMS ((char *));
+void register_dependency PARAMS ((char *));
+void print_dependencies PARAMS ((void));
+
struct expressionS;
struct fix;
struct symbol;
struct relax_type;
+typedef struct frag fragS;
#ifdef BFD_ASSEMBLER
/* literal.c */
valueT add_to_literal_pool PARAMS ((struct symbol *, valueT, segT, int));
#endif
+int check_eh_frame PARAMS ((struct expressionS *, unsigned int *));
+int eh_frame_estimate_size_before_relax PARAMS ((fragS *));
+int eh_frame_relax_frag PARAMS ((fragS *));
+void eh_frame_convert_frag PARAMS ((fragS *));
+
#include "expr.h" /* Before targ-*.h */
/* this one starts the chain of target dependant headers */
@@ -657,6 +621,12 @@ valueT add_to_literal_pool PARAMS ((struct symbol *, valueT, segT, int));
#define LOCAL_LABELS_FB 0
#endif
+#ifndef TEXT_SECTION_NAME
+#define TEXT_SECTION_NAME ".text"
+#define DATA_SECTION_NAME ".data"
+#define BSS_SECTION_NAME ".bss"
+#endif
+
#endif /* GAS */
/* end of as.h */
diff --git a/contrib/binutils/gas/atof-generic.c b/contrib/binutils/gas/atof-generic.c
index 9a00f04..e3ae2e1 100644
--- a/contrib/binutils/gas/atof-generic.c
+++ b/contrib/binutils/gas/atof-generic.c
@@ -1,5 +1,5 @@
/* atof_generic.c - turn a string of digits into a Flonum
- Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 1996
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -87,10 +87,10 @@ atof_generic (address_of_string_pointer,
{
int return_value; /* 0 means OK. */
char *first_digit;
- int number_of_digits_before_decimal;
- int number_of_digits_after_decimal;
+ unsigned int number_of_digits_before_decimal;
+ unsigned int number_of_digits_after_decimal;
long decimal_exponent;
- int number_of_digits_available;
+ unsigned int number_of_digits_available;
char digits_sign_char;
/*
@@ -170,7 +170,7 @@ atof_generic (address_of_string_pointer,
&& (!c || !strchr (string_of_decimal_exponent_marks, c)));
p++)
{
- if (isdigit (c))
+ if (isdigit ((unsigned char) c))
{
if (seen_significant_digit || c > '0')
{
@@ -197,9 +197,9 @@ atof_generic (address_of_string_pointer,
*/
if (c && IS_DECIMAL_MARK (c))
{
- int zeros = 0; /* Length of current string of zeros */
+ unsigned int zeros = 0; /* Length of current string of zeros */
- for (p++; (c = *p) && isdigit (c); p++)
+ for (p++; (c = *p) && isdigit ((unsigned char) c); p++)
{
if (c == '0')
{
@@ -274,7 +274,7 @@ atof_generic (address_of_string_pointer,
for (; (c); c = *++p)
{
- if (isdigit (c))
+ if (isdigit ((unsigned char) c))
{
decimal_exponent = decimal_exponent * 10 + c - '0';
/*
@@ -401,7 +401,7 @@ atof_generic (address_of_string_pointer,
for (p = first_digit, count = number_of_digits_to_use; count; p++, --count)
{
c = *p;
- if (isdigit (c))
+ if (isdigit ((unsigned char) c))
{
/*
* Multiply by 10. Assume can never overflow.
diff --git a/contrib/binutils/gas/cgen.c b/contrib/binutils/gas/cgen.c
index e9024e4..2c541ef 100644
--- a/contrib/binutils/gas/cgen.c
+++ b/contrib/binutils/gas/cgen.c
@@ -1,5 +1,5 @@
/* GAS interface for targets using CGEN: Cpu tools GENerator.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -17,8 +17,10 @@ You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#include <setjmp.h>
#include "ansidecl.h"
#include "bfd.h"
+#include "symcat.h"
#include "cgen-opc.h"
#include "as.h"
#include "subsegs.h"
@@ -29,13 +31,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
void
cgen_asm_record_register (name, number)
- char *name;
- int number;
+ char * name;
+ int number;
{
/* Use symbol_create here instead of symbol_new so we don't try to
output registers into the object file's symbol table. */
symbol_table_insert (symbol_create (name, reg_section,
- number, &zero_address_frag));
+ number, & zero_address_frag));
}
/* We need to keep a list of fixups. We can't simply generate them as
@@ -51,15 +53,15 @@ cgen_asm_record_register (name, number)
struct fixup
{
- int opindex;
- int opinfo;
+ int opindex;
+ int opinfo;
expressionS exp;
};
#define MAX_FIXUPS 5
-static struct fixup fixups[MAX_FIXUPS];
-static int num_fixups;
+static struct fixup fixups [MAX_FIXUPS];
+static int num_fixups;
/* Prepare to parse an instruction.
??? May wish to make this static and delete calls in md_assemble. */
@@ -72,18 +74,74 @@ cgen_asm_init_parse ()
/* Queue a fixup. */
-void
+static void
cgen_queue_fixup (opindex, opinfo, expP)
- int opindex;
- expressionS *expP;
+ int opindex;
+ expressionS * expP;
{
/* We need to generate a fixup for this expression. */
if (num_fixups >= MAX_FIXUPS)
as_fatal ("too many fixups");
- fixups[num_fixups].exp = *expP;
+ fixups[num_fixups].exp = * expP;
fixups[num_fixups].opindex = opindex;
- fixups[num_fixups].opinfo = opinfo;
- ++num_fixups;
+ fixups[num_fixups].opinfo = opinfo;
+ ++ num_fixups;
+}
+
+/* The following three functions allow a backup of the fixup chain to be made,
+ and to have this backup be swapped with the current chain. This allows
+ certain ports, eg the m32r, to swap two instructions and swap their fixups
+ at the same time. */
+static struct fixup saved_fixups [MAX_FIXUPS];
+static int saved_num_fixups;
+
+void
+cgen_save_fixups ()
+{
+ saved_num_fixups = num_fixups;
+
+ memcpy (saved_fixups, fixups, sizeof (fixups[0]) * num_fixups);
+
+ num_fixups = 0;
+}
+
+void
+cgen_restore_fixups ()
+{
+ num_fixups = saved_num_fixups;
+
+ memcpy (fixups, saved_fixups, sizeof (fixups[0]) * num_fixups);
+
+ saved_num_fixups = 0;
+}
+
+void
+cgen_swap_fixups ()
+{
+ int tmp;
+ struct fixup tmp_fixup;
+
+ if (num_fixups == 0)
+ {
+ cgen_restore_fixups ();
+ }
+ else if (saved_num_fixups == 0)
+ {
+ cgen_save_fixups ();
+ }
+ else
+ {
+ tmp = saved_num_fixups;
+ saved_num_fixups = num_fixups;
+ num_fixups = tmp;
+
+ for (tmp = MAX_FIXUPS; tmp--;)
+ {
+ tmp_fixup = saved_fixups [tmp];
+ saved_fixups [tmp] = fixups [tmp];
+ fixups [tmp] = tmp_fixup;
+ }
+ }
}
/* Default routine to record a fixup.
@@ -101,16 +159,16 @@ cgen_queue_fixup (opindex, opinfo, expP)
fixS *
cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offset)
- fragS *frag;
- int where;
- const struct cgen_insn *insn;
- int length;
- const struct cgen_operand *operand;
- int opinfo;
- symbolS *symbol;
- offsetT offset;
+ fragS * frag;
+ int where;
+ const CGEN_INSN * insn;
+ int length;
+ const CGEN_OPERAND * operand;
+ int opinfo;
+ symbolS * symbol;
+ offsetT offset;
{
- fixS *fixP;
+ fixS * fixP;
/* It may seem strange to use operand->attrs and not insn->attrs here,
but it is the operand that has a pc relative relocation. */
@@ -118,7 +176,7 @@ cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offset)
fixP = fix_new (frag, where, length / 8, symbol, offset,
CGEN_OPERAND_ATTR (operand, CGEN_OPERAND_PCREL_ADDR) != 0,
(bfd_reloc_code_real_type) ((int) BFD_RELOC_UNUSED + CGEN_OPERAND_INDEX (operand)));
- fixP->tc_fix_data.insn = (PTR) insn;
+ fixP->tc_fix_data.insn = (PTR) insn;
fixP->tc_fix_data.opinfo = opinfo;
return fixP;
@@ -139,15 +197,15 @@ cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offset)
fixS *
cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp)
- fragS *frag;
- int where;
- const struct cgen_insn *insn;
- int length;
- const struct cgen_operand *operand;
- int opinfo;
- expressionS *exp;
+ fragS * frag;
+ int where;
+ const CGEN_INSN * insn;
+ int length;
+ const CGEN_OPERAND * operand;
+ int opinfo;
+ expressionS * exp;
{
- fixS *fixP;
+ fixS * fixP;
/* It may seem strange to use operand->attrs and not insn->attrs here,
but it is the operand that has a pc relative relocation. */
@@ -161,6 +219,9 @@ cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp)
return fixP;
}
+/* Used for communication between the next two procedures. */
+static jmp_buf expr_jmp_buf;
+
/* Callback for cgen interface. Parse the expression at *STRP.
The result is an error message or NULL for success (in which case
*STRP is advanced past the parsed text).
@@ -174,16 +235,23 @@ cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp)
const char *
cgen_parse_operand (want, strP, opindex, opinfo, resultP, valueP)
- enum cgen_parse_operand_type want;
- const char **strP;
- int opindex;
- int opinfo;
- enum cgen_parse_operand_result *resultP;
- bfd_vma *valueP;
+ enum cgen_parse_operand_type want;
+ const char ** strP;
+ int opindex;
+ int opinfo;
+ enum cgen_parse_operand_result * resultP;
+ bfd_vma * valueP;
{
- char *hold;
- const char *errmsg = NULL;
- expressionS exp;
+#ifdef __STDC__
+ /* These is volatile to survive the setjmp. */
+ char * volatile hold;
+ enum cgen_parse_operand_result * volatile resultP_1;
+#else
+ static char * hold;
+ static enum cgen_parse_operand_result * resultP_1;
+#endif
+ const char * errmsg = NULL;
+ expressionS exp;
if (want == CGEN_PARSE_OPERAND_INIT)
{
@@ -191,10 +259,22 @@ cgen_parse_operand (want, strP, opindex, opinfo, resultP, valueP)
return NULL;
}
+ resultP_1 = resultP;
hold = input_line_pointer;
- input_line_pointer = (char *) *strP;
- expression (&exp);
- *strP = input_line_pointer;
+ input_line_pointer = (char *) * strP;
+
+ /* We rely on md_operand to longjmp back to us.
+ This is done via cgen_md_operand. */
+ if (setjmp (expr_jmp_buf) != 0)
+ {
+ input_line_pointer = (char *) hold;
+ * resultP_1 = CGEN_PARSE_OPERAND_RESULT_ERROR;
+ return "illegal operand";
+ }
+
+ expression (& exp);
+
+ * strP = input_line_pointer;
input_line_pointer = hold;
/* FIXME: Need to check `want'. */
@@ -203,48 +283,63 @@ cgen_parse_operand (want, strP, opindex, opinfo, resultP, valueP)
{
case O_illegal :
errmsg = "illegal operand";
- *resultP = CGEN_PARSE_OPERAND_RESULT_ERROR;
+ * resultP = CGEN_PARSE_OPERAND_RESULT_ERROR;
break;
case O_absent :
errmsg = "missing operand";
- *resultP = CGEN_PARSE_OPERAND_RESULT_ERROR;
+ * resultP = CGEN_PARSE_OPERAND_RESULT_ERROR;
break;
case O_constant :
- *valueP = exp.X_add_number;
- *resultP = CGEN_PARSE_OPERAND_RESULT_NUMBER;
+ * valueP = exp.X_add_number;
+ * resultP = CGEN_PARSE_OPERAND_RESULT_NUMBER;
break;
case O_register :
- *valueP = exp.X_add_number;
- *resultP = CGEN_PARSE_OPERAND_RESULT_REGISTER;
+ * valueP = exp.X_add_number;
+ * resultP = CGEN_PARSE_OPERAND_RESULT_REGISTER;
break;
default :
- cgen_queue_fixup (opindex, opinfo, &exp);
- *valueP = 0;
- *resultP = CGEN_PARSE_OPERAND_RESULT_QUEUED;
+ cgen_queue_fixup (opindex, opinfo, & exp);
+ * valueP = 0;
+ * resultP = CGEN_PARSE_OPERAND_RESULT_QUEUED;
break;
}
return errmsg;
}
+/* md_operand handler to catch unrecognized expressions and halt the
+ parsing process so the next entry can be tried.
+
+ ??? This could be done differently by adding code to `expression'. */
+
+void
+cgen_md_operand (expressionP)
+ expressionS * expressionP;
+{
+ longjmp (expr_jmp_buf, 1);
+}
+
/* Finish assembling instruction INSN.
BUF contains what we've built up so far.
- LENGTH is the size of the insn in bits. */
+ LENGTH is the size of the insn in bits.
+ Returns the address of the buffer containing the assembled instruction,
+ in case the caller needs to modify it for some reason. */
-void
+char *
cgen_asm_finish_insn (insn, buf, length)
- const struct cgen_insn *insn;
- cgen_insn_t *buf;
- unsigned int length;
+ const CGEN_INSN * insn;
+ cgen_insn_t * buf;
+ unsigned int length;
{
- int i, relax_operand;
- char *f;
+ int i;
+ int relax_operand;
+ char * f;
unsigned int byte_len = length / 8;
/* ??? Target foo issues various warnings here, so one might want to provide
a hook here. However, our caller is defined in tc-foo.c so there
shouldn't be a need for a hook. */
-
+
/* Write out the instruction.
It is important to fetch enough space in one call to `frag_more'.
We use (f - frag_now->fr_literal) to compute where we are and we
@@ -264,7 +359,7 @@ cgen_asm_finish_insn (insn, buf, length)
/* Scan the fixups for the operand affected by relaxing
(i.e. the branch address). */
- for (i = 0; i < num_fixups; ++i)
+ for (i = 0; i < num_fixups; ++ i)
{
if (CGEN_OPERAND_ATTR (& CGEN_SYM (operand_table) [fixups[i].opindex],
CGEN_OPERAND_RELAX) != 0)
@@ -277,8 +372,8 @@ cgen_asm_finish_insn (insn, buf, length)
if (relax_operand != -1)
{
- int max_len;
- fragS *old_frag;
+ int max_len;
+ fragS * old_frag;
#ifdef TC_CGEN_MAX_RELAX
max_len = TC_CGEN_MAX_RELAX (insn, byte_len);
@@ -288,10 +383,13 @@ cgen_asm_finish_insn (insn, buf, length)
/* Ensure variable part and fixed part are in same fragment. */
/* FIXME: Having to do this seems like a hack. */
frag_grow (max_len);
+
/* Allocate space for the fixed part. */
f = frag_more (byte_len);
+
/* Create a relaxable fragment for this instruction. */
old_frag = frag_now;
+
frag_var (rs_machine_dependent,
max_len - byte_len /* max chars */,
0 /* variable part already allocated */,
@@ -301,14 +399,12 @@ cgen_asm_finish_insn (insn, buf, length)
fixups[relax_operand].exp.X_add_symbol,
fixups[relax_operand].exp.X_add_number,
f);
+
/* Record the operand number with the fragment so md_convert_frag
can use cgen_md_record_fixup to record the appropriate reloc. */
- /* FIXME: fr_targ.cgen is used pending deciding whether to
- allow a target to add members to fragS. For more info
- see the comment above fr_targ in as.h. */
- old_frag->fr_targ.cgen.insn = insn;
- old_frag->fr_targ.cgen.opindex = fixups[relax_operand].opindex;
- old_frag->fr_targ.cgen.opinfo = fixups[relax_operand].opinfo;
+ old_frag->fr_cgen.insn = insn;
+ old_frag->fr_cgen.opindex = fixups[relax_operand].opindex;
+ old_frag->fr_cgen.opinfo = fixups[relax_operand].opinfo;
}
else
f = frag_more (byte_len);
@@ -320,15 +416,15 @@ cgen_asm_finish_insn (insn, buf, length)
{
case 16:
if (cgen_big_endian_p)
- bfd_putb16 ((bfd_vma) *buf, f);
+ bfd_putb16 ((bfd_vma) * buf, f);
else
- bfd_putl16 ((bfd_vma) *buf, f);
+ bfd_putl16 ((bfd_vma) * buf, f);
break;
case 32:
if (cgen_big_endian_p)
- bfd_putb32 ((bfd_vma) *buf, f);
+ bfd_putb32 ((bfd_vma) * buf, f);
else
- bfd_putl32 ((bfd_vma) *buf, f);
+ bfd_putl32 ((bfd_vma) * buf, f);
break;
default:
abort ();
@@ -356,8 +452,10 @@ cgen_asm_finish_insn (insn, buf, length)
insn, length,
& CGEN_SYM (operand_table) [fixups[i].opindex],
fixups[i].opinfo,
- &fixups[i].exp);
+ & fixups[i].exp);
}
+
+ return f;
}
/* Apply a fixup to the object code. This is called for all the
@@ -374,11 +472,11 @@ cgen_asm_finish_insn (insn, buf, length)
int
cgen_md_apply_fix3 (fixP, valueP, seg)
- fixS *fixP;
- valueT *valueP;
- segT seg;
+ fixS * fixP;
+ valueT * valueP;
+ segT seg;
{
- char *where = fixP->fx_frag->fr_literal + fixP->fx_where;
+ char * where = fixP->fx_frag->fr_literal + fixP->fx_where;
valueT value;
/* FIXME FIXME FIXME: The value we are passed in *valuep includes
@@ -394,11 +492,11 @@ cgen_md_apply_fix3 (fixP, valueP, seg)
if (fixP->fx_addsy == (symbolS *) NULL)
{
- value = *valueP;
+ value = * valueP;
fixP->fx_done = 1;
}
else if (fixP->fx_pcrel)
- value = *valueP;
+ value = * valueP;
else
{
value = fixP->fx_offset;
@@ -417,12 +515,12 @@ cgen_md_apply_fix3 (fixP, valueP, seg)
if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
{
- int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
- const struct cgen_operand *operand = & CGEN_SYM (operand_table) [opindex];
- const char *errmsg;
+ int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+ const CGEN_OPERAND * operand = & CGEN_SYM (operand_table) [opindex];
+ const char * errmsg;
bfd_reloc_code_real_type reloc_type;
- struct cgen_fields fields;
- const struct cgen_insn *insn = (struct cgen_insn *) fixP->tc_fix_data.insn;
+ CGEN_FIELDS fields;
+ const CGEN_INSN * insn = (CGEN_INSN *) fixP->tc_fix_data.insn;
/* If the reloc has been fully resolved finish the operand here. */
/* FIXME: This duplicates the capabilities of code in BFD. */
@@ -431,14 +529,11 @@ cgen_md_apply_fix3 (fixP, valueP, seg)
finish the job. Testing for pcrel is a temporary hack. */
|| fixP->fx_pcrel)
{
- /* This may seem like overkill, and using bfd_install_relocation or
- some such may be preferable, but this is simple. */
- CGEN_FIELDS_BITSIZE (&fields) = CGEN_INSN_BITSIZE (insn);
- CGEN_SYM (set_operand) (opindex, &value, &fields);
- errmsg = CGEN_SYM (validate_operand) (opindex, &fields);
+ CGEN_FIELDS_BITSIZE (& fields) = CGEN_INSN_BITSIZE (insn);
+ CGEN_SYM (set_operand) (opindex, & value, & fields);
+ errmsg = CGEN_SYM (insert_operand) (opindex, & fields, where);
if (errmsg)
as_warn_where (fixP->fx_file, fixP->fx_line, "%s\n", errmsg);
- CGEN_SYM (insert_operand) (opindex, &fields, where);
}
if (fixP->fx_done)
@@ -501,10 +596,10 @@ cgen_md_apply_fix3 (fixP, valueP, seg)
arelent *
cgen_tc_gen_reloc (section, fixP)
- asection *section;
- fixS *fixP;
+ asection * section;
+ fixS * fixP;
{
- arelent *reloc;
+ arelent * reloc;
reloc = (arelent *) bfd_alloc (stdoutput, sizeof (arelent));
@@ -519,9 +614,9 @@ cgen_tc_gen_reloc (section, fixP)
assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
- reloc->sym_ptr_ptr = &fixP->fx_addsy->bsym;
- reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
- reloc->addend = fixP->fx_addnumber;
+ reloc->sym_ptr_ptr = & fixP->fx_addsy->bsym;
+ reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
+ reloc->addend = fixP->fx_addnumber;
return reloc;
}
diff --git a/contrib/binutils/gas/cond.c b/contrib/binutils/gas/cond.c
index 855848c..eef4747 100644
--- a/contrib/binutils/gas/cond.c
+++ b/contrib/binutils/gas/cond.c
@@ -1,5 +1,6 @@
/* cond.c - conditional assembly pseudo-ops, and .include
- Copyright (C) 1990, 91, 92, 93, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -137,6 +138,7 @@ s_if (arg)
case O_gt: t = operand.X_add_number > 0; break;
default:
abort ();
+ return;
}
/* If the above error is signaled, this will dispatch
@@ -240,6 +242,8 @@ s_ifc (arg)
if (flag_mri)
mri_comment_end (stop, stopc);
+
+ demand_empty_rest_of_line ();
}
void
@@ -301,9 +305,13 @@ s_else (arg)
if (!current_cframe->dead_tree)
{
current_cframe->ignoring = !current_cframe->ignoring;
- if (LISTING_SKIP_COND ()
- && ! current_cframe->ignoring)
- listing_list (1);
+ if (LISTING_SKIP_COND ())
+ {
+ if (! current_cframe->ignoring)
+ listing_list (1);
+ else
+ listing_list (2);
+ }
} /* if not a dead tree */
current_cframe->else_seen = 1;
diff --git a/contrib/binutils/gas/config.in b/contrib/binutils/gas/config.in
new file mode 100644
index 0000000..d737a21
--- /dev/null
+++ b/contrib/binutils/gas/config.in
@@ -0,0 +1,145 @@
+/* config.in. Generated automatically from configure.in by autoheader. */
+
+/* Define if using alloca.c. */
+#undef C_ALLOCA
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+#undef CRAY_STACKSEG_END
+
+/* Define if you have alloca, as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
+
+/* Define as __inline if that's what the C compiler calls it. */
+#undef inline
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#undef STACK_DIRECTION
+
+/* Define if lex declares yytext as a char * by default, not a char[]. */
+#undef YYTEXT_POINTER
+
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
+
+/* Should gas use high-level BFD interfaces? */
+#undef BFD_ASSEMBLER
+
+/* Some assert/preprocessor combinations are incapable of handling
+ certain kinds of constructs in the argument of assert. For example,
+ quoted strings (if requoting isn't done right) or newlines. */
+#undef BROKEN_ASSERT
+
+/* If we aren't doing cross-assembling, some operations can be optimized,
+ since byte orders and value sizes don't need to be adjusted. */
+#undef CROSS_COMPILE
+
+/* Some gas code wants to know these parameters. */
+#undef TARGET_ALIAS
+#undef TARGET_CPU
+#undef TARGET_CANONICAL
+#undef TARGET_OS
+#undef TARGET_VENDOR
+
+/* Sometimes the system header files don't declare strstr. */
+#undef NEED_DECLARATION_STRSTR
+
+/* Sometimes the system header files don't declare malloc and realloc. */
+#undef NEED_DECLARATION_MALLOC
+
+/* Sometimes the system header files don't declare free. */
+#undef NEED_DECLARATION_FREE
+
+/* Sometimes the system header files don't declare sbrk. */
+#undef NEED_DECLARATION_SBRK
+
+/* Sometimes errno.h doesn't declare errno itself. */
+#undef NEED_DECLARATION_ERRNO
+
+#undef MANY_SEGMENTS
+
+/* The configure script defines this for some targets based on the
+ target name used. It is not always defined. */
+#undef TARGET_BYTES_BIG_ENDIAN
+
+/* Needed only for some configurations that can produce multiple output
+ formats. */
+#undef DEFAULT_EMULATION
+#undef EMULATIONS
+#undef USE_EMULATIONS
+#undef OBJ_MAYBE_AOUT
+#undef OBJ_MAYBE_BOUT
+#undef OBJ_MAYBE_COFF
+#undef OBJ_MAYBE_ECOFF
+#undef OBJ_MAYBE_ELF
+#undef OBJ_MAYBE_GENERIC
+#undef OBJ_MAYBE_HP300
+#undef OBJ_MAYBE_IEEE
+#undef OBJ_MAYBE_SOM
+#undef OBJ_MAYBE_VMS
+
+/* Used for some of the COFF configurations, when the COFF code needs
+ to select something based on the CPU type before it knows it... */
+#undef I386COFF
+#undef M68KCOFF
+#undef M88KCOFF
+
+/* Using cgen code? */
+#undef USING_CGEN
+
+/* Needed only for sparc configuration. */
+#undef DEFAULT_ARCH
+
+/* Needed only for PowerPC Solaris. */
+#undef TARGET_SOLARIS_COMMENT
+
+/* Needed only for SCO 5. */
+#undef SCO_ELF
+
+/* Define if you have the remove function. */
+#undef HAVE_REMOVE
+
+/* Define if you have the sbrk function. */
+#undef HAVE_SBRK
+
+/* Define if you have the unlink function. */
+#undef HAVE_UNLINK
+
+/* Define if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <varargs.h> header file. */
+#undef HAVE_VARARGS_H
diff --git a/contrib/binutils/gas/config/atof-ieee.c b/contrib/binutils/gas/config/atof-ieee.c
index e0726b7..3ac1f01 100644
--- a/contrib/binutils/gas/config/atof-ieee.c
+++ b/contrib/binutils/gas/config/atof-ieee.c
@@ -1,5 +1,6 @@
/* atof_ieee.c - turn a Flonum into an IEEE floating point number
- Copyright (C) 1987, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -525,6 +526,22 @@ gen_to_words (words, precision, exponent_bits)
carry >>= LITTLENUM_NUMBER_OF_BITS;
}
}
+ else
+ {
+ /* This is an overflow of the denormal numbers. We
+ need to forget what we have produced, and instead
+ generate the smallest normalized number. */
+ lp = words;
+ word1 = ((generic_floating_point_number.sign == '+')
+ ? 0
+ : (1 << (LITTLENUM_NUMBER_OF_BITS - 1)));
+ word1 |= (1
+ << ((LITTLENUM_NUMBER_OF_BITS - 1)
+ - exponent_bits));
+ *lp++ = word1;
+ while (lp < words_end)
+ *lp++ = 0;
+ }
}
else if ((*lp & mask[prec_bits]) != mask[prec_bits])
*lp += 1;
@@ -532,7 +549,7 @@ gen_to_words (words, precision, exponent_bits)
return return_value;
}
- else if (exponent_4 >= mask[exponent_bits])
+ else if ((unsigned long) exponent_4 >= mask[exponent_bits])
{
/*
* Exponent overflow. Lose immediately.
diff --git a/contrib/binutils/gas/config/obj-aout.c b/contrib/binutils/gas/config/obj-aout.c
index bb566e1..7dc8946 100644
--- a/contrib/binutils/gas/config/obj-aout.c
+++ b/contrib/binutils/gas/config/obj-aout.c
@@ -461,7 +461,7 @@ obj_crawl_symbol_chain (headers)
S_SET_SEGMENT (symbolP, SEG_TEXT);
} /* if pusing data into text */
- resolve_symbol_value (symbolP);
+ resolve_symbol_value (symbolP, 1);
/* Skip symbols which were equated to undefined or common
symbols. */
diff --git a/contrib/binutils/gas/config/obj-aout.h b/contrib/binutils/gas/config/obj-aout.h
index ab47ab6..339070e 100644
--- a/contrib/binutils/gas/config/obj-aout.h
+++ b/contrib/binutils/gas/config/obj-aout.h
@@ -1,5 +1,5 @@
/* obj-aout.h, a.out object file format for gas, the assembler.
- Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -14,9 +14,10 @@
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 GAS; see the file COPYING. If not, write
- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
/* Tag to validate a.out object file format processing */
#define OBJ_AOUT 1
@@ -102,11 +103,14 @@ extern void obj_aout_frob_file PARAMS ((void));
#define S_IS_DEBUG(s) ((s)->sy_symbol.n_type & N_STAB)
/* True if a symbol is local symbol name */
#define S_IS_LOCAL(s) \
- (S_GET_NAME (s) \
- && !S_IS_DEBUG (s) \
- && (strchr (S_GET_NAME (s), '\001') != NULL \
- || strchr (S_GET_NAME (s), '\002') != NULL \
- || (S_LOCAL_NAME(s) && !flag_keep_locals)))
+ ((S_GET_NAME (s) \
+ && !S_IS_DEBUG (s) \
+ && (strchr (S_GET_NAME (s), '\001') != NULL \
+ || strchr (S_GET_NAME (s), '\002') != NULL \
+ || (S_LOCAL_NAME(s) && !flag_keep_locals))) \
+ || (flag_strip_local_absolute \
+ && ! S_IS_EXTERNAL(s) \
+ && S_GET_SEGMENT (s) == absolute_section))
/* True if a symbol is not defined in this file */
#define S_IS_EXTERN(s) ((s)->sy_symbol.n_type & N_EXT)
/* True if the symbol has been generated because of a .stabd directive */
diff --git a/contrib/binutils/gas/config/obj-coff.c b/contrib/binutils/gas/config/obj-coff.c
index 2fe0cb8..a6421bf 100644
--- a/contrib/binutils/gas/config/obj-coff.c
+++ b/contrib/binutils/gas/config/obj-coff.c
@@ -1,5 +1,5 @@
/* coff object file format
- Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS.
@@ -30,6 +30,7 @@
#define KEEP_RELOC_INFO
#endif
+static void obj_coff_bss PARAMS ((int));
const char *s_get_name PARAMS ((symbolS * s));
static symbolS *def_symbol_in_progress;
@@ -165,7 +166,18 @@ tag_find_or_make (name)
return symbolP;
}
+/* We accept the .bss directive to set the section for backward
+ compatibility with earlier versions of gas. */
+static void
+obj_coff_bss (ignore)
+ int ignore;
+{
+ if (*input_line_pointer == '\n')
+ subseg_new (".bss", get_absolute_expression ());
+ else
+ s_lcomm (0);
+}
#ifdef BFD_ASSEMBLER
@@ -1088,8 +1100,9 @@ coff_adjust_section_syms (abfd, sec, x)
fixS *fixp = seginfo->fix_root;
while (fixp)
{
+ if (! fixp->fx_done)
+ nrelocs++;
fixp = fixp->fx_next;
- nrelocs++;
}
}
if (bfd_get_section_size_before_reloc (sec) == 0
@@ -1105,7 +1118,7 @@ coff_adjust_section_syms (abfd, sec, x)
}
void
-coff_frob_file ()
+coff_frob_file_after_relocs ()
{
bfd_map_over_sections (stdoutput, coff_adjust_section_syms, (char*) 0);
}
@@ -1433,7 +1446,6 @@ static void adjust_stab_section PARAMS ((bfd *abfd, segT seg));
static void obj_coff_lcomm PARAMS ((int));
static void obj_coff_text PARAMS ((int));
static void obj_coff_data PARAMS ((int));
-static void obj_coff_bss PARAMS ((int));
static void obj_coff_ident PARAMS ((int));
void obj_coff_section PARAMS ((int));
@@ -1684,7 +1696,7 @@ do_relocs_for (abfd, h, file_cursor)
/* Turn the segment of the symbol into an offset. */
if (symbol_ptr)
{
- resolve_symbol_value (symbol_ptr);
+ resolve_symbol_value (symbol_ptr, 1);
if (! symbol_ptr->sy_resolved)
{
char *file;
@@ -1978,8 +1990,12 @@ symbol_to_chars (abfd, where, symbolP)
}
/* At the same time, relocate all symbols to their output value */
+#ifndef TE_PE
val = (segment_info[S_GET_SEGMENT (symbolP)].scnhdr.s_paddr
+ S_GET_VALUE (symbolP));
+#else
+ val = S_GET_VALUE (symbolP);
+#endif
S_SET_VALUE (symbolP, val);
@@ -2656,7 +2672,7 @@ yank_symbols ()
S_SET_SEGMENT (symbolP, SEG_E0);
} /* push data into text */
- resolve_symbol_value (symbolP);
+ resolve_symbol_value (symbolP, 1);
if (S_GET_STORAGE_CLASS (symbolP) == C_NULL)
{
@@ -3200,7 +3216,11 @@ write_object_file ()
/* I think the section alignment is only used on the i960; the
i960 needs it, and it should do no harm on other targets. */
+#ifdef ALIGNMENT_IN_S_FLAGS
+ segment_info[i].scnhdr.s_flags |= (section_alignment[i] & 0xF) << 8;
+#else
segment_info[i].scnhdr.s_align = 1 << section_alignment[i];
+#endif
if (i == SEG_E0)
H_SET_TEXT_SIZE (&headers, size);
@@ -3456,16 +3476,6 @@ obj_coff_data (ignore)
}
static void
-obj_coff_bss (ignore)
- int ignore;
-{
- if (*input_line_pointer == '\n') /* .bss */
- subseg_new(".bss", get_absolute_expression());
- else /* .bss id,expr */
- obj_coff_lcomm(0);
-}
-
-static void
obj_coff_ident (ignore)
int ignore;
{
@@ -3885,7 +3895,7 @@ fixup_segment (segP, this_segment_type)
/* Make sure the symbols have been resolved; this may not have
happened if these are expression symbols. */
if (add_symbolP != NULL && ! add_symbolP->sy_resolved)
- resolve_symbol_value (add_symbolP);
+ resolve_symbol_value (add_symbolP, 1);
if (add_symbolP != NULL)
{
@@ -3915,7 +3925,7 @@ fixup_segment (segP, this_segment_type)
}
if (sub_symbolP != NULL && ! sub_symbolP->sy_resolved)
- resolve_symbol_value (sub_symbolP);
+ resolve_symbol_value (sub_symbolP, 1);
if (add_symbolP != NULL
&& add_symbolP->sy_mri_common)
@@ -4048,11 +4058,21 @@ fixup_segment (segP, this_segment_type)
add_number += S_GET_VALUE (add_symbolP);
add_number -= md_pcrel_from (fixP);
-#if defined (TC_I386) || defined (TE_LYNX)
- /* On the 386 we must adjust by the segment vaddr as
- well. Ian Taylor. */
- add_number -= segP->scnhdr.s_vaddr;
-#endif
+
+ /* We used to do
+ add_number -= segP->scnhdr.s_vaddr;
+ if defined (TC_I386) || defined (TE_LYNX). I now
+ think that was an error propagated from the case when
+ we are going to emit the relocation. If we are not
+ going to emit the relocation, then we just want to
+ set add_number to the difference between the symbols.
+ This is a case that would only arise when there is a
+ PC relative reference from a section other than .text
+ to a symbol defined in the same section, and the
+ reference is not relaxed. Since jump instructions on
+ the i386 are relaxed, this could only arise with a
+ call instruction. */
+
pcrel = 0; /* Lie. Don't want further pcrel processing. */
if (!TC_FORCE_RELOCATION (fixP))
{
@@ -4196,7 +4216,7 @@ fixup_segment (segP, this_segment_type)
/* Once this fix has been applied, we don't have to output
anything nothing more need be done. */
#ifdef MD_APPLY_FIX3
- md_apply_fix3 (fixP, &add_number, this_segment_type);
+ md_apply_fix3 (fixP, (valueT *) &add_number, this_segment_type);
#else
md_apply_fix (fixP, add_number);
#endif
@@ -4300,11 +4320,13 @@ const pseudo_typeS obj_pseudo_table[] =
/* FIXME: We ignore the MRI short attribute. */
{"section.s", obj_coff_section, 0},
{"sect.s", obj_coff_section, 0},
+ /* We accept the .bss directive for backward compatibility with
+ earlier versions of gas. */
+ {"bss", obj_coff_bss, 0},
#ifndef BFD_ASSEMBLER
{"use", obj_coff_section, 0},
{"text", obj_coff_text, 0},
{"data", obj_coff_data, 0},
- {"bss", obj_coff_bss, 0},
{"lcomm", obj_coff_lcomm, 0},
{"ident", obj_coff_ident, 0},
#else
@@ -4349,8 +4371,8 @@ const struct format_ops coff_format_ops =
0,
1,
coff_frob_symbol,
- coff_frob_file,
no_func,
+ coff_frob_file_after_relocs,
0, 0,
0, 0,
0,
diff --git a/contrib/binutils/gas/config/obj-coff.h b/contrib/binutils/gas/config/obj-coff.h
index 1cc5d2d..f796461 100644
--- a/contrib/binutils/gas/config/obj-coff.h
+++ b/contrib/binutils/gas/config/obj-coff.h
@@ -1,5 +1,5 @@
/* coff object file format
- Copyright (C) 1989, 90, 91, 92, 94, 95, 96, 1997
+ Copyright (C) 1989, 90, 91, 92, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS.
@@ -63,11 +63,6 @@
#ifdef TC_SPARC
#include "coff/sparc.h"
-#ifdef TE_LYNX
-#define TARGET_FORMAT "coff-sparc-lynx"
-#else
-#define TARGET_FORMAT "coff-sparc"
-#endif
#endif
#ifdef TC_I386
@@ -116,7 +111,10 @@
#ifdef TC_SH
#include "coff/sh.h"
-#define TARGET_FORMAT (shl ? "coff-shl" : "coff-sh")
+#define TARGET_FORMAT \
+ (shl \
+ ? (sh_small ? "coff-shl-small" : "coff-shl") \
+ : (sh_small ? "coff-sh-small" : "coff-sh"))
#endif
#ifdef TC_M88K
@@ -129,6 +127,11 @@
#define TARGET_FORMAT "coff-w65"
#endif
+#ifdef TC_TIC30
+#include "coff/tic30.h"
+#define TARGET_FORMAT "coff-tic30"
+#endif
+
/* Targets may also set this. Also, if BFD_ASSEMBLER is defined, this
will already have been defined. */
@@ -340,11 +343,11 @@ extern void coff_frob_symbol PARAMS ((struct symbol *, int *));
extern void coff_adjust_symtab PARAMS ((void));
extern void coff_frob_section PARAMS ((segT));
extern void coff_adjust_section_syms PARAMS ((bfd *, asection *, PTR));
-extern void coff_frob_file PARAMS ((void));
+extern void coff_frob_file_after_relocs PARAMS ((void));
#define obj_frob_symbol(S,P) coff_frob_symbol(S,&P)
#define obj_adjust_symtab() coff_adjust_symtab()
#define obj_frob_section(S) coff_frob_section (S)
-#define obj_frob_file() coff_frob_file ()
+#define obj_frob_file_after_relocs() coff_frob_file_after_relocs ()
extern struct symbol *coff_last_function;
@@ -449,7 +452,10 @@ typedef struct
((s)->sy_symbol.ost_entry.n_scnum == C_REGISTER_SECTION \
|| (S_LOCAL_NAME(s) && ! flag_keep_locals && ! S_IS_DEBUG (s)) \
|| strchr (S_GET_NAME (s), '\001') != NULL \
- || strchr (S_GET_NAME (s), '\002') != NULL)
+ || strchr (S_GET_NAME (s), '\002') != NULL \
+ || (flag_strip_local_absolute \
+ && !S_IS_EXTERNAL(s) \
+ && (s)->sy_symbol.ost_entry.n_scnum == C_ABS_SECTION))
/* True if a symbol is not defined in this file */
#define S_IS_EXTERN(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \
&& S_GET_VALUE (s) == 0)
@@ -787,6 +793,18 @@ extern void obj_coff_pe_handle_link_once ();
#endif /* not BFD_ASSEMBLER */
+/* In COFF, if a symbol is defined using .def/.val SYM/.endef, it's OK
+ to redefine the symbol later on. This can happen if C symbols use
+ a prefix, and a symbol is defined both with and without the prefix,
+ as in start/_start/__start in gcc/libgcc1-test.c. */
+#define RESOLVE_SYMBOL_REDEFINITION(sym) \
+(SF_GET_GET_SEGMENT (sym) \
+ ? (sym->sy_frag = frag_now, \
+ S_SET_VALUE (sym, frag_now_fix ()), \
+ S_SET_SEGMENT (sym, now_seg), \
+ 0) \
+ : 0)
+
/* Stabs in a coff file go into their own section. */
#define SEPARATE_STAB_SECTIONS 1
diff --git a/contrib/binutils/gas/config/obj-elf.c b/contrib/binutils/gas/config/obj-elf.c
index c861d54..b8201f5 100644
--- a/contrib/binutils/gas/config/obj-elf.c
+++ b/contrib/binutils/gas/config/obj-elf.c
@@ -33,6 +33,10 @@
#include "ecoff.h"
#endif
+#ifdef TC_ALPHA
+#include "elf/alpha.h"
+#endif
+
#ifdef TC_MIPS
#include "elf/mips.h"
#endif
@@ -65,6 +69,7 @@ static void obj_elf_common PARAMS ((int));
static void obj_elf_symver PARAMS ((int));
static void obj_elf_data PARAMS ((int));
static void obj_elf_text PARAMS ((int));
+static void obj_elf_subsection PARAMS ((int));
static const pseudo_typeS elf_pseudo_table[] =
{
@@ -87,6 +92,9 @@ static const pseudo_typeS elf_pseudo_table[] =
/* This is a GNU extension to handle symbol versions. */
{"symver", obj_elf_symver, 0},
+ /* A GNU extension to change subsection only. */
+ {"subsection", obj_elf_subsection, 0},
+
/* These are used for dwarf. */
{"2byte", cons, 2},
{"4byte", cons, 4},
@@ -155,11 +163,11 @@ elf_begin ()
{
/* Add symbols for the known sections to the symbol table. */
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
- ".text")));
+ TEXT_SECTION_NAME)));
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
- ".data")));
+ DATA_SECTION_NAME)));
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput,
- ".bss")));
+ BSS_SECTION_NAME)));
}
void
@@ -617,6 +625,7 @@ obj_elf_section (xxx)
++input_line_pointer;
SKIP_WHITESPACE ();
+
if (*input_line_pointer == '"')
{
/* Pick up a string with a combination of a, w, x. */
@@ -699,7 +708,7 @@ obj_elf_section (xxx)
SKIP_WHITESPACE ();
if (*input_line_pointer != '#')
{
- as_warn ("Bad .section directive");
+ as_warn ("Bad .section directive - character following name is not '#'");
ignore_rest_of_line ();
return;
}
@@ -791,6 +800,10 @@ obj_elf_section (xxx)
#endif
}
+ /* Prevent SEC_HAS_CONTENTS from being inadvertently set. */
+ if (type == SHT_NOBITS)
+ seg_info (sec)->bss = 1;
+
bfd_set_section_flags (stdoutput, sec, flags);
/* Add a symbol for this section to the symbol table. */
@@ -845,6 +858,28 @@ obj_elf_text (i)
#endif
}
+static void
+obj_elf_subsection (ignore)
+ int ignore;
+{
+ register int temp;
+
+#ifdef md_flush_pending_output
+ md_flush_pending_output ();
+#endif
+
+ previous_section = now_seg;
+ previous_subsection = now_subseg;
+
+ temp = get_absolute_expression ();
+ subseg_set (now_seg, (subsegT) temp);
+ demand_empty_rest_of_line ();
+
+#ifdef md_elf_section_change_hook
+ md_elf_section_change_hook ();
+#endif
+}
+
/* This can be called from the processor backends if they change
sections. */
@@ -1373,10 +1408,17 @@ elf_frob_symbol (symp, puntp)
#ifdef TC_MIPS
/* The Irix 5 and 6 assemblers set the type of any common symbol and
- any undefined non-function symbol to STT_OBJECT. We try to be compatible,
- since newer Irix 5 and 6 linkers care. */
- if (S_IS_COMMON (symp)
- || (! S_IS_DEFINED (symp) && ((symp->bsym->flags & BSF_FUNCTION) == 0)))
+ any undefined non-function symbol to STT_OBJECT. We try to be
+ compatible, since newer Irix 5 and 6 linkers care. However, we
+ only set undefined symbols to be STT_OBJECT if we are on Irix,
+ because that is the only time gcc will generate the necessary
+ .global directives to mark functions. */
+
+ if (S_IS_COMMON (symp))
+ symp->bsym->flags |= BSF_OBJECT;
+
+ if (strstr (TARGET_OS, "irix") != NULL
+ && (! S_IS_DEFINED (symp) && ((symp->bsym->flags & BSF_FUNCTION) == 0)))
symp->bsym->flags |= BSF_OBJECT;
#endif
diff --git a/contrib/binutils/gas/config/obj-elf.h b/contrib/binutils/gas/config/obj-elf.h
index 973f938..ff65790 100644
--- a/contrib/binutils/gas/config/obj-elf.h
+++ b/contrib/binutils/gas/config/obj-elf.h
@@ -107,12 +107,25 @@ extern void obj_elf_version PARAMS ((int));
/* When setting one symbol equal to another, by default we probably
want them to have the same "size", whatever it means in the current
context. */
-#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \
-do \
- { \
- S_SET_SIZE ((DEST), S_GET_SIZE (SRC)); \
- S_SET_OTHER ((DEST), S_GET_OTHER (SRC)); \
- } \
+#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \
+do \
+ { \
+ if ((SRC)->sy_obj.size) \
+ { \
+ if ((DEST)->sy_obj.size == NULL) \
+ (DEST)->sy_obj.size = \
+ (expressionS *) xmalloc (sizeof (expressionS)); \
+ *(DEST)->sy_obj.size = *(SRC)->sy_obj.size; \
+ } \
+ else \
+ { \
+ if ((DEST)->sy_obj.size != NULL) \
+ free ((DEST)->sy_obj.size); \
+ (DEST)->sy_obj.size = NULL; \
+ } \
+ S_SET_SIZE ((DEST), S_GET_SIZE (SRC)); \
+ S_SET_OTHER ((DEST), S_GET_OTHER (SRC)); \
+ } \
while (0)
/* Stabs go in a separate section. */
diff --git a/contrib/binutils/gas/config/obj-multi.h b/contrib/binutils/gas/config/obj-multi.h
index 526b82e..fe8d98d 100644
--- a/contrib/binutils/gas/config/obj-multi.h
+++ b/contrib/binutils/gas/config/obj-multi.h
@@ -16,7 +16,7 @@
#define S_SET_SIZE (this_format->s_set_size)
#define S_GET_ALIGN (this_format->s_get_align)
#define S_SET_ALIGN (this_format->s_set_align)
-#define obj_copy_symbol_attributes (this_format->copy_symbol_attributes)
+#define OBJ_COPY_SYMBOL_ATTRIBUTES (this_format->copy_symbol_attributes)
#define OBJ_PROCESS_STAB (this_format->process_stab)
#if defined (OBJ_MAYBE_ECOFF) || (defined (OBJ_MAYBE_ELF) && defined (TC_MIPS))
diff --git a/contrib/binutils/gas/config/tc-alpha.c b/contrib/binutils/gas/config/tc-alpha.c
index a47191e..4c4da6c 100644
--- a/contrib/binutils/gas/config/tc-alpha.c
+++ b/contrib/binutils/gas/config/tc-alpha.c
@@ -110,11 +110,20 @@ struct alpha_macro
#define note_fpreg(R) (alpha_fprmask |= (1 << (R)))
/* Predicates for 16- and 32-bit ranges */
+/* XXX: The non-shift version appears to trigger a compiler bug when
+ cross-assembling from x86 w/ gcc 2.7.2. */
+#if 1
+#define range_signed_16(x) \
+ (((offsetT)(x) >> 15) == 0 || ((offsetT)(x) >> 15) == -1)
+#define range_signed_32(x) \
+ (((offsetT)(x) >> 31) == 0 || ((offsetT)(x) >> 31) == -1)
+#else
#define range_signed_16(x) ((offsetT)(x) >= -(offsetT)0x8000 && \
(offsetT)(x) <= (offsetT)0x7FFF)
#define range_signed_32(x) ((offsetT)(x) >= -(offsetT)0x80000000 && \
(offsetT)(x) <= (offsetT)0x7FFFFFFF)
+#endif
/* Macros for sign extending from 16- and 32-bits. */
/* XXX: The cast macros will work on all the systems that I care about,
@@ -220,7 +229,7 @@ static void create_literal_section PARAMS ((const char *, segT *, symbolS **));
#ifndef OBJ_ELF
static void select_gp_value PARAMS ((void));
#endif
-static void alpha_align PARAMS ((int, char *, symbolS *));
+static void alpha_align PARAMS ((int, char *, symbolS *, int));
/* Generic assembler global variables which must be defined by all
@@ -255,14 +264,16 @@ char FLT_CHARS[] = "rRsSfFdDxXpP";
#endif
#ifdef OBJ_EVAX
-const char *md_shortopts = "Fm:g+1h:H";
+const char *md_shortopts = "Fm:g+1h:HG:";
#else
-const char *md_shortopts = "Fm:g";
+const char *md_shortopts = "Fm:gG:";
#endif
struct option md_longopts[] = {
#define OPTION_32ADDR (OPTION_MD_BASE)
{ "32addr", no_argument, NULL, OPTION_32ADDR },
+#define OPTION_RELAX (OPTION_32ADDR+1)
+ { "relax", no_argument, NULL, OPTION_RELAX },
{ NULL, no_argument, NULL, 0 }
};
@@ -375,6 +386,12 @@ unsigned long alpha_gprmask, alpha_fprmask;
/* Whether the debugging option was seen. */
static int alpha_debug;
+/* Don't fully resolve relocations, allowing code movement in the linker. */
+static int alpha_flag_relax;
+
+/* What value to give to bfd_set_gp_size. */
+static int g_switch_value = 8;
+
#ifdef OBJ_EVAX
/* Collect information about current procedure here. */
static struct {
@@ -398,9 +415,47 @@ static int alpha_flag_show_after_trunc = 0; /* -H */
* longer than 64 characters, else longer symbol names are truncated.
*/
-static int alpha_basereg_clobbered;
#endif
+/* A table of CPU names and opcode sets. */
+
+static const struct cpu_type
+{
+ const char *name;
+ unsigned flags;
+} cpu_types[] =
+{
+ /* Ad hoc convention: cpu number gets palcode, process code doesn't.
+ This supports usage under DU 4.0b that does ".arch ev4", and
+ usage in MILO that does -m21064. Probably something more
+ specific like -m21064-pal should be used, but oh well. */
+
+ { "21064", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
+ { "21064a", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
+ { "21066", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
+ { "21068", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
+ { "21164", AXP_OPCODE_BASE|AXP_OPCODE_EV5 },
+ /* Do we have CIX extension here? */
+ { "21164a", AXP_OPCODE_BASE|AXP_OPCODE_EV5|AXP_OPCODE_BWX },
+ /* Still same PALcodes? */
+ { "21164pc", (AXP_OPCODE_BASE|AXP_OPCODE_EV5|AXP_OPCODE_BWX
+ |AXP_OPCODE_MAX) },
+ /* All new PALcodes? Extras? */
+ { "21264", (AXP_OPCODE_BASE|AXP_OPCODE_BWX
+ |AXP_OPCODE_CIX|AXP_OPCODE_MAX) },
+
+ { "ev4", AXP_OPCODE_BASE },
+ { "ev45", AXP_OPCODE_BASE },
+ { "lca45", AXP_OPCODE_BASE },
+ { "ev5", AXP_OPCODE_BASE },
+ { "ev56", AXP_OPCODE_BASE|AXP_OPCODE_BWX },
+ { "pca56", AXP_OPCODE_BASE|AXP_OPCODE_BWX|AXP_OPCODE_MAX },
+ { "ev6", AXP_OPCODE_BASE|AXP_OPCODE_BWX|AXP_OPCODE_CIX|AXP_OPCODE_MAX },
+
+ { "all", AXP_OPCODE_BASE },
+ { 0 }
+};
+
/* The macro table */
static const struct alpha_macro alpha_macros[] = {
@@ -639,38 +694,30 @@ static const int alpha_num_macros
void
md_begin ()
{
- unsigned int i = 0;
+ unsigned int i;
/* Create the opcode hash table */
alpha_opcode_hash = hash_new ();
for (i = 0; i < alpha_num_opcodes; )
{
- const char *name, *retval;
+ const char *name, *retval, *slash;
name = alpha_opcodes[i].name;
retval = hash_insert (alpha_opcode_hash, name, (PTR)&alpha_opcodes[i]);
if (retval)
as_fatal ("internal error: can't hash opcode `%s': %s", name, retval);
- while (++i < alpha_num_opcodes
- && (alpha_opcodes[i].name == name
- || !strcmp (alpha_opcodes[i].name, name)))
- continue;
- }
+ /* Some opcodes include modifiers of various sorts with a "/mod"
+ syntax, like the architecture manual suggests. However, for
+ use with gcc at least, we also need access to those same opcodes
+ without the "/". */
- /* Some opcodes include modifiers of various sorts with a "/mod" syntax,
- like the architecture manual suggests. However, for use with gcc at
- least, we also need access to those same opcodes without the "/". */
- for (i = 0; i < alpha_num_opcodes; )
- {
- const char *name, *slash;
- name = alpha_opcodes[i].name;
- if ((slash = strchr(name, '/')) != NULL)
+ if ((slash = strchr (name, '/')) != NULL)
{
char *p = xmalloc (strlen (name));
- memcpy(p, name, slash-name);
- strcpy(p+(slash-name), slash+1);
+ memcpy (p, name, slash - name);
+ strcpy (p + (slash - name), slash + 1);
(void)hash_insert(alpha_opcode_hash, p, (PTR)&alpha_opcodes[i]);
/* Ignore failures -- the opcode table does duplicate some
@@ -721,7 +768,7 @@ md_begin ()
/* Create the special symbols and sections we'll be using */
/* So .sbss will get used for tiny objects. */
- bfd_set_gp_size (stdoutput, 8);
+ bfd_set_gp_size (stdoutput, g_switch_value);
#ifdef OBJ_ECOFF
create_literal_section (".lita", &alpha_lita_section, &alpha_lita_symbol);
@@ -890,43 +937,14 @@ md_parse_option (c, arg)
alpha_debug = 1;
break;
+ case 'G':
+ g_switch_value = atoi(arg);
+ break;
+
case 'm':
{
- static const struct machine
- {
- const char *name;
- unsigned flags;
- } *p, m[] =
- {
- { "21064", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
- { "21064a", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
- { "21066", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
- { "21068", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
- { "21164", AXP_OPCODE_BASE|AXP_OPCODE_EV5 },
- /* Do we have CIX extension here? */
- { "21164a", AXP_OPCODE_BASE|AXP_OPCODE_EV5|AXP_OPCODE_BWX },
- /* Still same PALcodes? */
- { "21164pc", (AXP_OPCODE_BASE|AXP_OPCODE_EV5|AXP_OPCODE_BWX
- |AXP_OPCODE_CIX|AXP_OPCODE_MAX) },
- /* All new PALcodes? Extras? */
- { "21264", (AXP_OPCODE_BASE|AXP_OPCODE_BWX
- |AXP_OPCODE_CIX|AXP_OPCODE_MAX) },
-
- { "ev4", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
- { "ev45", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
- { "lca45", AXP_OPCODE_BASE|AXP_OPCODE_EV4 },
- { "ev5", AXP_OPCODE_BASE|AXP_OPCODE_EV5 },
- { "ev56", AXP_OPCODE_BASE|AXP_OPCODE_EV5|AXP_OPCODE_BWX },
- { "pca56", (AXP_OPCODE_BASE|AXP_OPCODE_EV5|AXP_OPCODE_BWX
- |AXP_OPCODE_CIX|AXP_OPCODE_MAX) },
- { "ev6", (AXP_OPCODE_BASE|AXP_OPCODE_BWX
- |AXP_OPCODE_CIX|AXP_OPCODE_MAX) },
-
- { "all", AXP_OPCODE_BASE },
- { 0 }
- };
-
- for (p = m; p->name; ++p)
+ const struct cpu_type *p;
+ for (p = cpu_types; p->name; ++p)
if (strcmp(arg, p->name) == 0)
{
alpha_target_name = p->name, alpha_target = p->flags;
@@ -950,6 +968,10 @@ md_parse_option (c, arg)
break;
#endif
+ case OPTION_RELAX:
+ alpha_flag_relax = 1;
+ break;
+
default:
return 0;
}
@@ -1052,12 +1074,18 @@ md_apply_fix (fixP, valueP)
break;
case BFD_RELOC_16:
+ if (fixP->fx_pcrel)
+ fixP->fx_r_type = BFD_RELOC_16_PCREL;
size = 2;
goto do_reloc_xx;
case BFD_RELOC_32:
+ if (fixP->fx_pcrel)
+ fixP->fx_r_type = BFD_RELOC_32_PCREL;
size = 4;
goto do_reloc_xx;
case BFD_RELOC_64:
+ if (fixP->fx_pcrel)
+ fixP->fx_r_type = BFD_RELOC_64_PCREL;
size = 8;
do_reloc_xx:
if (fixP->fx_pcrel == 0 && fixP->fx_addsy == 0)
@@ -1257,6 +1285,9 @@ int
alpha_force_relocation (f)
fixS *f;
{
+ if (alpha_flag_relax)
+ return 1;
+
switch (f->fx_r_type)
{
case BFD_RELOC_ALPHA_GPDISP_HI16:
@@ -1864,7 +1895,7 @@ emit_insn (insn)
/* Take care of alignment duties */
if (alpha_auto_align_on && alpha_current_align < 2)
- alpha_align (2, (char *) NULL, alpha_insn_label);
+ alpha_align (2, (char *) NULL, alpha_insn_label, 0);
if (alpha_current_align > 2)
alpha_current_align = 2;
alpha_insn_label = NULL;
@@ -1954,7 +1985,7 @@ assemble_tokens_to_insn(opname, tok, ntok, insn)
as_bad ("inappropriate arguments for opcode `%s'", opname);
else
as_bad ("opcode `%s' not supported for target %s", opname,
- alpha_target_name);
+ alpha_target_name);
}
else
as_bad ("unknown opcode `%s'", opname);
@@ -2012,7 +2043,7 @@ assemble_tokens (opname, tok, ntok, local_macros_on)
as_bad ("inappropriate arguments for opcode `%s'", opname);
else
as_bad ("opcode `%s' not supported for target %s", opname,
- alpha_target_name);
+ alpha_target_name);
else
as_bad ("unknown opcode `%s'", opname);
}
@@ -2241,7 +2272,10 @@ load_expression (targreg, exp, pbasereg, poffset)
else
set_tok_reg (newtok[0], targreg);
- if (!range_signed_32 (addend)
+ /* XXX: Disable this .got minimizing optimization so that we can get
+ better instruction offset knowledge in the compiler. This happens
+ very infrequently anyway. */
+ if (1 || !range_signed_32 (addend)
&& (alpha_noat_on || targreg == AXP_REG_AT))
{
newtok[1] = *exp;
@@ -2262,16 +2296,6 @@ load_expression (targreg, exp, pbasereg, poffset)
#ifdef OBJ_EVAX
offsetT link;
- if (alpha_basereg_clobbered)
- {
- /* no basereg, reload basreg from 0(FP). */
- set_tok_reg (newtok[0], targreg);
- set_tok_const (newtok[1], 0);
- set_tok_preg (newtok[2], AXP_REG_FP);
- basereg = targreg;
- assemble_tokens ("ldq", newtok, 3, 0);
- }
-
/* Find symbol or symbol pointer in link section. */
if (exp->X_add_symbol == alpha_evax_proc.symbol)
@@ -2347,6 +2371,12 @@ load_expression (targreg, exp, pbasereg, poffset)
set_tok_const (*poffset, 0);
return 0;
+ case O_big:
+ as_bad ("%s number invalid; zero assumed",
+ exp->X_add_number > 0 ? "bignum" : "floating point");
+ addend = 0;
+ break;
+
default:
abort();
}
@@ -2589,15 +2619,6 @@ emit_ir_load (tok, ntok, opname)
}
emit_insn (&insn);
-#ifdef OBJ_EVAX
- /* special hack. If the basereg is clobbered for a call
- all lda's before the call don't have a basereg. */
- if ((tok[0].X_op == O_register)
- && (tok[0].X_add_number == alpha_gp_register))
- {
- alpha_basereg_clobbered = 1;
- }
-#endif
}
/* Handle fp register loads, and both integer and fp register stores.
@@ -3236,19 +3257,6 @@ emit_jsrjmp (tok, ntok, vopname)
}
emit_insn (&insn);
-
-#ifdef OBJ_EVAX
- alpha_basereg_clobbered = 0;
-
- /* reload PV from 0(FP) if it is our current base register. */
- if (alpha_gp_register == AXP_REG_PV)
- {
- set_tok_reg (newtok[0], AXP_REG_PV);
- set_tok_const (newtok[1], 0);
- set_tok_preg (newtok[2], AXP_REG_FP);
- assemble_tokens ("ldq", newtok, 3, 0);
- }
-#endif
}
/* The ret and jcr instructions differ from their instruction
@@ -3316,9 +3324,10 @@ s_alpha_data (i)
alpha_current_align = 0;
}
-#ifdef OBJ_ECOFF
+#if defined (OBJ_ECOFF) || defined (OBJ_EVAX)
-/* Handle the OSF/1 .comm pseudo quirks. */
+/* Handle the OSF/1 and openVMS .comm pseudo quirks.
+ openVMS constructs a section for every common symbol. */
static void
s_alpha_comm (ignore)
@@ -3330,6 +3339,12 @@ s_alpha_comm (ignore)
offsetT temp;
register symbolS *symbolP;
+#ifdef OBJ_EVAX
+ segT current_section = now_seg;
+ int current_subsec = now_subseg;
+ segT new_seg;
+#endif
+
name = input_line_pointer;
c = get_symbol_end ();
@@ -3356,6 +3371,11 @@ s_alpha_comm (ignore)
symbolP = symbol_find_or_make (name);
*p = c;
+#ifdef OBJ_EVAX
+ /* Make a section for the common symbol. */
+ new_seg = subseg_new (xstrdup (name), 0);
+#endif
+
if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP))
{
as_bad ("Ignoring attempt to re-define symbol");
@@ -3363,6 +3383,16 @@ s_alpha_comm (ignore)
return;
}
+#ifdef OBJ_EVAX
+ if (bfd_section_size (stdoutput, new_seg) > 0)
+ {
+ if (bfd_section_size (stdoutput, new_seg) != temp)
+ as_bad ("Length of .comm \"%s\" is already %ld. Not changed to %ld.",
+ S_GET_NAME (symbolP),
+ (long) bfd_section_size (stdoutput, new_seg),
+ (long) temp);
+ }
+#else
if (S_GET_VALUE (symbolP))
{
if (S_GET_VALUE (symbolP) != (valueT) temp)
@@ -3371,12 +3401,25 @@ s_alpha_comm (ignore)
(long) S_GET_VALUE (symbolP),
(long) temp);
}
+#endif
else
{
+#ifdef OBJ_EVAX
+ subseg_set (new_seg, 0);
+ p = frag_more (temp);
+ new_seg->flags |= SEC_IS_COMMON;
+ if (! S_IS_DEFINED (symbolP))
+ symbolP->bsym->section = new_seg;
+#else
S_SET_VALUE (symbolP, (valueT) temp);
+#endif
S_SET_EXTERNAL (symbolP);
}
+#ifdef OBJ_EVAX
+ subseg_set (current_section, current_subsec);
+#endif
+
know (symbolP->sy_frag == &zero_address_frag);
demand_empty_rest_of_line ();
@@ -3452,9 +3495,9 @@ s_alpha_section (secid)
int secid;
{
int temp;
-#define EVAX_SECTION_COUNT 6
+#define EVAX_SECTION_COUNT 5
static char *section_name[EVAX_SECTION_COUNT+1] =
- { "NULL", ".rdata", ".comm", ".link", ".ctors", ".dtors", ".lcomm" };
+ { "NULL", ".rdata", ".comm", ".link", ".ctors", ".dtors" };
if ((secid <= 0) || (secid > EVAX_SECTION_COUNT))
{
@@ -3477,7 +3520,6 @@ static void
s_alpha_prologue (ignore)
int ignore;
{
- alpha_basereg_clobbered = 0;
demand_empty_rest_of_line ();
return;
@@ -3873,7 +3915,6 @@ s_alpha_end (ignore)
*input_line_pointer = c;
demand_empty_rest_of_line ();
alpha_evax_proc.symbol = 0;
- alpha_basereg_clobbered = 0;
return;
}
@@ -3946,7 +3987,7 @@ s_alpha_gprel32 (ignore)
#endif
if (alpha_auto_align_on && alpha_current_align < 2)
- alpha_align (2, (char *) NULL, alpha_insn_label);
+ alpha_align (2, (char *) NULL, alpha_insn_label, 0);
if (alpha_current_align > 2)
alpha_current_align = 2;
alpha_insn_label = NULL;
@@ -3990,7 +4031,7 @@ s_alpha_float_cons (type)
}
if (alpha_auto_align_on && alpha_current_align < log_size)
- alpha_align (log_size, (char *) NULL, alpha_insn_label);
+ alpha_align (log_size, (char *) NULL, alpha_insn_label, 0);
if (alpha_current_align > log_size)
alpha_current_align = log_size;
alpha_insn_label = NULL;
@@ -4012,6 +4053,7 @@ s_alpha_proc (is_static)
int temp;
/* Takes ".proc name,nargs" */
+ SKIP_WHITESPACE ();
name = input_line_pointer;
c = get_symbol_end ();
p = input_line_pointer;
@@ -4043,13 +4085,12 @@ static void
s_alpha_set (x)
int x;
{
- char *name = input_line_pointer, ch, *s;
+ char *name, ch, *s;
int yesno = 1;
- while (!is_end_of_line[(unsigned char) *input_line_pointer])
- input_line_pointer++;
- ch = *input_line_pointer;
- *input_line_pointer = '\0';
+ SKIP_WHITESPACE ();
+ name = input_line_pointer;
+ ch = get_symbol_end ();
s = name;
if (s[0] == 'n' && s[1] == 'o')
@@ -4144,7 +4185,7 @@ s_alpha_align (ignore)
if (align != 0)
{
alpha_auto_align_on = 1;
- alpha_align (align, pfill, alpha_insn_label);
+ alpha_align (align, pfill, alpha_insn_label, 1);
}
else
{
@@ -4189,11 +4230,51 @@ alpha_cons_align (size)
++log_size;
if (alpha_auto_align_on && alpha_current_align < log_size)
- alpha_align (log_size, (char *) NULL, alpha_insn_label);
+ alpha_align (log_size, (char *) NULL, alpha_insn_label, 0);
if (alpha_current_align > log_size)
alpha_current_align = log_size;
alpha_insn_label = NULL;
}
+
+/* Here come the .uword, .ulong, and .uquad explicitly unaligned
+ pseudos. We just turn off auto-alignment and call down to cons. */
+
+static void
+s_alpha_ucons (bytes)
+ int bytes;
+{
+ int hold = alpha_auto_align_on;
+ alpha_auto_align_on = 0;
+ cons (bytes);
+ alpha_auto_align_on = hold;
+}
+
+/* Switch the working cpu type. */
+
+static void
+s_alpha_arch (ignored)
+ int ignored;
+{
+ char *name, ch;
+ const struct cpu_type *p;
+
+ SKIP_WHITESPACE ();
+ name = input_line_pointer;
+ ch = get_symbol_end ();
+
+ for (p = cpu_types; p->name; ++p)
+ if (strcmp(name, p->name) == 0)
+ {
+ alpha_target_name = p->name, alpha_target = p->flags;
+ goto found;
+ }
+ as_warn("Unknown CPU identifier `%s'", name);
+
+found:
+ *input_line_pointer = ch;
+ demand_empty_rest_of_line ();
+}
+
#ifdef DEBUG1
@@ -4230,7 +4311,6 @@ alpha_print_token(f, exp)
const pseudo_typeS md_pseudo_table[] =
{
- {"common", s_comm, 0}, /* is this used? */
#ifdef OBJ_ECOFF
{"comm", s_alpha_comm, 0}, /* osf1 compiler does this */
{"rdata", s_alpha_rdata, 0},
@@ -4259,11 +4339,10 @@ const pseudo_typeS md_pseudo_table[] =
{ "end", s_alpha_end, 0},
{ "file", s_alpha_file, 0},
{ "rdata", s_alpha_section, 1},
- { "comm", s_alpha_section, 2},
+ { "comm", s_alpha_comm, 0},
{ "link", s_alpha_section, 3},
{ "ctors", s_alpha_section, 4},
{ "dtors", s_alpha_section, 5},
- { "lcomm", s_alpha_section, 6},
#endif
{"gprel32", s_alpha_gprel32, 0},
{"t_floating", s_alpha_float_cons, 'd'},
@@ -4295,10 +4374,24 @@ const pseudo_typeS md_pseudo_table[] =
{"skip", s_alpha_space, 0},
{"zero", s_alpha_space, 0},
+/* Unaligned data pseudos. */
+ {"uword", s_alpha_ucons, 2},
+ {"ulong", s_alpha_ucons, 4},
+ {"uquad", s_alpha_ucons, 8},
+
+#ifdef OBJ_ELF
+/* Dwarf wants these versions of unaligned. */
+ {"2byte", s_alpha_ucons, 2},
+ {"4byte", s_alpha_ucons, 4},
+ {"8byte", s_alpha_ucons, 8},
+#endif
+
/* We don't do any optimizing, so we can safely ignore these. */
{"noalias", s_ignore, 0},
{"alias", s_ignore, 0},
+ {"arch", s_alpha_arch, 0},
+
{NULL, 0, 0},
};
@@ -4379,10 +4472,11 @@ select_gp_value ()
feature wrt labels. */
static void
-alpha_align (n, pfill, label)
+alpha_align (n, pfill, label, force)
int n;
char *pfill;
symbolS *label;
+ int force;
{
if (alpha_current_align >= n)
return;
@@ -4392,7 +4486,11 @@ alpha_align (n, pfill, label)
if (n > 2
&& (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
{
- static char const nop[4] = { 0x1f, 0x04, 0xff, 0x47 };
+ static char const unop[4] = { 0x00, 0x00, 0xe0, 0x2f };
+ static char const nopunop[8] = {
+ 0x1f, 0x04, 0xff, 0x47,
+ 0x00, 0x00, 0xe0, 0x2f
+ };
/* First, make sure we're on a four-byte boundary, in case
someone has been putting .byte values into the text
@@ -4401,7 +4499,10 @@ alpha_align (n, pfill, label)
with proper alignment. */
if (alpha_current_align < 2)
frag_align (2, 0, 0);
- frag_align_pattern (n, nop, sizeof nop, 0);
+ if (alpha_current_align < 3)
+ frag_align_pattern (3, unop, sizeof unop, 0);
+ if (n > 3)
+ frag_align_pattern (n, nopunop, sizeof nopunop, 0);
}
else
frag_align (n, 0, 0);
@@ -4419,6 +4520,9 @@ alpha_align (n, pfill, label)
}
record_alignment(now_seg, n);
+
+ /* ??? if alpha_flag_relax && force && elf, record the requested alignment
+ in a reloc for the linker to see. */
}
/* The Alpha has support for some VAX floating point types, as well as for
diff --git a/contrib/binutils/gas/config/tc-alpha.h b/contrib/binutils/gas/config/tc-alpha.h
index af2ded6..bdc8ec1 100644
--- a/contrib/binutils/gas/config/tc-alpha.h
+++ b/contrib/binutils/gas/config/tc-alpha.h
@@ -82,3 +82,11 @@ extern void alpha_cons_align PARAMS ((int));
#define tc_frob_file_before_adjust() alpha_frob_file_before_adjust ()
extern void alpha_frob_file_before_adjust PARAMS ((void));
#endif
+
+#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */
+
+#ifdef OBJ_ELF
+#define ELF_TC_SPECIAL_SECTIONS \
+ { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, \
+ { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
+#endif
diff --git a/contrib/binutils/gas/config/tc-arc.c b/contrib/binutils/gas/config/tc-arc.c
new file mode 100644
index 0000000..6fed5c6
--- /dev/null
+++ b/contrib/binutils/gas/config/tc-arc.c
@@ -0,0 +1,1481 @@
+/* tc-arc.c -- Assembler for the ARC
+ Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
+ Contributed by Doug Evans (dje@cygnus.com).
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GAS is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <stdio.h>
+#include <ctype.h>
+#include "as.h"
+#include "subsegs.h"
+#include "opcode/arc.h"
+#include "elf/arc.h"
+
+extern int arc_get_mach PARAMS ((char *));
+
+static arc_insn arc_insert_operand PARAMS ((arc_insn,
+ const struct arc_operand *, int,
+ const struct arc_operand_value *,
+ offsetT, char *, unsigned int));
+static void arc_common PARAMS ((int));
+static void arc_cpu PARAMS ((int));
+/*static void arc_rename PARAMS ((int));*/
+static int get_arc_exp_reloc_type PARAMS ((int, int, expressionS *,
+ expressionS *));
+
+const pseudo_typeS md_pseudo_table[] =
+{
+ { "align", s_align_bytes, 0 }, /* Defaulting is invalid (0) */
+ { "common", arc_common, 0 },
+/*{ "hword", cons, 2 }, - already exists */
+ { "word", cons, 4 },
+/*{ "xword", cons, 8 },*/
+ { "cpu", arc_cpu, 0 },
+/*{ "rename", arc_rename, 0 },*/
+ { NULL, 0, 0 },
+};
+
+/* This array holds the chars that always start a comment. If the
+ pre-processor is disabled, these aren't very useful */
+const char comment_chars[] = "#;";
+
+/* This array holds the chars that only start a comment at the beginning of
+ a line. If the line seems to have the form '# 123 filename'
+ .line and .file directives will appear in the pre-processed output */
+/* Note that input_file.c hand checks for '#' at the beginning of the
+ first line of the input file. This is because the compiler outputs
+ #NO_APP at the beginning of its output. */
+/* Also note that comments started like this one will always
+ work if '/' isn't otherwise defined. */
+const char line_comment_chars[] = "#";
+
+const char line_separator_chars[] = "";
+
+/* Chars that can be used to separate mant from exp in floating point nums */
+const char EXP_CHARS[] = "eE";
+
+/* Chars that mean this number is a floating point constant */
+/* As in 0f12.456 */
+/* or 0d1.2345e12 */
+const char FLT_CHARS[] = "rRsSfFdD";
+
+/* Byte order. */
+extern int target_big_endian;
+const char *arc_target_format = DEFAULT_TARGET_FORMAT;
+static int byte_order = DEFAULT_BYTE_ORDER;
+
+/* One of bfd_mach_arc_xxx. */
+static int arc_mach_type = bfd_mach_arc_base;
+
+/* Non-zero if the cpu type has been explicitly specified. */
+static int mach_type_specified_p = 0;
+
+/* Non-zero if opcode tables have been initialized.
+ A .cpu command must appear before any instructions. */
+static int cpu_tables_init_p = 0;
+
+static struct hash_control *arc_suffix_hash = NULL;
+
+const char *md_shortopts = "";
+struct option md_longopts[] =
+{
+#define OPTION_EB (OPTION_MD_BASE + 0)
+ {"EB", no_argument, NULL, OPTION_EB},
+#define OPTION_EL (OPTION_MD_BASE + 1)
+ {"EL", no_argument, NULL, OPTION_EL},
+ { NULL, no_argument, NULL, 0 }
+};
+size_t md_longopts_size = sizeof (md_longopts);
+
+/*
+ * md_parse_option
+ *
+ * Invocation line includes a switch not recognized by the base assembler.
+ * See if it's a processor-specific option.
+ */
+
+int
+md_parse_option (c, arg)
+ int c;
+ char *arg;
+{
+ switch (c)
+ {
+ case OPTION_EB:
+ byte_order = BIG_ENDIAN;
+ arc_target_format = "elf32-bigarc";
+ break;
+ case OPTION_EL:
+ byte_order = LITTLE_ENDIAN;
+ arc_target_format = "elf32-littlearc";
+ break;
+ default:
+ return 0;
+ }
+ return 1;
+}
+
+void
+md_show_usage (stream)
+ FILE *stream;
+{
+ fprintf (stream, "\
+ARC options:\n\
+-EB generate big endian output\n\
+-EL generate little endian output\n");
+}
+
+/* This function is called once, at assembler startup time. It should
+ set up all the tables, etc. that the MD part of the assembler will need.
+ Opcode selection is defered until later because we might see a .cpu
+ command. */
+
+void
+md_begin ()
+{
+ /* The endianness can be chosen "at the factory". */
+ target_big_endian = byte_order == BIG_ENDIAN;
+
+ if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, arc_mach_type))
+ as_warn ("could not set architecture and machine");
+
+ /* Assume the base cpu. This call is necessary because we need to
+ initialize `arc_operand_map' which may be needed before we see the
+ first insn. */
+ arc_opcode_init_tables (arc_get_opcode_mach (bfd_mach_arc_base,
+ target_big_endian));
+}
+
+/* Initialize the various opcode and operand tables.
+ MACH is one of bfd_mach_arc_xxx. */
+
+static void
+init_opcode_tables (mach)
+ int mach;
+{
+ register unsigned int i;
+ char *last;
+
+ if ((arc_suffix_hash = hash_new ()) == NULL)
+ as_fatal ("virtual memory exhausted");
+
+ if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, mach))
+ as_warn ("could not set architecture and machine");
+
+ /* This initializes a few things in arc-opc.c that we need.
+ This must be called before the various arc_xxx_supported fns. */
+ arc_opcode_init_tables (arc_get_opcode_mach (mach, target_big_endian));
+
+ /* Only put the first entry of each equivalently named suffix in the
+ table. */
+ last = "";
+ for (i = 0; i < arc_suffixes_count; i++)
+ {
+ if (! arc_opval_supported (&arc_suffixes[i]))
+ continue;
+ if (strcmp (arc_suffixes[i].name, last) != 0)
+ hash_insert (arc_suffix_hash, arc_suffixes[i].name, (PTR) (arc_suffixes + i));
+ last = arc_suffixes[i].name;
+ }
+
+ /* Since registers don't have a prefix, we put them in the symbol table so
+ they can't be used as symbols. This also simplifies argument parsing as
+ we can let gas parse registers for us. The recorded register number is
+ the index in `arc_reg_names'. */
+ for (i = 0; i < arc_reg_names_count; i++)
+ {
+ if (! arc_opval_supported (&arc_reg_names[i]))
+ continue;
+ /* Use symbol_create here instead of symbol_new so we don't try to
+ output registers into the object file's symbol table. */
+ symbol_table_insert (symbol_create (arc_reg_names[i].name, reg_section,
+ i, &zero_address_frag));
+ }
+
+ /* Tell `s_cpu' it's too late. */
+ cpu_tables_init_p = 1;
+}
+
+/* Insert an operand value into an instruction.
+ If REG is non-NULL, it is a register number and ignore VAL. */
+
+static arc_insn
+arc_insert_operand (insn, operand, mods, reg, val, file, line)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ offsetT val;
+ char *file;
+ unsigned int line;
+{
+ if (operand->bits != 32)
+ {
+ long min, max;
+ offsetT test;
+
+ if ((operand->flags & ARC_OPERAND_SIGNED) != 0)
+ {
+ if ((operand->flags & ARC_OPERAND_SIGNOPT) != 0)
+ max = (1 << operand->bits) - 1;
+ else
+ max = (1 << (operand->bits - 1)) - 1;
+ min = - (1 << (operand->bits - 1));
+ }
+ else
+ {
+ max = (1 << operand->bits) - 1;
+ min = 0;
+ }
+
+ if ((operand->flags & ARC_OPERAND_NEGATIVE) != 0)
+ test = - val;
+ else
+ test = val;
+
+ if (test < (offsetT) min || test > (offsetT) max)
+ {
+ const char *err =
+ "operand out of range (%s not between %ld and %ld)";
+ char buf[100];
+
+ sprint_value (buf, test);
+ if (file == (char *) NULL)
+ as_warn (err, buf, min, max);
+ else
+ as_warn_where (file, line, err, buf, min, max);
+ }
+ }
+
+ if (operand->insert)
+ {
+ const char *errmsg;
+
+ errmsg = NULL;
+ insn = (*operand->insert) (insn, operand, mods, reg, (long) val, &errmsg);
+ if (errmsg != (const char *) NULL)
+ as_warn (errmsg);
+ }
+ else
+ insn |= (((long) val & ((1 << operand->bits) - 1))
+ << operand->shift);
+
+ return insn;
+}
+
+/* We need to keep a list of fixups. We can't simply generate them as
+ we go, because that would require us to first create the frag, and
+ that would screw up references to ``.''. */
+
+struct arc_fixup
+{
+ /* index into `arc_operands' */
+ int opindex;
+ expressionS exp;
+};
+
+#define MAX_FIXUPS 5
+
+#define MAX_SUFFIXES 5
+
+/* This routine is called for each instruction to be assembled. */
+
+void
+md_assemble (str)
+ char *str;
+{
+ const struct arc_opcode *opcode;
+ char *start;
+ arc_insn insn;
+ static int init_tables_p = 0;
+
+ /* Opcode table initialization is deferred until here because we have to
+ wait for a possible .cpu command. */
+ if (!init_tables_p)
+ {
+ init_opcode_tables (arc_mach_type);
+ init_tables_p = 1;
+ }
+
+ /* Skip leading white space. */
+ while (isspace (*str))
+ str++;
+
+ /* The instructions are stored in lists hashed by the first letter (though
+ we needn't care how they're hashed). Get the first in the list. */
+
+ opcode = arc_opcode_lookup_asm (str);
+
+ /* Keep looking until we find a match. */
+
+ start = str;
+ for ( ; opcode != NULL; opcode = ARC_OPCODE_NEXT_ASM (opcode))
+ {
+ int past_opcode_p, fc, num_suffixes;
+ char *syn;
+ struct arc_fixup fixups[MAX_FIXUPS];
+ /* Used as a sanity check. If we need a limm reloc, make sure we ask
+ for an extra 4 bytes from frag_more. */
+ int limm_reloc_p;
+ const struct arc_operand_value *insn_suffixes[MAX_SUFFIXES];
+
+ /* Is this opcode supported by the selected cpu? */
+ if (! arc_opcode_supported (opcode))
+ continue;
+
+ /* Scan the syntax string. If it doesn't match, try the next one. */
+
+ arc_opcode_init_insert ();
+ insn = opcode->value;
+ fc = 0;
+ past_opcode_p = 0;
+ num_suffixes = 0;
+ limm_reloc_p = 0;
+
+ /* We don't check for (*str != '\0') here because we want to parse
+ any trailing fake arguments in the syntax string. */
+ for (str = start, syn = opcode->syntax; *syn != '\0'; )
+ {
+ int mods;
+ const struct arc_operand *operand;
+
+ /* Non operand chars must match exactly. */
+ if (*syn != '%' || *++syn == '%')
+ {
+ /* Handle '+' specially as we want to allow "ld r0,[sp-4]". */
+ /* ??? The syntax has changed to [sp,-4]. */
+ if (0 && *syn == '+' && *str == '-')
+ {
+ /* Skip over syn's +, but leave str's - alone.
+ That makes the case identical to "ld r0,[sp+-4]". */
+ ++syn;
+ }
+ else if (*str == *syn)
+ {
+ if (*syn == ' ')
+ past_opcode_p = 1;
+ ++syn;
+ ++str;
+ }
+ else
+ break;
+ continue;
+ }
+
+ /* We have an operand. Pick out any modifiers. */
+ mods = 0;
+ while (ARC_MOD_P (arc_operands[arc_operand_map[*syn]].flags))
+ {
+ mods |= arc_operands[arc_operand_map[*syn]].flags & ARC_MOD_BITS;
+ ++syn;
+ }
+ operand = arc_operands + arc_operand_map[*syn];
+ if (operand->fmt == 0)
+ as_fatal ("unknown syntax format character `%c'", *syn);
+
+ if (operand->flags & ARC_OPERAND_FAKE)
+ {
+ const char *errmsg = NULL;
+ if (operand->insert)
+ {
+ insn = (*operand->insert) (insn, operand, mods, NULL, 0, &errmsg);
+ /* If we get an error, go on to try the next insn. */
+ if (errmsg)
+ break;
+ }
+ ++syn;
+ }
+ /* Are we finished with suffixes? */
+ else if (!past_opcode_p)
+ {
+ int found;
+ char c;
+ char *s,*t;
+ const struct arc_operand_value *suf,*suffix,*suffix_end;
+
+ if (!(operand->flags & ARC_OPERAND_SUFFIX))
+ abort ();
+
+ /* If we're at a space in the input string, we want to skip the
+ remaining suffixes. There may be some fake ones though, so
+ just go on to try the next one. */
+ if (*str == ' ')
+ {
+ ++syn;
+ continue;
+ }
+
+ s = str;
+ if (mods & ARC_MOD_DOT)
+ {
+ if (*s != '.')
+ break;
+ ++s;
+ }
+ else
+ {
+ /* This can happen in "b.nd foo" and we're currently looking
+ for "%q" (ie: a condition code suffix). */
+ if (*s == '.')
+ {
+ ++syn;
+ continue;
+ }
+ }
+
+ /* Pick the suffix out and look it up via the hash table. */
+ for (t = s; *t && isalpha (*t); ++t)
+ continue;
+ c = *t;
+ *t = '\0';
+ suf = hash_find (arc_suffix_hash, s);
+ *t = c;
+ if (!suf)
+ {
+ /* This can happen in "blle foo" and we're currently using
+ the template "b%q%.n %j". The "bl" insn occurs later in
+ the table so "lle" isn't an illegal suffix. */
+ break;
+ }
+
+ /* Is it the right type? Note that the same character is used
+ several times, so we have to examine all of them. This is
+ relatively efficient as equivalent entries are kept
+ together. If it's not the right type, don't increment `str'
+ so we try the next one in the series. */
+ found = 0;
+ suffix_end = arc_suffixes + arc_suffixes_count;
+ for (suffix = suf;
+ suffix < suffix_end && strcmp (suffix->name, suf->name) == 0;
+ ++suffix)
+ {
+ if (arc_operands[suffix->type].fmt == *syn)
+ {
+ /* Insert the suffix's value into the insn. */
+ if (operand->insert)
+ insn = (*operand->insert) (insn, operand,
+ mods, NULL, suffix->value,
+ NULL);
+ else
+ insn |= suffix->value << operand->shift;
+
+ str = t;
+ found = 1;
+ break;
+ }
+ }
+ ++syn;
+ if (!found)
+ ; /* Wrong type. Just go on to try next insn entry. */
+ else
+ {
+ if (num_suffixes == MAX_SUFFIXES)
+ as_bad ("too many suffixes");
+ else
+ insn_suffixes[num_suffixes++] = suffix;
+ }
+ }
+ else
+ /* This is either a register or an expression of some kind. */
+ {
+ char c;
+ char *hold;
+ const struct arc_operand_value *reg = NULL;
+ long value = 0;
+ expressionS exp;
+
+ if (operand->flags & ARC_OPERAND_SUFFIX)
+ abort ();
+
+ /* Is there anything left to parse?
+ We don't check for this at the top because we want to parse
+ any trailing fake arguments in the syntax string. */
+ if (*str == '\0')
+ break;
+#if 0
+ /* Is this a syntax character? Eg: is there a '[' present when
+ there shouldn't be? */
+ if (!isalnum (*str)
+ /* '.' as in ".LLC0" */
+ && *str != '.'
+ /* '_' as in "_print" */
+ && *str != '_'
+ /* '-' as in "[fp,-4]" */
+ && *str != '-'
+ /* '%' as in "%ia(_func)" */
+ && *str != '%')
+ break;
+#endif
+
+ /* Parse the operand. */
+ hold = input_line_pointer;
+ input_line_pointer = str;
+ expression (&exp);
+ str = input_line_pointer;
+ input_line_pointer = hold;
+
+ if (exp.X_op == O_illegal)
+ as_bad ("illegal operand");
+ else if (exp.X_op == O_absent)
+ as_bad ("missing operand");
+ else if (exp.X_op == O_constant)
+ {
+ value = exp.X_add_number;
+ }
+ else if (exp.X_op == O_register)
+ {
+ reg = arc_reg_names + exp.X_add_number;
+ }
+ else
+ {
+ /* We need to generate a fixup for this expression. */
+ if (fc >= MAX_FIXUPS)
+ as_fatal ("too many fixups");
+ fixups[fc].exp = exp;
+
+ /* If this is a register constant (IE: one whose
+ register value gets stored as 61-63) then this
+ must be a limm. We don't support shimm relocs. */
+ /* ??? This bit could use some cleaning up.
+ Referencing the format chars like this goes
+ against style. */
+#define IS_REG_OPERAND(o) ((o) == 'a' || (o) == 'b' || (o) == 'c')
+ if (IS_REG_OPERAND (*syn))
+ {
+ const char *junk;
+
+ fixups[fc].opindex = arc_operand_map['L'];
+ limm_reloc_p = 1;
+ /* Tell insert_reg we need a limm. This is
+ needed because the value at this point is
+ zero, a shimm. */
+ /* ??? We need a cleaner interface than this. */
+ (*arc_operands[arc_operand_map['Q']].insert)
+ (insn, operand, mods, reg, 0L, &junk);
+ }
+ else
+ fixups[fc].opindex = arc_operand_map[*syn];
+ ++fc;
+ value = 0;
+ }
+
+ /* Insert the register or expression into the instruction. */
+ if (operand->insert)
+ {
+ const char *errmsg = NULL;
+ insn = (*operand->insert) (insn, operand, mods,
+ reg, (long) value, &errmsg);
+#if 0
+ if (errmsg != (const char *) NULL)
+ as_warn (errmsg);
+#endif
+ /* FIXME: We want to try shimm insns for limm ones. But if
+ the constant won't fit, we must go on to try the next
+ possibility. Where do we issue warnings for constants
+ that are too big then? At present, we'll flag the insn
+ as unrecognizable! Maybe have the "bad instruction"
+ error message include our `errmsg'? */
+ if (errmsg != (const char *) NULL)
+ break;
+ }
+ else
+ insn |= (value & ((1 << operand->bits) - 1)) << operand->shift;
+
+ ++syn;
+ }
+ }
+
+ /* If we're at the end of the syntax string, we're done. */
+ /* FIXME: try to move this to a separate function. */
+ if (*syn == '\0')
+ {
+ int i;
+ char *f;
+ long limm, limm_p;
+
+ /* For the moment we assume a valid `str' can only contain blanks
+ now. IE: We needn't try again with a longer version of the
+ insn and it is assumed that longer versions of insns appear
+ before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */
+
+ while (isspace (*str))
+ ++str;
+
+ if (*str != '\0')
+ as_bad ("junk at end of line: `%s'", str);
+
+ /* Is there a limm value? */
+ limm_p = arc_opcode_limm_p (&limm);
+
+ /* Perform various error and warning tests. */
+
+ {
+ static int in_delay_slot_p = 0;
+ static int prev_insn_needs_cc_nop_p = 0;
+ /* delay slot type seen */
+ int delay_slot_type = ARC_DELAY_NONE;
+ /* conditional execution flag seen */
+ int conditional = 0;
+ /* 1 if condition codes are being set */
+ int cc_set_p = 0;
+ /* 1 if conditional branch, including `b' "branch always" */
+ int cond_branch_p = opcode->flags & ARC_OPCODE_COND_BRANCH;
+ int need_cc_nop_p = 0;
+
+ for (i = 0; i < num_suffixes; ++i)
+ {
+ switch (arc_operands[insn_suffixes[i]->type].fmt)
+ {
+ case 'n' :
+ delay_slot_type = insn_suffixes[i]->value;
+ break;
+ case 'q' :
+ conditional = insn_suffixes[i]->value;
+ break;
+ case 'f' :
+ cc_set_p = 1;
+ break;
+ }
+ }
+
+ /* Putting an insn with a limm value in a delay slot is supposed to
+ be legal, but let's warn the user anyway. Ditto for 8 byte
+ jumps with delay slots. */
+ if (in_delay_slot_p && limm_p)
+ as_warn ("8 byte instruction in delay slot");
+ if (delay_slot_type != ARC_DELAY_NONE && limm_p)
+ as_warn ("8 byte jump instruction with delay slot");
+ in_delay_slot_p = (delay_slot_type != ARC_DELAY_NONE) && !limm_p;
+
+ /* Warn when a conditional branch immediately follows a set of
+ the condition codes. Note that this needn't be done if the
+ insn that sets the condition codes uses a limm. */
+ if (cond_branch_p && conditional != 0 /* 0 = "always" */
+ && prev_insn_needs_cc_nop_p)
+ as_warn ("conditional branch follows set of flags");
+ prev_insn_needs_cc_nop_p = cc_set_p && !limm_p;
+ }
+
+ /* Write out the instruction.
+ It is important to fetch enough space in one call to `frag_more'.
+ We use (f - frag_now->fr_literal) to compute where we are and we
+ don't want frag_now to change between calls. */
+ if (limm_p)
+ {
+ f = frag_more (8);
+ md_number_to_chars (f, insn, 4);
+ md_number_to_chars (f + 4, limm, 4);
+ }
+ else if (limm_reloc_p)
+ {
+ /* We need a limm reloc, but the tables think we don't. */
+ abort ();
+ }
+ else
+ {
+ f = frag_more (4);
+ md_number_to_chars (f, insn, 4);
+ }
+
+ /* Create any fixups. */
+ for (i = 0; i < fc; ++i)
+ {
+ int op_type, reloc_type;
+ expressionS exptmp;
+ const struct arc_operand *operand;
+
+ /* Create a fixup for this operand.
+ At this point we do not use a bfd_reloc_code_real_type for
+ operands residing in the insn, but instead just use the
+ operand index. This lets us easily handle fixups for any
+ operand type, although that is admittedly not a very exciting
+ feature. We pick a BFD reloc type in md_apply_fix.
+
+ Limm values (4 byte immediate "constants") must be treated
+ normally because they're not part of the actual insn word
+ and thus the insertion routines don't handle them. */
+
+ if (arc_operands[fixups[i].opindex].flags & ARC_OPERAND_LIMM)
+ {
+ op_type = fixups[i].opindex;
+ /* FIXME: can we add this data to the operand table? */
+ if (op_type == arc_operand_map['L'])
+ reloc_type = BFD_RELOC_32;
+ else if (op_type == arc_operand_map['J'])
+ reloc_type = BFD_RELOC_ARC_B26;
+ else
+ abort ();
+ reloc_type = get_arc_exp_reloc_type (1, reloc_type,
+ &fixups[i].exp,
+ &exptmp);
+ }
+ else
+ {
+ op_type = get_arc_exp_reloc_type (0, fixups[i].opindex,
+ &fixups[i].exp, &exptmp);
+ reloc_type = op_type + (int) BFD_RELOC_UNUSED;
+ }
+ operand = &arc_operands[op_type];
+ fix_new_exp (frag_now,
+ ((f - frag_now->fr_literal)
+ + (operand->flags & ARC_OPERAND_LIMM ? 4 : 0)), 4,
+ &exptmp,
+ (operand->flags & ARC_OPERAND_RELATIVE_BRANCH) != 0,
+ (bfd_reloc_code_real_type) reloc_type);
+ }
+
+ /* All done. */
+ return;
+ }
+
+ /* Try the next entry. */
+ }
+
+ as_bad ("bad instruction `%s'", start);
+}
+
+/* ??? This was copied from tc-sparc.c, I think. Is it necessary? */
+
+static void
+arc_common (ignore)
+ int ignore;
+{
+ char *name;
+ char c;
+ char *p;
+ int temp, size;
+ symbolS *symbolP;
+
+ name = input_line_pointer;
+ c = get_symbol_end ();
+ /* just after name is now '\0' */
+ p = input_line_pointer;
+ *p = c;
+ SKIP_WHITESPACE ();
+ if (*input_line_pointer != ',')
+ {
+ as_bad ("expected comma after symbol-name");
+ ignore_rest_of_line ();
+ return;
+ }
+ input_line_pointer++; /* skip ',' */
+ if ((temp = get_absolute_expression ()) < 0)
+ {
+ as_bad (".COMMon length (%d.) <0! Ignored.", temp);
+ ignore_rest_of_line ();
+ return;
+ }
+ size = temp;
+ *p = 0;
+ symbolP = symbol_find_or_make (name);
+ *p = c;
+ if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP))
+ {
+ as_bad ("ignoring attempt to re-define symbol");
+ ignore_rest_of_line ();
+ return;
+ }
+ if (S_GET_VALUE (symbolP) != 0)
+ {
+ if (S_GET_VALUE (symbolP) != size)
+ {
+ as_warn ("Length of .comm \"%s\" is already %ld. Not changed to %d.",
+ S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
+ }
+ }
+ assert (symbolP->sy_frag == &zero_address_frag);
+ if (*input_line_pointer != ',')
+ {
+ as_bad ("expected comma after common length");
+ ignore_rest_of_line ();
+ return;
+ }
+ input_line_pointer++;
+ SKIP_WHITESPACE ();
+ if (*input_line_pointer != '"')
+ {
+ temp = get_absolute_expression ();
+ if (temp < 0)
+ {
+ temp = 0;
+ as_warn ("Common alignment negative; 0 assumed");
+ }
+ if (symbolP->local)
+ {
+ segT old_sec;
+ int old_subsec;
+ char *p;
+ int align;
+
+ allocate_bss:
+ old_sec = now_seg;
+ old_subsec = now_subseg;
+ align = temp;
+ record_alignment (bss_section, align);
+ subseg_set (bss_section, 0);
+ if (align)
+ frag_align (align, 0, 0);
+ if (S_GET_SEGMENT (symbolP) == bss_section)
+ symbolP->sy_frag->fr_symbol = 0;
+ symbolP->sy_frag = frag_now;
+ p = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP,
+ (offsetT) size, (char *) 0);
+ *p = 0;
+ S_SET_SEGMENT (symbolP, bss_section);
+ S_CLEAR_EXTERNAL (symbolP);
+ subseg_set (old_sec, old_subsec);
+ }
+ else
+ {
+ allocate_common:
+ S_SET_VALUE (symbolP, (valueT) size);
+ S_SET_ALIGN (symbolP, temp);
+ S_SET_EXTERNAL (symbolP);
+ S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
+ }
+ }
+ else
+ {
+ input_line_pointer++;
+ /* ??? Some say data, some say bss. */
+ if (strncmp (input_line_pointer, ".bss\"", 5)
+ && strncmp (input_line_pointer, ".data\"", 6))
+ {
+ input_line_pointer--;
+ goto bad_common_segment;
+ }
+ while (*input_line_pointer++ != '"')
+ ;
+ goto allocate_common;
+ }
+ demand_empty_rest_of_line ();
+ return;
+
+ {
+ bad_common_segment:
+ p = input_line_pointer;
+ while (*p && *p != '\n')
+ p++;
+ c = *p;
+ *p = '\0';
+ as_bad ("bad .common segment %s", input_line_pointer + 1);
+ *p = c;
+ input_line_pointer = p;
+ ignore_rest_of_line ();
+ return;
+ }
+}
+
+/* Select the cpu we're assembling for. */
+
+static void
+arc_cpu (ignore)
+ int ignore;
+{
+ int mach;
+ char c;
+ char *cpu;
+
+ /* If an instruction has already been seen, it's too late. */
+ if (cpu_tables_init_p)
+ {
+ as_bad (".cpu command must appear before any instructions");
+ ignore_rest_of_line ();
+ return;
+ }
+
+ cpu = input_line_pointer;
+ c = get_symbol_end ();
+ mach = arc_get_mach (cpu);
+ *input_line_pointer = c;
+ if (mach == -1)
+ goto bad_cpu;
+
+ demand_empty_rest_of_line ();
+
+ /* The cpu may have been selected on the command line.
+ The choices must match. */
+ /* ??? This was a command line option early on. It's gone now, but
+ leave this in. */
+ if (mach_type_specified_p && mach != arc_mach_type)
+ as_bad (".cpu conflicts with previous value");
+ else
+ {
+ arc_mach_type = mach;
+ mach_type_specified_p = 1;
+ if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, mach))
+ as_warn ("could not set architecture and machine");
+ }
+ return;
+
+ bad_cpu:
+ as_bad ("bad .cpu op");
+ ignore_rest_of_line ();
+}
+
+#if 0
+/* The .rename pseudo-op. This is used by gcc to implement
+ -mmangle-cpu-libgcc. */
+
+static void
+arc_rename (ignore)
+ int ignore;
+{
+ char *name,*new;
+ char c;
+ symbolS *sym;
+ int len;
+
+ name = input_line_pointer;
+ c = get_symbol_end ();
+ sym = symbol_find_or_make (name);
+ *input_line_pointer = c;
+
+ if (*input_line_pointer != ',')
+ {
+ as_bad ("missing rename string");
+ ignore_rest_of_line ();
+ return;
+ }
+ ++input_line_pointer;
+ SKIP_WHITESPACE ();
+
+ name = input_line_pointer;
+ c = get_symbol_end ();
+ if (*name == '\0')
+ {
+ *input_line_pointer = c;
+ as_bad ("invalid symbol to rename to");
+ ignore_rest_of_line ();
+ return;
+ }
+ new = (char *) xmalloc (strlen (name) + 1);
+ strcpy (new, name);
+ *input_line_pointer = c;
+ sym->sy_tc.real_name = new;
+
+ demand_empty_rest_of_line ();
+}
+#endif
+
+/* Turn a string in input_line_pointer into a floating point constant of type
+ type, and store the appropriate bytes in *litP. The number of LITTLENUMS
+ emitted is stored in *sizeP.
+ An error message is returned, or NULL on OK. */
+
+/* Equal to MAX_PRECISION in atof-ieee.c */
+#define MAX_LITTLENUMS 6
+
+char *
+md_atof (type, litP, sizeP)
+ char type;
+ char *litP;
+ int *sizeP;
+{
+ int prec;
+ LITTLENUM_TYPE words[MAX_LITTLENUMS];
+ LITTLENUM_TYPE *wordP;
+ char *t;
+ char *atof_ieee ();
+
+ switch (type)
+ {
+ case 'f':
+ case 'F':
+ prec = 2;
+ break;
+
+ case 'd':
+ case 'D':
+ prec = 4;
+ break;
+
+ default:
+ *sizeP = 0;
+ return "bad call to md_atof";
+ }
+
+ t = atof_ieee (input_line_pointer, type, words);
+ if (t)
+ input_line_pointer = t;
+ *sizeP = prec * sizeof (LITTLENUM_TYPE);
+ for (wordP = words; prec--;)
+ {
+ md_number_to_chars (litP, (valueT) (*wordP++), sizeof (LITTLENUM_TYPE));
+ litP += sizeof (LITTLENUM_TYPE);
+ }
+
+ return NULL;
+}
+
+/* Write a value out to the object file, using the appropriate
+ endianness. */
+
+void
+md_number_to_chars (buf, val, n)
+ char *buf;
+ valueT val;
+ int n;
+{
+ if (target_big_endian)
+ number_to_chars_bigendian (buf, val, n);
+ else
+ number_to_chars_littleendian (buf, val, n);
+}
+
+/* Round up a section size to the appropriate boundary. */
+
+valueT
+md_section_align (segment, size)
+ segT segment;
+ valueT size;
+{
+ int align = bfd_get_section_alignment (stdoutput, segment);
+
+ return ((size + (1 << align) - 1) & (-1 << align));
+}
+
+/* We don't have any form of relaxing. */
+
+int
+md_estimate_size_before_relax (fragp, seg)
+ fragS *fragp;
+ asection *seg;
+{
+ abort ();
+}
+
+/* Convert a machine dependent frag. We never generate these. */
+
+void
+md_convert_frag (abfd, sec, fragp)
+ bfd *abfd;
+ asection *sec;
+ fragS *fragp;
+{
+ abort ();
+}
+
+/* Parse an operand that is machine-specific.
+
+ The ARC has a special %-op to adjust addresses so they're usable in
+ branches. The "st" is short for the STatus register.
+ ??? Later expand this to take a flags value too.
+
+ ??? We can't create new expression types so we map the %-op's onto the
+ existing syntax. This means that the user could use the chosen syntax
+ to achieve the same effect. Perhaps put a special cookie in X_add_number
+ to mark the expression as special. */
+
+void
+md_operand (expressionP)
+ expressionS *expressionP;
+{
+ char *p = input_line_pointer;
+
+ if (*p == '%' && strncmp (p, "%st(", 4) == 0)
+ {
+ input_line_pointer += 4;
+ expression (expressionP);
+ if (*input_line_pointer != ')')
+ {
+ as_bad ("missing ')' in %-op");
+ return;
+ }
+ ++input_line_pointer;
+ if (expressionP->X_op == O_symbol
+ && expressionP->X_add_number == 0
+ /* I think this test is unnecessary but just as a sanity check... */
+ && expressionP->X_op_symbol == NULL)
+ {
+ expressionS two;
+
+ expressionP->X_op = O_right_shift;
+ two.X_op = O_constant;
+ two.X_add_symbol = two.X_op_symbol = NULL;
+ two.X_add_number = 2;
+ expressionP->X_op_symbol = make_expr_symbol (&two);
+ }
+ /* allow %st(sym1-sym2) */
+ else if (expressionP->X_op == O_subtract
+ && expressionP->X_add_symbol != NULL
+ && expressionP->X_op_symbol != NULL
+ && expressionP->X_add_number == 0)
+ {
+ expressionS two;
+
+ expressionP->X_add_symbol = make_expr_symbol (expressionP);
+ expressionP->X_op = O_right_shift;
+ two.X_op = O_constant;
+ two.X_add_symbol = two.X_op_symbol = NULL;
+ two.X_add_number = 2;
+ expressionP->X_op_symbol = make_expr_symbol (&two);
+ }
+ else
+ {
+ as_bad ("expression too complex for %%st");
+ return;
+ }
+ }
+}
+
+/* We have no need to default values of symbols.
+ We could catch register names here, but that is handled by inserting
+ them all in the symbol table to begin with. */
+
+symbolS *
+md_undefined_symbol (name)
+ char *name;
+{
+ return 0;
+}
+
+/* Functions concerning expressions. */
+
+/* Parse a .byte, .word, etc. expression.
+
+ Values for the status register are specified with %st(label).
+ `label' will be right shifted by 2. */
+
+void
+arc_parse_cons_expression (exp, nbytes)
+ expressionS *exp;
+ int nbytes;
+{
+ expr (0, exp);
+}
+
+/* Record a fixup for a cons expression. */
+
+void
+arc_cons_fix_new (frag, where, nbytes, exp)
+ fragS *frag;
+ int where;
+ int nbytes;
+ expressionS *exp;
+{
+ if (nbytes == 4)
+ {
+ int reloc_type;
+ expressionS exptmp;
+
+ /* This may be a special ARC reloc (eg: %st()). */
+ reloc_type = get_arc_exp_reloc_type (1, BFD_RELOC_32, exp, &exptmp);
+ fix_new_exp (frag, where, nbytes, &exptmp, 0, reloc_type);
+ }
+ else
+ {
+ fix_new_exp (frag, where, nbytes, exp, 0,
+ nbytes == 2 ? BFD_RELOC_16
+ : nbytes == 8 ? BFD_RELOC_64
+ : BFD_RELOC_32);
+ }
+}
+
+/* Functions concerning relocs. */
+
+/* The location from which a PC relative jump should be calculated,
+ given a PC relative reloc. */
+
+long
+md_pcrel_from (fixP)
+ fixS *fixP;
+{
+ if (fixP->fx_addsy != (symbolS *) NULL
+ && ! S_IS_DEFINED (fixP->fx_addsy))
+ {
+ /* The symbol is undefined. Let the linker figure it out. */
+ return 0;
+ }
+
+ /* Return the address of the delay slot. */
+ return fixP->fx_frag->fr_address + fixP->fx_where + fixP->fx_size;
+}
+
+/* Compute the reloc type of an expression.
+ The possibly modified expression is stored in EXPNEW.
+
+ This is used to convert the expressions generated by the %-op's into
+ the appropriate operand type. It is called for both data in instructions
+ (operands) and data outside instructions (variables, debugging info, etc.).
+
+ Currently supported %-ops:
+
+ %st(symbol): represented as "symbol >> 2"
+ "st" is short for STatus as in the status register (pc)
+
+ DEFAULT_TYPE is the type to use if no special processing is required.
+
+ DATA_P is non-zero for data or limm values, zero for insn operands.
+ Remember that the opcode "insertion fns" cannot be used on data, they're
+ only for inserting operands into insns. They also can't be used for limm
+ values as the insertion routines don't handle limm values. When called for
+ insns we return fudged reloc types (real_value - BFD_RELOC_UNUSED). When
+ called for data or limm values we use real reloc types. */
+
+static int
+get_arc_exp_reloc_type (data_p, default_type, exp, expnew)
+ int data_p;
+ int default_type;
+ expressionS *exp;
+ expressionS *expnew;
+{
+ /* If the expression is "symbol >> 2" we must change it to just "symbol",
+ as fix_new_exp can't handle it. Similarily for (symbol - symbol) >> 2.
+ That's ok though. What's really going on here is that we're using
+ ">> 2" as a special syntax for specifying BFD_RELOC_ARC_B26. */
+
+ if (exp->X_op == O_right_shift
+ && exp->X_op_symbol != NULL
+ && exp->X_op_symbol->sy_value.X_op == O_constant
+ && exp->X_op_symbol->sy_value.X_add_number == 2
+ && exp->X_add_number == 0)
+ {
+ if (exp->X_add_symbol != NULL
+ && (exp->X_add_symbol->sy_value.X_op == O_constant
+ || exp->X_add_symbol->sy_value.X_op == O_symbol))
+ {
+ *expnew = *exp;
+ expnew->X_op = O_symbol;
+ expnew->X_op_symbol = NULL;
+ return data_p ? BFD_RELOC_ARC_B26 : arc_operand_map['J'];
+ }
+ else if (exp->X_add_symbol != NULL
+ && exp->X_add_symbol->sy_value.X_op == O_subtract)
+ {
+ *expnew = exp->X_add_symbol->sy_value;
+ return data_p ? BFD_RELOC_ARC_B26 : arc_operand_map['J'];
+ }
+ }
+
+ *expnew = *exp;
+ return default_type;
+}
+
+/* Apply a fixup to the object code. This is called for all the
+ fixups we generated by the call to fix_new_exp, above. In the call
+ above we used a reloc code which was the largest legal reloc code
+ plus the operand index. Here we undo that to recover the operand
+ index. At this point all symbol values should be fully resolved,
+ and we attempt to completely resolve the reloc. If we can not do
+ that, we determine the correct reloc code and put it back in the fixup. */
+
+int
+md_apply_fix3 (fixP, valueP, seg)
+ fixS *fixP;
+ valueT *valueP;
+ segT seg;
+{
+ /*char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;*/
+ valueT value;
+
+ /* FIXME FIXME FIXME: The value we are passed in *valueP includes
+ the symbol values. Since we are using BFD_ASSEMBLER, if we are
+ doing this relocation the code in write.c is going to call
+ bfd_perform_relocation, which is also going to use the symbol
+ value. That means that if the reloc is fully resolved we want to
+ use *valueP since bfd_perform_relocation is not being used.
+ However, if the reloc is not fully resolved we do not want to use
+ *valueP, and must use fx_offset instead. However, if the reloc
+ is PC relative, we do want to use *valueP since it includes the
+ result of md_pcrel_from. This is confusing. */
+
+ if (fixP->fx_addsy == (symbolS *) NULL)
+ {
+ value = *valueP;
+ fixP->fx_done = 1;
+ }
+ else if (fixP->fx_pcrel)
+ {
+ value = *valueP;
+ /* ELF relocations are against symbols.
+ If this symbol is in a different section then we need to leave it for
+ the linker to deal with. Unfortunately, md_pcrel_from can't tell,
+ so we have to undo it's effects here. */
+ if (S_IS_DEFINED (fixP->fx_addsy)
+ && S_GET_SEGMENT (fixP->fx_addsy) != seg)
+ value += md_pcrel_from (fixP);
+ }
+ else
+ {
+ value = fixP->fx_offset;
+ if (fixP->fx_subsy != (symbolS *) NULL)
+ {
+ if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)
+ value -= S_GET_VALUE (fixP->fx_subsy);
+ else
+ {
+ /* We can't actually support subtracting a symbol. */
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ "expression too complex");
+ }
+ }
+ }
+
+ if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+ {
+ int opindex;
+ const struct arc_operand *operand;
+ char *where;
+ arc_insn insn;
+
+ opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+
+ operand = &arc_operands[opindex];
+
+ /* Fetch the instruction, insert the fully resolved operand
+ value, and stuff the instruction back again. */
+ where = fixP->fx_frag->fr_literal + fixP->fx_where;
+ if (target_big_endian)
+ insn = bfd_getb32 ((unsigned char *) where);
+ else
+ insn = bfd_getl32 ((unsigned char *) where);
+ insn = arc_insert_operand (insn, operand, -1, NULL, (offsetT) value,
+ fixP->fx_file, fixP->fx_line);
+ if (target_big_endian)
+ bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
+ else
+ bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
+
+ if (fixP->fx_done)
+ {
+ /* Nothing else to do here. */
+ return 1;
+ }
+
+ /* Determine a BFD reloc value based on the operand information.
+ We are only prepared to turn a few of the operands into relocs.
+ !!! Note that we can't handle limm values here. Since we're using
+ implicit addends the addend must be inserted into the instruction,
+ however, the opcode insertion routines currently do nothing with
+ limm values. */
+ if (operand->fmt == 'B')
+ {
+ assert ((operand->flags & ARC_OPERAND_RELATIVE_BRANCH) != 0
+ && operand->bits == 20
+ && operand->shift == 7);
+ fixP->fx_r_type = BFD_RELOC_ARC_B22_PCREL;
+ }
+ else if (0 && operand->fmt == 'J')
+ {
+ assert ((operand->flags & ARC_OPERAND_ABSOLUTE_BRANCH) != 0
+ && operand->bits == 24
+ && operand->shift == 32);
+ fixP->fx_r_type = BFD_RELOC_ARC_B26;
+ }
+ else if (0 && operand->fmt == 'L')
+ {
+ assert ((operand->flags & ARC_OPERAND_LIMM) != 0
+ && operand->bits == 32
+ && operand->shift == 32);
+ fixP->fx_r_type = BFD_RELOC_32;
+ }
+ else
+ {
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ "unresolved expression that must be resolved");
+ fixP->fx_done = 1;
+ return 1;
+ }
+ }
+ else
+ {
+ switch (fixP->fx_r_type)
+ {
+ case BFD_RELOC_8:
+ md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
+ value, 1);
+ break;
+ case BFD_RELOC_16:
+ md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
+ value, 2);
+ break;
+ case BFD_RELOC_32:
+ md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
+ value, 4);
+ break;
+#if 0
+ case BFD_RELOC_64:
+ md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
+ value, 8);
+ break;
+#endif
+ case BFD_RELOC_ARC_B26:
+ /* If !fixP->fx_done then `value' is an implicit addend.
+ We must shift it right by 2 in this case as well because the
+ linker performs the relocation and then adds this in (as opposed
+ to adding this in and then shifting right by 2). */
+ value >>= 2;
+ md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
+ value, 4);
+ break;
+ default:
+ abort ();
+ }
+ }
+
+ fixP->fx_addnumber = value;
+
+ return 1;
+}
+
+/* Translate internal representation of relocation info to BFD target
+ format. */
+
+arelent *
+tc_gen_reloc (section, fixP)
+ asection *section;
+ fixS *fixP;
+{
+ arelent *reloc;
+
+ reloc = (arelent *) xmalloc (sizeof (arelent));
+
+ reloc->sym_ptr_ptr = &fixP->fx_addsy->bsym;
+ reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
+ reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
+ if (reloc->howto == (reloc_howto_type *) NULL)
+ {
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ "internal error: can't export reloc type %d (`%s')",
+ fixP->fx_r_type, bfd_get_reloc_code_name (fixP->fx_r_type));
+ return NULL;
+ }
+
+ assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
+
+ reloc->addend = fixP->fx_addnumber;
+
+ return reloc;
+}
+
+/* Frobbers. */
+
+#if 0
+/* Set the real name if the .rename pseudo-op was used.
+ Return 1 if the symbol should not be included in the symbol table. */
+
+int
+arc_frob_symbol (sym)
+ symbolS *sym;
+{
+ if (sym->sy_tc.real_name != (char *) NULL)
+ S_SET_NAME (sym, sym->sy_tc.real_name);
+
+ return 0;
+}
+#endif
diff --git a/contrib/binutils/gas/config/tc-arc.h b/contrib/binutils/gas/config/tc-arc.h
new file mode 100644
index 0000000..6a95ff4
--- /dev/null
+++ b/contrib/binutils/gas/config/tc-arc.h
@@ -0,0 +1,71 @@
+/* tc-arc.h - Macros and type defines for the ARC.
+ Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
+ Contributed by Doug Evans (dje@cygnus.com).
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2,
+ or (at your option) any later version.
+
+ GAS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#define TC_ARC 1
+
+#define TARGET_BYTES_BIG_ENDIAN 0
+
+#define LOCAL_LABELS_FB 1
+
+#define TARGET_ARCH bfd_arch_arc
+
+#define LITTLE_ENDIAN 1234
+#define BIG_ENDIAN 4321
+
+/* The endianness of the target format may change based on command
+ line arguments. */
+extern const char *arc_target_format;
+#define DEFAULT_TARGET_FORMAT "elf32-littlearc"
+#define TARGET_FORMAT arc_target_format
+#define DEFAULT_BYTE_ORDER LITTLE_ENDIAN
+
+#define WORKING_DOT_WORD
+
+#define LISTING_HEADER "ARC GAS "
+
+#define TC_HANDLES_FX_DONE
+
+#define MD_APPLY_FIX3
+
+/* The ARC needs to parse reloc specifiers in .word. */
+
+extern void arc_parse_cons_expression ();
+#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \
+arc_parse_cons_expression (EXP, NBYTES)
+
+extern void arc_cons_fix_new ();
+#define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP) \
+arc_cons_fix_new (FRAG, WHERE, NBYTES, EXP)
+
+#if 0
+/* Extra stuff that we need to keep track of for each symbol. */
+struct arc_tc_sy
+{
+ /* The real name, if the symbol was renamed. */
+ char *real_name;
+};
+
+#define TC_SYMFIELD_TYPE struct arc_tc_sy
+
+/* Finish up the symbol. */
+extern int arc_frob_symbol PARAMS ((struct symbol *));
+#define tc_frob_symbol(sym, punt) punt = arc_frob_symbol (sym)
+#endif
diff --git a/contrib/binutils/gas/config/tc-sh.c b/contrib/binutils/gas/config/tc-sh.c
index 0c0bf4b..eaa6146 100644
--- a/contrib/binutils/gas/config/tc-sh.c
+++ b/contrib/binutils/gas/config/tc-sh.c
@@ -48,6 +48,7 @@ static void sh_frob_section PARAMS ((bfd *, segT, PTR));
void cons ();
void s_align_bytes ();
+static void s_uacons PARAMS ((int));
int shl = 0;
@@ -70,6 +71,8 @@ const pseudo_typeS md_pseudo_table[] =
{"page", listing_eject, 0},
{"program", s_ignore, 0},
{"uses", s_uses, 0},
+ {"uaword", s_uacons, 2},
+ {"ualong", s_uacons, 4},
{0, 0, 0}
};
@@ -77,6 +80,10 @@ const pseudo_typeS md_pseudo_table[] =
int sh_relax; /* set if -relax seen */
+/* Whether -small was seen. */
+
+int sh_small;
+
const char EXP_CHARS[] = "eE";
/* Chars that mean this number is a floating point constant */
@@ -259,6 +266,18 @@ parse_reg (src, mode, reg)
return 3;
}
+ if (src[0] == 's' && src[1] == 'g' && src[2] == 'r' && ! isalnum (src[3]))
+ {
+ *mode = A_SGR;
+ return 3;
+ }
+
+ if (src[0] == 'd' && src[1] == 'b' && src[2] == 'r' && ! isalnum (src[3]))
+ {
+ *mode = A_DBR;
+ return 3;
+ }
+
if (src[0] == 's' && src[1] == 'r' && ! isalnum (src[2]))
{
*mode = A_SR;
@@ -324,6 +343,61 @@ parse_reg (src, mode, reg)
return 3;
}
}
+ if (src[0] == 'd' && src[1] == 'r')
+ {
+ if (src[2] == '1')
+ {
+ if (src[3] >= '0' && src[3] <= '4' && ! ((src[3] - '0') & 1)
+ && ! isalnum (src[4]))
+ {
+ *mode = D_REG_N;
+ *reg = 10 + src[3] - '0';
+ return 4;
+ }
+ }
+ if (src[2] >= '0' && src[2] <= '8' && ! ((src[2] - '0') & 1)
+ && ! isalnum (src[3]))
+ {
+ *mode = D_REG_N;
+ *reg = (src[2] - '0');
+ return 3;
+ }
+ }
+ if (src[0] == 'x' && src[1] == 'd')
+ {
+ if (src[2] == '1')
+ {
+ if (src[3] >= '0' && src[3] <= '4' && ! ((src[3] - '0') & 1)
+ && ! isalnum (src[4]))
+ {
+ *mode = X_REG_N;
+ *reg = 11 + src[3] - '0';
+ return 4;
+ }
+ }
+ if (src[2] >= '0' && src[2] <= '8' && ! ((src[2] - '0') & 1)
+ && ! isalnum (src[3]))
+ {
+ *mode = X_REG_N;
+ *reg = (src[2] - '0') + 1;
+ return 3;
+ }
+ }
+ if (src[0] == 'f' && src[1] == 'v')
+ {
+ if (src[2] == '1'&& src[3] == '2' && ! isalnum (src[4]))
+ {
+ *mode = V_REG_N;
+ *reg = 12;
+ return 4;
+ }
+ if ((src[2] == '0' || src[2] == '4' || src[2] == '8') && ! isalnum (src[3]))
+ {
+ *mode = V_REG_N;
+ *reg = (src[2] - '0');
+ return 3;
+ }
+ }
if (src[0] == 'f' && src[1] == 'p' && src[2] == 'u' && src[3] == 'l'
&& ! isalnum (src[4]))
{
@@ -338,6 +412,13 @@ parse_reg (src, mode, reg)
return 5;
}
+ if (src[0] == 'x' && src[1] == 'm' && src[2] == 't' && src[3] == 'r'
+ && src[4] == 'x' && ! isalnum (src[5]))
+ {
+ *mode = XMTRX_M4;
+ return 5;
+ }
+
return 0;
}
@@ -662,6 +743,9 @@ get_specific (opcode, operands)
case A_IND_R0_REG_N:
case A_DISP_REG_N:
case F_REG_N:
+ case D_REG_N:
+ case X_REG_N:
+ case V_REG_N:
case FPUL_N:
case FPSCR_N:
/* Opcode needs rn */
@@ -669,11 +753,23 @@ get_specific (opcode, operands)
goto fail;
reg_n = user->reg;
break;
+ case FD_REG_N:
+ if (user->type != F_REG_N && user->type != D_REG_N)
+ goto fail;
+ reg_n = user->reg;
+ break;
+ case DX_REG_N:
+ if (user->type != D_REG_N && user->type != X_REG_N)
+ goto fail;
+ reg_n = user->reg;
+ break;
case A_GBR:
case A_SR:
case A_VBR:
case A_SSR:
case A_SPC:
+ case A_SGR:
+ case A_DBR:
if (user->type != arg)
goto fail;
break;
@@ -697,6 +793,9 @@ get_specific (opcode, operands)
break;
case F_REG_M:
+ case D_REG_M:
+ case X_REG_M:
+ case V_REG_M:
case FPUL_M:
case FPSCR_M:
/* Opcode needs rn */
@@ -704,6 +803,16 @@ get_specific (opcode, operands)
goto fail;
reg_m = user->reg;
break;
+ case DX_REG_M:
+ if (user->type != D_REG_N && user->type != X_REG_N)
+ goto fail;
+ reg_m = user->reg;
+ break;
+ case XMTRX_M4:
+ if (user->type != XMTRX_M4)
+ goto fail;
+ reg_m = 4;
+ break;
default:
printf ("unhandled %d\n", arg);
@@ -813,6 +922,9 @@ build_Mytes (opcode, operand)
case REG_M:
nbuf[index] = reg_m;
break;
+ case REG_NM:
+ nbuf[index] = reg_n | (reg_m >> 2);
+ break;
case REG_B:
nbuf[index] = reg_b | 0x08;
break;
@@ -1099,10 +1211,12 @@ CONST char *md_shortopts = "";
struct option md_longopts[] = {
#define OPTION_RELAX (OPTION_MD_BASE)
-#define OPTION_LITTLE (OPTION_MD_BASE+1)
+#define OPTION_LITTLE (OPTION_MD_BASE + 1)
+#define OPTION_SMALL (OPTION_LITTLE + 1)
{"relax", no_argument, NULL, OPTION_RELAX},
{"little", no_argument, NULL, OPTION_LITTLE},
+ {"small", no_argument, NULL, OPTION_SMALL},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof(md_longopts);
@@ -1117,11 +1231,16 @@ md_parse_option (c, arg)
case OPTION_RELAX:
sh_relax = 1;
break;
+
case OPTION_LITTLE:
shl = 1;
target_big_endian = 0;
break;
+ case OPTION_SMALL:
+ sh_small = 1;
+ break;
+
default:
return 0;
}
@@ -1136,7 +1255,8 @@ md_show_usage (stream)
fprintf(stream, "\
SH options:\n\
-little generate little endian code\n\
--relax alter jump instructions for long displacements\n");
+-relax alter jump instructions for long displacements\n\
+-small align sections to 4 byte boundaries, not 16\n");
}
int md_short_jump_size;
@@ -1560,8 +1680,70 @@ DEFUN (md_section_align, (seg, size),
#endif /* ! BFD_ASSEMBLER */
}
+/* This static variable is set by s_uacons to tell sh_cons_align that
+ the expession does not need to be aligned. */
+
+static int sh_no_align_cons = 0;
+
+/* This handles the unaligned space allocation pseudo-ops, such as
+ .uaword. .uaword is just like .word, but the value does not need
+ to be aligned. */
+
+static void
+s_uacons (bytes)
+ int bytes;
+{
+ /* Tell sh_cons_align not to align this value. */
+ sh_no_align_cons = 1;
+ cons (bytes);
+}
+
+/* If a .word, et. al., pseud-op is seen, warn if the value is not
+ aligned correctly. Note that this can cause warnings to be issued
+ when assembling initialized structured which were declared with the
+ packed attribute. FIXME: Perhaps we should require an option to
+ enable this warning? */
+
+void
+sh_cons_align (nbytes)
+ int nbytes;
+{
+ int nalign;
+ char *p;
+
+ if (sh_no_align_cons)
+ {
+ /* This is an unaligned pseudo-op. */
+ sh_no_align_cons = 0;
+ return;
+ }
+
+ nalign = 0;
+ while ((nbytes & 1) == 0)
+ {
+ ++nalign;
+ nbytes >>= 1;
+ }
+
+ if (nalign == 0)
+ return;
+
+ if (now_seg == absolute_section)
+ {
+ if ((abs_section_offset & ((1 << nalign) - 1)) != 0)
+ as_warn ("misaligned data");
+ return;
+ }
+
+ p = frag_var (rs_align_code, 1, 1, (relax_substateT) 0,
+ (symbolS *) NULL, (offsetT) nalign, (char *) NULL);
+
+ record_alignment (now_seg, nalign);
+}
+
/* When relaxing, we need to output a reloc for any .align directive
- that requests alignment to a four byte boundary or larger. */
+ that requests alignment to a four byte boundary or larger. This is
+ also where we check for misaligned data. */
void
sh_handle_align (frag)
@@ -1574,6 +1756,10 @@ sh_handle_align (frag)
&& now_seg != bss_section)
fix_new (frag, frag->fr_fix, 2, &abs_symbol, frag->fr_offset, 0,
BFD_RELOC_SH_ALIGN);
+
+ if (frag->fr_type == rs_align_code
+ && frag->fr_next->fr_address - frag->fr_address - frag->fr_fix != 0)
+ as_warn_where (frag->fr_file, frag->fr_line, "misaligned data");
}
/* This macro decides whether a particular reloc is an entry in a
@@ -1587,6 +1773,7 @@ sh_handle_align (frag)
#define SWITCH_TABLE_CONS(fix) \
((fix)->fx_r_type == 0 \
&& ((fix)->fx_size == 2 \
+ || (fix)->fx_size == 1 \
|| (fix)->fx_size == 4))
#endif
@@ -1597,6 +1784,7 @@ sh_handle_align (frag)
&& S_GET_SEGMENT ((fix)->fx_subsy) == text_section \
&& ((fix)->fx_r_type == BFD_RELOC_32 \
|| (fix)->fx_r_type == BFD_RELOC_16 \
+ || (fix)->fx_r_type == BFD_RELOC_8 \
|| SWITCH_TABLE_CONS (fix)))
/* See whether we need to force a relocation into the output file.
@@ -1639,6 +1827,8 @@ md_apply_fix (fixP, val)
#ifdef BFD_ASSEMBLER
long val = *valp;
#endif
+ long max, min;
+ int shift;
#ifndef BFD_ASSEMBLER
if (fixP->fx_r_type == 0)
@@ -1648,36 +1838,53 @@ md_apply_fix (fixP, val)
else if (fixP->fx_size == 4)
fixP->fx_r_type = BFD_RELOC_32;
else if (fixP->fx_size == 1)
- fixP->fx_r_type = BFD_RELOC_SH_IMM8;
+ fixP->fx_r_type = BFD_RELOC_8;
else
abort ();
}
#endif
+ max = min = 0;
+ shift = 0;
switch (fixP->fx_r_type)
{
case BFD_RELOC_SH_IMM4:
+ max = 0xf;
*buf = (*buf & 0xf0) | (val & 0xf);
break;
case BFD_RELOC_SH_IMM4BY2:
+ max = 0xf;
+ shift = 1;
*buf = (*buf & 0xf0) | ((val >> 1) & 0xf);
break;
case BFD_RELOC_SH_IMM4BY4:
+ max = 0xf;
+ shift = 2;
*buf = (*buf & 0xf0) | ((val >> 2) & 0xf);
break;
case BFD_RELOC_SH_IMM8BY2:
+ max = 0xff;
+ shift = 1;
*buf = val >> 1;
break;
case BFD_RELOC_SH_IMM8BY4:
+ max = 0xff;
+ shift = 2;
*buf = val >> 2;
break;
case BFD_RELOC_8:
case BFD_RELOC_SH_IMM8:
+ /* Sometimes the 8 bit value is sign extended (e.g., add) and
+ sometimes it is not (e.g., and). We permit any 8 bit value.
+ Note that adding further restrictions may invalidate
+ reasonable looking assembly code, such as ``and -0x1,r0''. */
+ max = 0xff;
+ min = - 0xff;
*buf++ = val;
break;
@@ -1770,6 +1977,19 @@ md_apply_fix (fixP, val)
abort ();
}
+ if (shift != 0)
+ {
+ if ((val & ((1 << shift) - 1)) != 0)
+ as_bad_where (fixP->fx_file, fixP->fx_line, "misaligned offset");
+ if (val >= 0)
+ val >>= shift;
+ else
+ val = ((val >> shift)
+ | ((long) -1 & ~ ((long) -1 >> shift)));
+ }
+ if (max != 0 && (val < min || val > max))
+ as_bad_where (fixP->fx_file, fixP->fx_line, "offset out of range");
+
#ifdef BFD_ASSEMBLER
return 0;
#endif
@@ -1931,6 +2151,7 @@ static const struct reloc_map coff_reloc_map[] =
{ BFD_RELOC_SH_IMM8BY4, R_SH_IMM8BY4 },
{ BFD_RELOC_SH_PCRELIMM8BY2, R_SH_PCRELIMM8BY2 },
{ BFD_RELOC_SH_PCRELIMM8BY4, R_SH_PCRELIMM8BY4 },
+ { BFD_RELOC_8_PCREL, R_SH_SWITCH8 },
{ BFD_RELOC_SH_SWITCH16, R_SH_SWITCH16 },
{ BFD_RELOC_SH_SWITCH32, R_SH_SWITCH32 },
{ BFD_RELOC_SH_USES, R_SH_USES },
@@ -1977,6 +2198,8 @@ sh_coff_reloc_mangle (seg, fix, intr, paddr)
if (fix->fx_r_type == BFD_RELOC_16)
intr->r_type = R_SH_SWITCH16;
+ else if (fix->fx_r_type == BFD_RELOC_8)
+ intr->r_type = R_SH_SWITCH8;
else if (fix->fx_r_type == BFD_RELOC_32)
intr->r_type = R_SH_SWITCH32;
else
@@ -2077,6 +2300,8 @@ tc_gen_reloc (section, fixp)
rel->addend = rel->address - S_GET_VALUE (fixp->fx_subsy);
if (r_type == BFD_RELOC_16)
r_type = BFD_RELOC_SH_SWITCH16;
+ else if (r_type == BFD_RELOC_8)
+ r_type = BFD_RELOC_8_PCREL;
else if (r_type == BFD_RELOC_32)
r_type = BFD_RELOC_SH_SWITCH32;
else
diff --git a/contrib/binutils/gas/config/tc-sh.h b/contrib/binutils/gas/config/tc-sh.h
index fb5c9ef..a18029b 100644
--- a/contrib/binutils/gas/config/tc-sh.h
+++ b/contrib/binutils/gas/config/tc-sh.h
@@ -30,9 +30,16 @@ extern int shl;
/* Whether -relax was used. */
extern int sh_relax;
+/* Whether -small was used. */
+extern int sh_small;
+
/* Don't try to break words. */
#define WORKING_DOT_WORD
+/* We require .long, et. al., to be aligned correctly. */
+#define md_cons_align(nbytes) sh_cons_align (nbytes)
+extern void sh_cons_align PARAMS ((int));
+
/* When relaxing, we need to generate relocations for alignment
directives. */
#define HANDLE_ALIGN(frag) sh_handle_align (frag)
@@ -117,7 +124,7 @@ extern int tc_coff_sizemachdep PARAMS ((fragS *));
|| strcmp (obj_segment_name (SEG), ".ctors") == 0 \
|| strcmp (obj_segment_name (SEG), ".dtors") == 0) \
? 2 \
- : 4))
+ : (sh_small ? 2 : 4)))
#endif /* OBJ_COFF */
diff --git a/contrib/binutils/gas/config/tc-tic30.c b/contrib/binutils/gas/config/tc-tic30.c
new file mode 100644
index 0000000..f78c6f8
--- /dev/null
+++ b/contrib/binutils/gas/config/tc-tic30.c
@@ -0,0 +1,1909 @@
+/* tc-c30.c -- Assembly code for the Texas Instruments TMS320C30
+ Copyright (C) 1998 Free Software Foundation.
+ Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GAS is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/*
+ Texas Instruments TMS320C30 machine specific gas.
+ Written by Steven Haworth (steve@pm.cse.rmit.edu.au).
+ Bugs & suggestions are completely welcome. This is free software.
+ Please help us make it better.
+ */
+
+#include "as.h"
+#include "opcode/tic30.h"
+
+/* put here all non-digit non-letter charcters that may occur in an operand */
+static char operand_special_chars[] = "%$-+(,)*._~/<>&^!:[@]";
+static char *ordinal_names[] =
+{"first", "second", "third", "fourth", "fifth"};
+
+const int md_reloc_size = 0;
+int md_long_jump_size = 0;
+int md_short_jump_size = 0;
+
+const char comment_chars[] = ";";
+const char line_comment_chars[] = "*";
+const char line_separator_chars[] = "";
+
+const char *md_shortopts = "";
+struct option md_longopts[] =
+{
+ {NULL, no_argument, NULL, 0}
+};
+
+size_t md_longopts_size = sizeof (md_longopts);
+
+/* Chars that mean this number is a floating point constant */
+/* As in 0f12.456 */
+/* or 0d1.2345e12 */
+const char FLT_CHARS[] = "fFdDxX";
+
+/* Chars that can be used to separate mant from exp in floating point nums */
+const char EXP_CHARS[] = "eE";
+
+/* tables for lexical analysis */
+static char opcode_chars[256];
+static char register_chars[256];
+static char operand_chars[256];
+static char space_chars[256];
+static char identifier_chars[256];
+static char digit_chars[256];
+
+/* lexical macros */
+#define is_opcode_char(x) (opcode_chars[(unsigned char) x])
+#define is_operand_char(x) (operand_chars[(unsigned char) x])
+#define is_register_char(x) (register_chars[(unsigned char) x])
+#define is_space_char(x) (space_chars[(unsigned char) x])
+#define is_identifier_char(x) (identifier_chars[(unsigned char) x])
+#define is_digit_char(x) (digit_chars[(unsigned char) x])
+
+const pseudo_typeS md_pseudo_table[] =
+{
+ {0, 0, 0}
+};
+
+#undef USE_STDOUT
+#define USE_STDOUT 1
+
+#ifdef USE_STDARG
+
+#include <stdarg.h>
+
+int
+debug (const char *string,...)
+{
+ if (flag_debug)
+ {
+ va_list argptr;
+ char str[100];
+
+ va_start (argptr, string);
+ vsprintf (str, string, argptr);
+ if (str[0] == '\0')
+ return (0);
+ va_end (argptr);
+ fputs (str, USE_STDOUT ? stdout : stderr);
+ return strlen (str);
+ }
+ else
+ return 0;
+}
+#else
+int
+debug (string, va_alist)
+ const char *string;
+ va_dcl
+{
+ if (flag_debug)
+ {
+ va_list argptr;
+ char str[100];
+ int cnt;
+
+ va_start (argptr, string);
+ cnt = vsprintf (str, string, argptr);
+ if (str[0] == NULL)
+ return (0);
+ va_end (argptr);
+ fputs (str, USE_STDOUT ? stdout : stderr);
+ return (cnt);
+ }
+ else
+ return 0;
+}
+#endif
+
+/* hash table for opcode lookup */
+static struct hash_control *op_hash;
+/* hash table for parallel opcode lookup */
+static struct hash_control *parop_hash;
+/* hash table for register lookup */
+static struct hash_control *reg_hash;
+/* hash table for indirect addressing lookup */
+static struct hash_control *ind_hash;
+
+void
+md_begin ()
+{
+ const char *hash_err;
+ debug ("In md_begin()\n");
+ op_hash = hash_new ();
+ {
+ const template *current_optab = tic30_optab;
+ for (; current_optab < tic30_optab_end; current_optab++)
+ {
+ hash_err = hash_insert (op_hash, current_optab->name, (char *) current_optab);
+ if (hash_err)
+ as_fatal ("Internal Error: Can't Hash %s: %s", current_optab->name, hash_err);
+ }
+ }
+ parop_hash = hash_new ();
+ {
+ const partemplate *current_parop = tic30_paroptab;
+ for (; current_parop < tic30_paroptab_end; current_parop++)
+ {
+ hash_err = hash_insert (parop_hash, current_parop->name, (char *) current_parop);
+ if (hash_err)
+ as_fatal ("Internal Error: Can't Hash %s: %s", current_parop->name, hash_err);
+ }
+ }
+ reg_hash = hash_new ();
+ {
+ const reg *current_reg = tic30_regtab;
+ for (; current_reg < tic30_regtab_end; current_reg++)
+ {
+ hash_err = hash_insert (reg_hash, current_reg->name, (char *) current_reg);
+ if (hash_err)
+ as_fatal ("Internal Error: Can't Hash %s: %s", current_reg->name, hash_err);
+ }
+ }
+ ind_hash = hash_new ();
+ {
+ const ind_addr_type *current_ind = tic30_indaddr_tab;
+ for (; current_ind < tic30_indaddrtab_end; current_ind++)
+ {
+ hash_err = hash_insert (ind_hash, current_ind->syntax, (char *) current_ind);
+ if (hash_err)
+ as_fatal ("Internal Error: Can't Hash %s: %s", current_ind->syntax, hash_err);
+ }
+ }
+ /* fill in lexical tables: opcode_chars, operand_chars, space_chars */
+ {
+ register int c;
+ register char *p;
+
+ for (c = 0; c < 256; c++)
+ {
+ if (islower (c) || isdigit (c))
+ {
+ opcode_chars[c] = c;
+ register_chars[c] = c;
+ }
+ else if (isupper (c))
+ {
+ opcode_chars[c] = tolower (c);
+ register_chars[c] = opcode_chars[c];
+ }
+ else if (c == ')' || c == '(')
+ {
+ register_chars[c] = c;
+ }
+ if (isupper (c) || islower (c) || isdigit (c))
+ operand_chars[c] = c;
+ if (isdigit (c) || c == '-')
+ digit_chars[c] = c;
+ if (isalpha (c) || c == '_' || c == '.' || isdigit (c))
+ identifier_chars[c] = c;
+ if (c == ' ' || c == '\t')
+ space_chars[c] = c;
+ if (c == '_')
+ opcode_chars[c] = c;
+ }
+ for (p = operand_special_chars; *p != '\0'; p++)
+ operand_chars[(unsigned char) *p] = *p;
+ }
+}
+
+/* Address Mode OR values */
+#define AM_Register 0x00000000
+#define AM_Direct 0x00200000
+#define AM_Indirect 0x00400000
+#define AM_Immediate 0x00600000
+#define AM_NotReq 0xFFFFFFFF
+
+/* PC Relative OR values */
+#define PC_Register 0x00000000
+#define PC_Relative 0x02000000
+
+typedef struct
+{
+ unsigned op_type;
+ struct
+ {
+ int resolved;
+ unsigned address;
+ char *label;
+ expressionS direct_expr;
+ }
+ direct;
+ struct
+ {
+ unsigned mod;
+ int ARnum;
+ unsigned char disp;
+ }
+ indirect;
+ struct
+ {
+ unsigned opcode;
+ }
+ reg;
+ struct
+ {
+ int resolved;
+ int decimal_found;
+ float f_number;
+ int s_number;
+ unsigned int u_number;
+ char *label;
+ expressionS imm_expr;
+ }
+ immediate;
+}
+operand;
+
+int tic30_parallel_insn PARAMS ((char *));
+operand *tic30_operand PARAMS ((char *));
+char *tic30_find_parallel_insn PARAMS ((char *, char *));
+
+template *opcode;
+
+struct tic30_insn
+ {
+ template *tm; /* Template of current instruction */
+ unsigned opcode; /* Final opcode */
+ int operands; /* Number of given operands */
+ /* Type of operand given in instruction */
+ operand *operand_type[MAX_OPERANDS];
+ unsigned addressing_mode; /* Final addressing mode of instruction */
+ };
+
+struct tic30_insn insn;
+static int found_parallel_insn;
+
+void
+md_assemble (line)
+ char *line;
+{
+ template *opcode;
+ char *current_posn;
+ char *token_start;
+ char save_char;
+ int count;
+
+ debug ("In md_assemble() with argument %s\n", line);
+ memset (&insn, '\0', sizeof (insn));
+ if (found_parallel_insn)
+ {
+ debug ("Line is second part of parallel instruction\n\n");
+ found_parallel_insn = 0;
+ return;
+ }
+ if ((current_posn = tic30_find_parallel_insn (line, input_line_pointer + 1)) == NULL)
+ current_posn = line;
+ else
+ found_parallel_insn = 1;
+ while (is_space_char (*current_posn))
+ current_posn++;
+ token_start = current_posn;
+ if (!is_opcode_char (*current_posn))
+ {
+ as_bad ("Invalid character %s in opcode", output_invalid (*current_posn));
+ return;
+ }
+ /* Check if instruction is a parallel instruction by seeing if the first
+ character is a q. */
+ if (*token_start == 'q')
+ {
+ if (tic30_parallel_insn (token_start))
+ {
+ if (found_parallel_insn)
+ free (token_start);
+ return;
+ }
+ }
+ while (is_opcode_char (*current_posn))
+ current_posn++;
+ { /* Find instruction */
+ save_char = *current_posn;
+ *current_posn = '\0';
+ opcode = (template *) hash_find (op_hash, token_start);
+ if (opcode)
+ {
+ debug ("Found instruction %s\n", opcode->name);
+ insn.tm = opcode;
+ }
+ else
+ {
+ debug ("Didn't find insn\n");
+ as_bad ("Unknown TMS320C30 instruction: %s", token_start);
+ return;
+ }
+ *current_posn = save_char;
+ }
+ if (*current_posn != END_OF_INSN)
+ { /* Find operands */
+ int paren_not_balanced;
+ int expecting_operand = 0;
+ int this_operand;
+ do
+ {
+ /* skip optional white space before operand */
+ while (!is_operand_char (*current_posn) && *current_posn != END_OF_INSN)
+ {
+ if (!is_space_char (*current_posn))
+ {
+ as_bad ("Invalid character %s before %s operand",
+ output_invalid (*current_posn),
+ ordinal_names[insn.operands]);
+ return;
+ }
+ current_posn++;
+ }
+ token_start = current_posn; /* after white space */
+ paren_not_balanced = 0;
+ while (paren_not_balanced || *current_posn != ',')
+ {
+ if (*current_posn == END_OF_INSN)
+ {
+ if (paren_not_balanced)
+ {
+ as_bad ("Unbalanced parenthesis in %s operand.",
+ ordinal_names[insn.operands]);
+ return;
+ }
+ else
+ break; /* we are done */
+ }
+ else if (!is_operand_char (*current_posn) && !is_space_char (*current_posn))
+ {
+ as_bad ("Invalid character %s in %s operand",
+ output_invalid (*current_posn),
+ ordinal_names[insn.operands]);
+ return;
+ }
+ if (*current_posn == '(')
+ ++paren_not_balanced;
+ if (*current_posn == ')')
+ --paren_not_balanced;
+ current_posn++;
+ }
+ if (current_posn != token_start)
+ { /* yes, we've read in another operand */
+ this_operand = insn.operands++;
+ if (insn.operands > MAX_OPERANDS)
+ {
+ as_bad ("Spurious operands; (%d operands/instruction max)",
+ MAX_OPERANDS);
+ return;
+ }
+ /* now parse operand adding info to 'insn' as we go along */
+ save_char = *current_posn;
+ *current_posn = '\0';
+ insn.operand_type[this_operand] = tic30_operand (token_start);
+ *current_posn = save_char;
+ if (insn.operand_type[this_operand] == NULL)
+ return;
+ }
+ else
+ {
+ if (expecting_operand)
+ {
+ as_bad ("Expecting operand after ','; got nothing");
+ return;
+ }
+ if (*current_posn == ',')
+ {
+ as_bad ("Expecting operand before ','; got nothing");
+ return;
+ }
+ }
+ /* now *current_posn must be either ',' or END_OF_INSN */
+ if (*current_posn == ',')
+ {
+ if (*++current_posn == END_OF_INSN)
+ { /* just skip it, if it's \n complain */
+ as_bad ("Expecting operand after ','; got nothing");
+ return;
+ }
+ expecting_operand = 1;
+ }
+ }
+ while (*current_posn != END_OF_INSN); /* until we get end of insn */
+ }
+ debug ("Number of operands found: %d\n", insn.operands);
+ /* Check that number of operands is correct */
+ if (insn.operands != insn.tm->operands)
+ {
+ int i;
+ int numops = insn.tm->operands;
+ /* If operands are not the same, then see if any of the operands are not
+ required. Then recheck with number of given operands. If they are still not
+ the same, then give an error, otherwise carry on. */
+ for (i = 0; i < insn.tm->operands; i++)
+ if (insn.tm->operand_types[i] & NotReq)
+ numops--;
+ if (insn.operands != numops)
+ {
+ as_bad ("Incorrect number of operands given");
+ return;
+ }
+ }
+ insn.addressing_mode = AM_NotReq;
+ for (count = 0; count < insn.operands; count++)
+ {
+ if (insn.operand_type[count]->op_type & insn.tm->operand_types[count])
+ {
+ debug ("Operand %d matches\n", count + 1);
+ /* If instruction has two operands and has an AddressMode modifier then set
+ addressing mode type for instruction */
+ if (insn.tm->opcode_modifier == AddressMode)
+ {
+ int addr_insn = 0;
+ /* Store instruction uses the second operand for the address mode. */
+ if ((insn.tm->operand_types[1] & (Indirect | Direct)) == (Indirect | Direct))
+ addr_insn = 1;
+ if (insn.operand_type[addr_insn]->op_type & (AllReg))
+ insn.addressing_mode = AM_Register;
+ else if (insn.operand_type[addr_insn]->op_type & Direct)
+ insn.addressing_mode = AM_Direct;
+ else if (insn.operand_type[addr_insn]->op_type & Indirect)
+ insn.addressing_mode = AM_Indirect;
+ else
+ insn.addressing_mode = AM_Immediate;
+ }
+ }
+ else
+ {
+ as_bad ("The %s operand doesn't match", ordinal_names[count]);
+ return;
+ }
+ }
+ /* Now set the addressing mode for 3 operand instructions. */
+ if ((insn.tm->operand_types[0] & op3T1) && (insn.tm->operand_types[1] & op3T2))
+ {
+ /* Set the addressing mode to the values used for 2 operand instructions in the
+ G addressing field of the opcode. */
+ char *p;
+ switch (insn.operand_type[0]->op_type)
+ {
+ case Rn:
+ case ARn:
+ case DPReg:
+ case OtherReg:
+ if (insn.operand_type[1]->op_type & (AllReg))
+ insn.addressing_mode = AM_Register;
+ else if (insn.operand_type[1]->op_type & Indirect)
+ insn.addressing_mode = AM_Direct;
+ else
+ {
+ /* Shouldn't make it to this stage */
+ as_bad ("Incompatible first and second operands in instruction");
+ return;
+ }
+ break;
+ case Indirect:
+ if (insn.operand_type[1]->op_type & (AllReg))
+ insn.addressing_mode = AM_Indirect;
+ else if (insn.operand_type[1]->op_type & Indirect)
+ insn.addressing_mode = AM_Immediate;
+ else
+ {
+ /* Shouldn't make it to this stage */
+ as_bad ("Incompatible first and second operands in instruction");
+ return;
+ }
+ break;
+ }
+ /* Now make up the opcode for the 3 operand instructions. As in parallel
+ instructions, there will be no unresolved values, so they can be fully formed
+ and added to the frag table. */
+ insn.opcode = insn.tm->base_opcode;
+ if (insn.operand_type[0]->op_type & Indirect)
+ {
+ insn.opcode |= (insn.operand_type[0]->indirect.ARnum);
+ insn.opcode |= (insn.operand_type[0]->indirect.mod << 3);
+ }
+ else
+ insn.opcode |= (insn.operand_type[0]->reg.opcode);
+ if (insn.operand_type[1]->op_type & Indirect)
+ {
+ insn.opcode |= (insn.operand_type[1]->indirect.ARnum << 8);
+ insn.opcode |= (insn.operand_type[1]->indirect.mod << 11);
+ }
+ else
+ insn.opcode |= (insn.operand_type[1]->reg.opcode << 8);
+ if (insn.operands == 3)
+ insn.opcode |= (insn.operand_type[2]->reg.opcode << 16);
+ insn.opcode |= insn.addressing_mode;
+ p = frag_more (INSN_SIZE);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else
+ { /* Not a three operand instruction */
+ char *p;
+ int am_insn = -1;
+ insn.opcode = insn.tm->base_opcode;
+ /* Create frag for instruction - all instructions are 4 bytes long. */
+ p = frag_more (INSN_SIZE);
+ if ((insn.operands > 0) && (insn.tm->opcode_modifier == AddressMode))
+ {
+ insn.opcode |= insn.addressing_mode;
+ if (insn.addressing_mode == AM_Indirect)
+ {
+ /* Determine which operand gives the addressing mode */
+ if (insn.operand_type[0]->op_type & Indirect)
+ am_insn = 0;
+ if ((insn.operands > 1) && (insn.operand_type[1]->op_type & Indirect))
+ am_insn = 1;
+ insn.opcode |= (insn.operand_type[am_insn]->indirect.disp);
+ insn.opcode |= (insn.operand_type[am_insn]->indirect.ARnum << 8);
+ insn.opcode |= (insn.operand_type[am_insn]->indirect.mod << 11);
+ if (insn.operands > 1)
+ insn.opcode |= (insn.operand_type[!am_insn]->reg.opcode << 16);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else if (insn.addressing_mode == AM_Register)
+ {
+ insn.opcode |= (insn.operand_type[0]->reg.opcode);
+ if (insn.operands > 1)
+ insn.opcode |= (insn.operand_type[1]->reg.opcode << 16);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else if (insn.addressing_mode == AM_Direct)
+ {
+ if (insn.operand_type[0]->op_type & Direct)
+ am_insn = 0;
+ if ((insn.operands > 1) && (insn.operand_type[1]->op_type & Direct))
+ am_insn = 1;
+ if (insn.operands > 1)
+ insn.opcode |= (insn.operand_type[!am_insn]->reg.opcode << 16);
+ if (insn.operand_type[am_insn]->direct.resolved == 1)
+ {
+ /* Resolved values can be placed straight into instruction word, and output */
+ insn.opcode |= (insn.operand_type[am_insn]->direct.address & 0x0000FFFF);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else
+ { /* Unresolved direct addressing mode instruction */
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ fix_new_exp (frag_now, p + 2 - (frag_now->fr_literal), 2, &insn.operand_type[am_insn]->direct.direct_expr, 0, 0);
+ }
+ }
+ else if (insn.addressing_mode == AM_Immediate)
+ {
+ if (insn.operand_type[0]->immediate.resolved == 1)
+ {
+ char *keeploc;
+ int size;
+ if (insn.operands > 1)
+ insn.opcode |= (insn.operand_type[1]->reg.opcode << 16);
+ switch (insn.tm->imm_arg_type)
+ {
+ case Imm_Float:
+ debug ("Floating point first operand\n");
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ keeploc = input_line_pointer;
+ input_line_pointer = insn.operand_type[0]->immediate.label;
+ if (md_atof ('f', p + 2, &size) != 0)
+ {
+ as_bad ("invalid short form floating point immediate operand");
+ return;
+ }
+ input_line_pointer = keeploc;
+ break;
+ case Imm_UInt:
+ debug ("Unsigned int first operand\n");
+ if (insn.operand_type[0]->immediate.decimal_found)
+ as_warn ("rounding down first operand float to unsigned int");
+ if (insn.operand_type[0]->immediate.u_number > 0xFFFF)
+ as_warn ("only lower 16-bits of first operand are used");
+ insn.opcode |= (insn.operand_type[0]->immediate.u_number & 0x0000FFFFL);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ break;
+ case Imm_SInt:
+ debug ("Int first operand\n");
+ if (insn.operand_type[0]->immediate.decimal_found)
+ as_warn ("rounding down first operand float to signed int");
+ if (insn.operand_type[0]->immediate.s_number < -32768 ||
+ insn.operand_type[0]->immediate.s_number > 32767)
+ {
+ as_bad ("first operand is too large for 16-bit signed int");
+ return;
+ }
+ insn.opcode |= (insn.operand_type[0]->immediate.s_number & 0x0000FFFFL);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ break;
+ }
+ }
+ else
+ { /* Unresolved immediate label */
+ if (insn.operands > 1)
+ insn.opcode |= (insn.operand_type[1]->reg.opcode << 16);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ fix_new_exp (frag_now, p + 2 - (frag_now->fr_literal), 2, &insn.operand_type[0]->immediate.imm_expr, 0, 0);
+ }
+ }
+ }
+ else if (insn.tm->opcode_modifier == PCRel)
+ {
+ /* Conditional Branch and Call instructions */
+ if ((insn.tm->operand_types[0] & (AllReg | Disp)) == (AllReg | Disp))
+ {
+ if (insn.operand_type[0]->op_type & (AllReg))
+ {
+ insn.opcode |= (insn.operand_type[0]->reg.opcode);
+ insn.opcode |= PC_Register;
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else
+ {
+ insn.opcode |= PC_Relative;
+ if (insn.operand_type[0]->immediate.resolved == 1)
+ {
+ insn.opcode |= (insn.operand_type[0]->immediate.s_number & 0x0000FFFF);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else
+ {
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ fix_new_exp (frag_now, p + 2 - (frag_now->fr_literal), 2, &insn.operand_type[0]->immediate.imm_expr, 1, 0);
+ }
+ }
+ }
+ else if ((insn.tm->operand_types[0] & ARn) == ARn)
+ {
+ /* Decrement and Branch instructions */
+ insn.opcode |= ((insn.operand_type[0]->reg.opcode - 0x08) << 22);
+ if (insn.operand_type[1]->op_type & (AllReg))
+ {
+ insn.opcode |= (insn.operand_type[1]->reg.opcode);
+ insn.opcode |= PC_Register;
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else if (insn.operand_type[1]->immediate.resolved == 1)
+ {
+ if (insn.operand_type[0]->immediate.decimal_found)
+ {
+ as_bad ("first operand is floating point");
+ return;
+ }
+ if (insn.operand_type[0]->immediate.s_number < -32768 ||
+ insn.operand_type[0]->immediate.s_number > 32767)
+ {
+ as_bad ("first operand is too large for 16-bit signed int");
+ return;
+ }
+ insn.opcode |= (insn.operand_type[1]->immediate.s_number);
+ insn.opcode |= PC_Relative;
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else
+ {
+ insn.opcode |= PC_Relative;
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ fix_new_exp (frag_now, p + 2 - frag_now->fr_literal, 2, &insn.operand_type[1]->immediate.imm_expr, 1, 0);
+ }
+ }
+ }
+ else if (insn.tm->operand_types[0] == IVector)
+ {
+ /* Trap instructions */
+ if (insn.operand_type[0]->op_type & IVector)
+ insn.opcode |= (insn.operand_type[0]->immediate.u_number);
+ else
+ { /* Shouldn't get here */
+ as_bad ("interrupt vector for trap instruction out of range");
+ return;
+ }
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else if (insn.tm->opcode_modifier == StackOp || insn.tm->opcode_modifier == Rotate)
+ {
+ /* Push, Pop and Rotate instructions */
+ insn.opcode |= (insn.operand_type[0]->reg.opcode << 16);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else if ((insn.tm->operand_types[0] & (Abs24 | Direct)) == (Abs24 | Direct))
+ {
+ /* LDP Instruction needs to be tested for before the next section */
+ if (insn.operand_type[0]->op_type & Direct)
+ {
+ if (insn.operand_type[0]->direct.resolved == 1)
+ {
+ /* Direct addressing uses lower 8 bits of direct address */
+ insn.opcode |= (insn.operand_type[0]->direct.address & 0x00FF0000) >> 16;
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else
+ {
+ fixS *fix;
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ fix = fix_new_exp (frag_now, p + 3 - (frag_now->fr_literal), 1, &insn.operand_type[0]->direct.direct_expr, 0, 0);
+ /* Ensure that the assembler doesn't complain about fitting a 24-bit
+ address into 8 bits. */
+ fix->fx_no_overflow = 1;
+ }
+ }
+ else
+ {
+ if (insn.operand_type[0]->immediate.resolved == 1)
+ {
+ /* Immediate addressing uses upper 8 bits of address */
+ if (insn.operand_type[0]->immediate.u_number > 0x00FFFFFF)
+ {
+ as_bad ("LDP instruction needs a 24-bit operand");
+ return;
+ }
+ insn.opcode |= ((insn.operand_type[0]->immediate.u_number & 0x00FF0000) >> 16);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else
+ {
+ fixS *fix;
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ fix = fix_new_exp (frag_now, p + 3 - (frag_now->fr_literal), 1, &insn.operand_type[0]->immediate.imm_expr, 0, 0);
+ fix->fx_no_overflow = 1;
+ }
+ }
+ }
+ else if (insn.tm->operand_types[0] & (Imm24))
+ {
+ /* Unconditional Branch and Call instructions */
+ if (insn.operand_type[0]->immediate.resolved == 1)
+ {
+ if (insn.operand_type[0]->immediate.u_number > 0x00FFFFFF)
+ as_warn ("first operand is too large for a 24-bit displacement");
+ insn.opcode |= (insn.operand_type[0]->immediate.u_number & 0x00FFFFFF);
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else
+ {
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ fix_new_exp (frag_now, p + 1 - (frag_now->fr_literal), 3, &insn.operand_type[0]->immediate.imm_expr, 0, 0);
+ }
+ }
+ else if (insn.tm->operand_types[0] & NotReq)
+ {
+ /* Check for NOP instruction without arguments. */
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ else if (insn.tm->operands == 0)
+ {
+ /* Check for instructions without operands. */
+ md_number_to_chars (p, (valueT) insn.opcode, INSN_SIZE);
+ }
+ }
+ debug ("Addressing mode: %08X\n", insn.addressing_mode);
+ {
+ int i;
+ for (i = 0; i < insn.operands; i++)
+ {
+ if (insn.operand_type[i]->immediate.label)
+ free (insn.operand_type[i]->immediate.label);
+ free (insn.operand_type[i]);
+ }
+ }
+ debug ("Final opcode: %08X\n", insn.opcode);
+ debug ("\n");
+}
+
+struct tic30_par_insn
+{
+ partemplate *tm; /* Template of current parallel instruction */
+ int operands[2]; /* Number of given operands for each insn */
+ /* Type of operand given in instruction */
+ operand *operand_type[2][MAX_OPERANDS];
+ int swap_operands; /* Whether to swap operands around. */
+ unsigned p_field; /* Value of p field in multiply add/sub instructions */
+ unsigned opcode; /* Final opcode */
+};
+
+struct tic30_par_insn p_insn;
+
+int
+tic30_parallel_insn (char *token)
+{
+ static partemplate *p_opcode;
+ char *current_posn = token;
+ char *token_start;
+ char save_char;
+
+ debug ("In tic30_parallel_insn with %s\n", token);
+ memset (&p_insn, '\0', sizeof (p_insn));
+ while (is_opcode_char (*current_posn))
+ current_posn++;
+ { /* Find instruction */
+ save_char = *current_posn;
+ *current_posn = '\0';
+ p_opcode = (partemplate *) hash_find (parop_hash, token);
+ if (p_opcode)
+ {
+ debug ("Found instruction %s\n", p_opcode->name);
+ p_insn.tm = p_opcode;
+ }
+ else
+ {
+ char first_opcode[6] =
+ {0};
+ char second_opcode[6] =
+ {0};
+ int i;
+ int current_opcode = -1;
+ int char_ptr = 0;
+
+ for (i = 0; i < strlen (token); i++)
+ {
+ char ch = *(token + i);
+ if (ch == '_' && current_opcode == -1)
+ {
+ current_opcode = 0;
+ continue;
+ }
+ if (ch == '_' && current_opcode == 0)
+ {
+ current_opcode = 1;
+ char_ptr = 0;
+ continue;
+ }
+ switch (current_opcode)
+ {
+ case 0:
+ first_opcode[char_ptr++] = ch;
+ break;
+ case 1:
+ second_opcode[char_ptr++] = ch;
+ break;
+ }
+ }
+ debug ("first_opcode = %s\n", first_opcode);
+ debug ("second_opcode = %s\n", second_opcode);
+ sprintf (token, "q_%s_%s", second_opcode, first_opcode);
+ p_opcode = (partemplate *) hash_find (parop_hash, token);
+ if (p_opcode)
+ {
+ debug ("Found instruction %s\n", p_opcode->name);
+ p_insn.tm = p_opcode;
+ p_insn.swap_operands = 1;
+ }
+ else
+ return 0;
+ }
+ *current_posn = save_char;
+ }
+ { /* Find operands */
+ int paren_not_balanced;
+ int expecting_operand = 0;
+ int found_separator = 0;
+ do
+ {
+ /* skip optional white space before operand */
+ while (!is_operand_char (*current_posn) && *current_posn != END_OF_INSN)
+ {
+ if (!is_space_char (*current_posn) && *current_posn != PARALLEL_SEPARATOR)
+ {
+ as_bad ("Invalid character %s before %s operand",
+ output_invalid (*current_posn),
+ ordinal_names[insn.operands]);
+ return 1;
+ }
+ if (*current_posn == PARALLEL_SEPARATOR)
+ found_separator = 1;
+ current_posn++;
+ }
+ token_start = current_posn; /* after white space */
+ paren_not_balanced = 0;
+ while (paren_not_balanced || *current_posn != ',')
+ {
+ if (*current_posn == END_OF_INSN)
+ {
+ if (paren_not_balanced)
+ {
+ as_bad ("Unbalanced parenthesis in %s operand.",
+ ordinal_names[insn.operands]);
+ return 1;
+ }
+ else
+ break; /* we are done */
+ }
+ else if (*current_posn == PARALLEL_SEPARATOR)
+ {
+ while (is_space_char (*(current_posn - 1)))
+ current_posn--;
+ break;
+ }
+ else if (!is_operand_char (*current_posn) && !is_space_char (*current_posn))
+ {
+ as_bad ("Invalid character %s in %s operand",
+ output_invalid (*current_posn),
+ ordinal_names[insn.operands]);
+ return 1;
+ }
+ if (*current_posn == '(')
+ ++paren_not_balanced;
+ if (*current_posn == ')')
+ --paren_not_balanced;
+ current_posn++;
+ }
+ if (current_posn != token_start)
+ { /* yes, we've read in another operand */
+ p_insn.operands[found_separator]++;
+ if (p_insn.operands[found_separator] > MAX_OPERANDS)
+ {
+ as_bad ("Spurious operands; (%d operands/instruction max)",
+ MAX_OPERANDS);
+ return 1;
+ }
+ /* now parse operand adding info to 'insn' as we go along */
+ save_char = *current_posn;
+ *current_posn = '\0';
+ p_insn.operand_type[found_separator][p_insn.operands[found_separator] - 1] =
+ tic30_operand (token_start);
+ *current_posn = save_char;
+ if (!p_insn.operand_type[found_separator][p_insn.operands[found_separator] - 1])
+ return 1;
+ }
+ else
+ {
+ if (expecting_operand)
+ {
+ as_bad ("Expecting operand after ','; got nothing");
+ return 1;
+ }
+ if (*current_posn == ',')
+ {
+ as_bad ("Expecting operand before ','; got nothing");
+ return 1;
+ }
+ }
+ /* now *current_posn must be either ',' or END_OF_INSN */
+ if (*current_posn == ',')
+ {
+ if (*++current_posn == END_OF_INSN)
+ { /* just skip it, if it's \n complain */
+ as_bad ("Expecting operand after ','; got nothing");
+ return 1;
+ }
+ expecting_operand = 1;
+ }
+ }
+ while (*current_posn != END_OF_INSN); /* until we get end of insn */
+ }
+ if (p_insn.swap_operands)
+ {
+ int temp_num, i;
+ operand *temp_op;
+
+ temp_num = p_insn.operands[0];
+ p_insn.operands[0] = p_insn.operands[1];
+ p_insn.operands[1] = temp_num;
+ for (i = 0; i < MAX_OPERANDS; i++)
+ {
+ temp_op = p_insn.operand_type[0][i];
+ p_insn.operand_type[0][i] = p_insn.operand_type[1][i];
+ p_insn.operand_type[1][i] = temp_op;
+ }
+ }
+ if (p_insn.operands[0] != p_insn.tm->operands_1)
+ {
+ as_bad ("incorrect number of operands given in the first instruction");
+ return 1;
+ }
+ if (p_insn.operands[1] != p_insn.tm->operands_2)
+ {
+ as_bad ("incorrect number of operands given in the second instruction");
+ return 1;
+ }
+ debug ("Number of operands in first insn: %d\n", p_insn.operands[0]);
+ debug ("Number of operands in second insn: %d\n", p_insn.operands[1]);
+ { /* Now check if operands are correct */
+ int count;
+ int num_rn = 0;
+ int num_ind = 0;
+ for (count = 0; count < 2; count++)
+ {
+ int i;
+ for (i = 0; i < p_insn.operands[count]; i++)
+ {
+ if ((p_insn.operand_type[count][i]->op_type &
+ p_insn.tm->operand_types[count][i]) == 0)
+ {
+ as_bad ("%s instruction, operand %d doesn't match", ordinal_names[count], i + 1);
+ return 1;
+ }
+ /* Get number of R register and indirect reference contained within the first
+ two operands of each instruction. This is required for the multiply
+ parallel instructions which require two R registers and two indirect
+ references, but not in any particular place. */
+ if ((p_insn.operand_type[count][i]->op_type & Rn) && i < 2)
+ num_rn++;
+ else if ((p_insn.operand_type[count][i]->op_type & Indirect) && i < 2)
+ num_ind++;
+ }
+ }
+ if ((p_insn.tm->operand_types[0][0] & (Indirect | Rn)) == (Indirect | Rn))
+ {
+ /* Check for the multiply instructions */
+ if (num_rn != 2)
+ {
+ as_bad ("incorrect format for multiply parallel instruction");
+ return 1;
+ }
+ if (num_ind != 2)
+ { /* Shouldn't get here */
+ as_bad ("incorrect format for multiply parallel instruction");
+ return 1;
+ }
+ if ((p_insn.operand_type[0][2]->reg.opcode != 0x00) &&
+ (p_insn.operand_type[0][2]->reg.opcode != 0x01))
+ {
+ as_bad ("destination for multiply can only be R0 or R1");
+ return 1;
+ }
+ if ((p_insn.operand_type[1][2]->reg.opcode != 0x02) &&
+ (p_insn.operand_type[1][2]->reg.opcode != 0x03))
+ {
+ as_bad ("destination for add/subtract can only be R2 or R3");
+ return 1;
+ }
+ /* Now determine the P field for the instruction */
+ if (p_insn.operand_type[0][0]->op_type & Indirect)
+ {
+ if (p_insn.operand_type[0][1]->op_type & Indirect)
+ p_insn.p_field = 0x00000000; /* Ind * Ind, Rn +/- Rn */
+ else if (p_insn.operand_type[1][0]->op_type & Indirect)
+ p_insn.p_field = 0x01000000; /* Ind * Rn, Ind +/- Rn */
+ else
+ p_insn.p_field = 0x03000000; /* Ind * Rn, Rn +/- Ind */
+ }
+ else
+ {
+ if (p_insn.operand_type[0][1]->op_type & Rn)
+ p_insn.p_field = 0x02000000; /* Rn * Rn, Ind +/- Ind */
+ else if (p_insn.operand_type[1][0]->op_type & Indirect)
+ {
+ operand *temp;
+ p_insn.p_field = 0x01000000; /* Rn * Ind, Ind +/- Rn */
+ /* Need to swap the two multiply operands around so that everything is in
+ its place for the opcode makeup ie so Ind * Rn, Ind +/- Rn */
+ temp = p_insn.operand_type[0][0];
+ p_insn.operand_type[0][0] = p_insn.operand_type[0][1];
+ p_insn.operand_type[0][1] = temp;
+ }
+ else
+ {
+ operand *temp;
+ p_insn.p_field = 0x03000000; /* Rn * Ind, Rn +/- Ind */
+ temp = p_insn.operand_type[0][0];
+ p_insn.operand_type[0][0] = p_insn.operand_type[0][1];
+ p_insn.operand_type[0][1] = temp;
+ }
+ }
+ }
+ }
+ debug ("P field: %08X\n", p_insn.p_field);
+ /* Finalise opcode. This is easier for parallel instructions as they have to be
+ fully resolved, there are no memory addresses allowed, except through indirect
+ addressing, so there are no labels to resolve. */
+ {
+ p_insn.opcode = p_insn.tm->base_opcode;
+ switch (p_insn.tm->oporder)
+ {
+ case OO_4op1:
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 3);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum << 8);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 11);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16);
+ p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 22);
+ break;
+ case OO_4op2:
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 3);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.ARnum << 8);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.mod << 11);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->reg.opcode << 19);
+ p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 22);
+ if (p_insn.operand_type[1][1]->reg.opcode == p_insn.operand_type[0][1]->reg.opcode)
+ as_warn ("loading the same register in parallel operation");
+ break;
+ case OO_4op3:
+ p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.ARnum);
+ p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.mod << 3);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum << 8);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 11);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->reg.opcode << 22);
+ break;
+ case OO_5op1:
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 3);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum << 8);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 11);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16);
+ p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 19);
+ p_insn.opcode |= (p_insn.operand_type[0][2]->reg.opcode << 22);
+ break;
+ case OO_5op2:
+ p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.ARnum);
+ p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.mod << 3);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum << 8);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 11);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->reg.opcode << 19);
+ p_insn.opcode |= (p_insn.operand_type[0][2]->reg.opcode << 22);
+ break;
+ case OO_PField:
+ p_insn.opcode |= p_insn.p_field;
+ if (p_insn.operand_type[0][2]->reg.opcode == 0x01)
+ p_insn.opcode |= 0x00800000;
+ if (p_insn.operand_type[1][2]->reg.opcode == 0x03)
+ p_insn.opcode |= 0x00400000;
+ switch (p_insn.p_field)
+ {
+ case 0x00000000:
+ p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.ARnum);
+ p_insn.opcode |= (p_insn.operand_type[0][1]->indirect.mod << 3);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum << 8);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 11);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->reg.opcode << 16);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 19);
+ break;
+ case 0x01000000:
+ p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.ARnum);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.mod << 3);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum << 8);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 11);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->reg.opcode << 16);
+ p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 19);
+ break;
+ case 0x02000000:
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 3);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.ARnum << 8);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->indirect.mod << 11);
+ p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 16);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->reg.opcode << 19);
+ break;
+ case 0x03000000:
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.ARnum);
+ p_insn.opcode |= (p_insn.operand_type[1][1]->indirect.mod << 3);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.ARnum << 8);
+ p_insn.opcode |= (p_insn.operand_type[0][0]->indirect.mod << 11);
+ p_insn.opcode |= (p_insn.operand_type[1][0]->reg.opcode << 16);
+ p_insn.opcode |= (p_insn.operand_type[0][1]->reg.opcode << 19);
+ break;
+ }
+ break;
+ }
+ } /* Opcode is finalised at this point for all parallel instructions. */
+ { /* Output opcode */
+ char *p;
+ p = frag_more (INSN_SIZE);
+ md_number_to_chars (p, (valueT) p_insn.opcode, INSN_SIZE);
+ }
+ {
+ int i, j;
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < p_insn.operands[i]; j++)
+ free (p_insn.operand_type[i][j]);
+ }
+ debug ("Final opcode: %08X\n", p_insn.opcode);
+ debug ("\n");
+ return 1;
+}
+
+operand *
+tic30_operand (token)
+ char *token;
+{
+ int count;
+ char ind_buffer[strlen (token)];
+ operand *current_op;
+
+ debug ("In tic30_operand with %s\n", token);
+ current_op = (operand *) malloc (sizeof (operand));
+ memset (current_op, '\0', sizeof (operand));
+ if (*token == DIRECT_REFERENCE)
+ {
+ char *token_posn = token + 1;
+ int direct_label = 0;
+ debug ("Found direct reference\n");
+ while (*token_posn)
+ {
+ if (!is_digit_char (*token_posn))
+ direct_label = 1;
+ token_posn++;
+ }
+ if (direct_label)
+ {
+ char *save_input_line_pointer;
+ segT retval;
+ debug ("Direct reference is a label\n");
+ current_op->direct.label = token + 1;
+ save_input_line_pointer = input_line_pointer;
+ input_line_pointer = token + 1;
+ debug ("Current input_line_pointer: %s\n", input_line_pointer);
+ retval = expression (&current_op->direct.direct_expr);
+ debug ("Expression type: %d\n", current_op->direct.direct_expr.X_op);
+ debug ("Expression addnum: %d\n", current_op->direct.direct_expr.X_add_number);
+ debug ("Segment: %d\n", retval);
+ input_line_pointer = save_input_line_pointer;
+ if (current_op->direct.direct_expr.X_op == O_constant)
+ {
+ current_op->direct.address = current_op->direct.direct_expr.X_add_number;
+ current_op->direct.resolved = 1;
+ }
+ }
+ else
+ {
+ debug ("Direct reference is a number\n");
+ current_op->direct.address = atoi (token + 1);
+ current_op->direct.resolved = 1;
+ }
+ current_op->op_type = Direct;
+ }
+ else if (*token == INDIRECT_REFERENCE)
+ { /* Indirect reference operand */
+ int found_ar = 0;
+ int found_disp = 0;
+ int ar_number = -1;
+ int disp_number = 0;
+ int buffer_posn = 1;
+ ind_addr_type *ind_addr_op;
+ debug ("Found indirect reference\n");
+ ind_buffer[0] = *token;
+ for (count = 1; count < strlen (token); count++)
+ { /* Strip operand */
+ ind_buffer[buffer_posn] = tolower (*(token + count));
+ if ((*(token + count - 1) == 'a' || *(token + count - 1) == 'A') &&
+ (*(token + count) == 'r' || *(token + count) == 'R'))
+ {
+ /* AR reference is found, so get its number and remove it from the buffer
+ so it can pass through hash_find() */
+ if (found_ar)
+ {
+ as_bad ("More than one AR register found in indirect reference");
+ return NULL;
+ }
+ if (*(token + count + 1) < '0' || *(token + count + 1) > '7')
+ {
+ as_bad ("Illegal AR register in indirect reference");
+ return NULL;
+ }
+ ar_number = *(token + count + 1) - '0';
+ found_ar = 1;
+ count++;
+ }
+ if (*(token + count) == '(')
+ {
+ /* Parenthesis found, so check if a displacement value is inside. If so, get
+ the value and remove it from the buffer. */
+ if (is_digit_char (*(token + count + 1)))
+ {
+ char disp[10];
+ int disp_posn = 0;
+
+ if (found_disp)
+ {
+ as_bad ("More than one displacement found in indirect reference");
+ return NULL;
+ }
+ count++;
+ while (*(token + count) != ')')
+ {
+ if (!is_digit_char (*(token + count)))
+ {
+ as_bad ("Invalid displacement in indirect reference");
+ return NULL;
+ }
+ disp[disp_posn++] = *(token + (count++));
+ }
+ disp[disp_posn] = '\0';
+ disp_number = atoi (disp);
+ count--;
+ found_disp = 1;
+ }
+ }
+ buffer_posn++;
+ }
+ ind_buffer[buffer_posn] = '\0';
+ if (!found_ar)
+ {
+ as_bad ("AR register not found in indirect reference");
+ return NULL;
+ }
+ ind_addr_op = (ind_addr_type *) hash_find (ind_hash, ind_buffer);
+ if (ind_addr_op)
+ {
+ debug ("Found indirect reference: %s\n", ind_addr_op->syntax);
+ if (ind_addr_op->displacement == IMPLIED_DISP)
+ {
+ found_disp = 1;
+ disp_number = 1;
+ }
+ else if ((ind_addr_op->displacement == DISP_REQUIRED) && !found_disp)
+ {
+ /* Maybe an implied displacement of 1 again */
+ as_bad ("required displacement wasn't given in indirect reference");
+ return 0;
+ }
+ }
+ else
+ {
+ as_bad ("illegal indirect reference");
+ return NULL;
+ }
+ if (found_disp && (disp_number < 0 || disp_number > 255))
+ {
+ as_bad ("displacement must be an unsigned 8-bit number");
+ return NULL;
+ }
+ current_op->indirect.mod = ind_addr_op->modfield;
+ current_op->indirect.disp = disp_number;
+ current_op->indirect.ARnum = ar_number;
+ current_op->op_type = Indirect;
+ }
+ else
+ {
+ reg *regop = (reg *) hash_find (reg_hash, token);
+ if (regop)
+ {
+ debug ("Found register operand: %s\n", regop->name);
+ if (regop->regtype == REG_ARn)
+ current_op->op_type = ARn;
+ else if (regop->regtype == REG_Rn)
+ current_op->op_type = Rn;
+ else if (regop->regtype == REG_DP)
+ current_op->op_type = DPReg;
+ else
+ current_op->op_type = OtherReg;
+ current_op->reg.opcode = regop->opcode;
+ }
+ else
+ {
+ if (!is_digit_char (*token) || *(token + 1) == 'x' || strchr (token, 'h'))
+ {
+ char *save_input_line_pointer;
+ segT retval;
+ debug ("Probably a label: %s\n", token);
+ current_op->immediate.label = (char *) malloc (strlen (token) + 1);
+ strcpy (current_op->immediate.label, token);
+ current_op->immediate.label[strlen (token)] = '\0';
+ save_input_line_pointer = input_line_pointer;
+ input_line_pointer = token;
+ debug ("Current input_line_pointer: %s\n", input_line_pointer);
+ retval = expression (&current_op->immediate.imm_expr);
+ debug ("Expression type: %d\n", current_op->immediate.imm_expr.X_op);
+ debug ("Expression addnum: %d\n", current_op->immediate.imm_expr.X_add_number);
+ debug ("Segment: %d\n", retval);
+ input_line_pointer = save_input_line_pointer;
+ if (current_op->immediate.imm_expr.X_op == O_constant)
+ {
+ current_op->immediate.s_number = current_op->immediate.imm_expr.X_add_number;
+ current_op->immediate.u_number = (unsigned int) current_op->immediate.imm_expr.X_add_number;
+ current_op->immediate.resolved = 1;
+ }
+ }
+ else
+ {
+ unsigned count;
+ debug ("Found a number or displacement\n");
+ for (count = 0; count < strlen (token); count++)
+ if (*(token + count) == '.')
+ current_op->immediate.decimal_found = 1;
+ current_op->immediate.label = (char *) malloc (strlen (token) + 1);
+ strcpy (current_op->immediate.label, token);
+ current_op->immediate.label[strlen (token)] = '\0';
+ current_op->immediate.f_number = (float) atof (token);
+ current_op->immediate.s_number = (int) atoi (token);
+ current_op->immediate.u_number = (unsigned int) atoi (token);
+ current_op->immediate.resolved = 1;
+ }
+ current_op->op_type = Disp | Abs24 | Imm16 | Imm24;
+ if (current_op->immediate.u_number >= 0 && current_op->immediate.u_number <= 31)
+ current_op->op_type |= IVector;
+ }
+ }
+ return current_op;
+}
+
+/* next_line points to the next line after the current instruction (current_line).
+ Search for the parallel bars, and if found, merge two lines into internal syntax
+ for a parallel instruction:
+ q_[INSN1]_[INSN2] [OPERANDS1] | [OPERANDS2]
+ By this stage, all comments are scrubbed, and only the bare lines are given.
+ */
+
+#define NONE 0
+#define START_OPCODE 1
+#define END_OPCODE 2
+#define START_OPERANDS 3
+#define END_OPERANDS 4
+
+char *
+tic30_find_parallel_insn (current_line, next_line)
+ char *current_line;
+ char *next_line;
+{
+ int found_parallel = 0;
+ char first_opcode[256];
+ char second_opcode[256];
+ char first_operands[256];
+ char second_operands[256];
+ char *parallel_insn;
+
+ debug ("In tic30_find_parallel_insn()\n");
+ while (!is_end_of_line[(int) *next_line])
+ {
+ if (*next_line == PARALLEL_SEPARATOR && *(next_line + 1) == PARALLEL_SEPARATOR)
+ {
+ found_parallel = 1;
+ next_line++;
+ break;
+ }
+ next_line++;
+ }
+ if (!found_parallel)
+ return NULL;
+ debug ("Found a parallel instruction\n");
+ {
+ int i;
+ char *opcode, *operands, *line;
+
+ for (i = 0; i < 2; i++)
+ {
+ if (i == 0)
+ {
+ opcode = &first_opcode[0];
+ operands = &first_operands[0];
+ line = current_line;
+ }
+ else
+ {
+ opcode = &second_opcode[0];
+ operands = &second_operands[0];
+ line = next_line;
+ }
+ {
+ int search_status = NONE;
+ int char_ptr = 0;
+ char c;
+
+ while (!is_end_of_line[(int) (c = *line)] && *line)
+ {
+ if (is_opcode_char (c) && search_status == NONE)
+ {
+ opcode[char_ptr++] = tolower (c);
+ search_status = START_OPCODE;
+ }
+ else if (is_opcode_char (c) && search_status == START_OPCODE)
+ {
+ opcode[char_ptr++] = tolower (c);
+ }
+ else if (!is_opcode_char (c) && search_status == START_OPCODE)
+ {
+ opcode[char_ptr] = '\0';
+ char_ptr = 0;
+ search_status = END_OPCODE;
+ }
+ else if (is_operand_char (c) && search_status == START_OPERANDS)
+ {
+ operands[char_ptr++] = c;
+ }
+ if (is_operand_char (c) && search_status == END_OPCODE)
+ {
+ operands[char_ptr++] = c;
+ search_status = START_OPERANDS;
+ }
+ line++;
+ }
+ if (search_status != START_OPERANDS)
+ return NULL;
+ operands[char_ptr] = '\0';
+ }
+ }
+ }
+ parallel_insn = (char *) malloc (strlen (first_opcode) + strlen (first_operands) +
+ strlen (second_opcode) + strlen (second_operands) + 8);
+ sprintf (parallel_insn, "q_%s_%s %s | %s", first_opcode, second_opcode, first_operands, second_operands);
+ debug ("parallel insn = %s\n", parallel_insn);
+ return parallel_insn;
+}
+
+#undef NONE
+#undef START_OPCODE
+#undef END_OPCODE
+#undef START_OPERANDS
+#undef END_OPERANDS
+
+/* In order to get gas to ignore any | chars at the start of a line,
+ this function returns true if a | is found in a line. */
+
+int
+tic30_unrecognized_line (c)
+ int c;
+{
+ debug ("In tc_unrecognized_line\n");
+ return (c == PARALLEL_SEPARATOR);
+}
+
+int
+md_estimate_size_before_relax (fragP, segment)
+ fragS *fragP;
+ segT segment;
+{
+ debug ("In md_estimate_size_before_relax()\n");
+ return 0;
+}
+
+void
+md_convert_frag (abfd, sec, fragP)
+ bfd *abfd;
+ segT sec;
+ register fragS *fragP;
+{
+ debug ("In md_convert_frag()\n");
+}
+
+void
+md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol)
+ char *ptr;
+ addressT from_addr, to_addr;
+ fragS *frag;
+ symbolS *to_symbol;
+{
+ debug ("In md_create_short_jump()\n");
+}
+
+void
+md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol)
+ char *ptr;
+ addressT from_addr, to_addr;
+ fragS *frag;
+ symbolS *to_symbol;
+{
+ debug ("In md_create_long_jump()\n");
+}
+
+int
+md_apply_fix (fixP, valP)
+ fixS *fixP;
+ valueT *valP;
+{
+ valueT value = *valP;
+
+ debug ("In md_apply_fix() with value = %ld\n", (long) value);
+ debug ("Values in fixP\n");
+ debug ("fx_size = %d\n", fixP->fx_size);
+ debug ("fx_pcrel = %d\n", fixP->fx_pcrel);
+ debug ("fx_where = %d\n", fixP->fx_where);
+ debug ("fx_offset = %d\n", (int) fixP->fx_offset);
+ {
+ char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
+ value /= INSN_SIZE;
+ if (fixP->fx_size == 1)
+ { /* Special fix for LDP instruction. */
+ value = (value & 0x00FF0000) >> 16;
+ }
+ debug ("new value = %ld\n", (long) value);
+ md_number_to_chars (buf, value, fixP->fx_size);
+ }
+ return 1;
+}
+
+int
+md_parse_option (c, arg)
+ int c;
+ char *arg;
+{
+ int i;
+
+ debug ("In md_parse_option()\n");
+ for (i = 0; i < c; i++)
+ {
+ printf ("%c\n", arg[c]);
+ }
+ return 0;
+}
+
+void
+md_show_usage (stream)
+ FILE *stream;
+{
+ debug ("In md_show_usage()\n");
+}
+
+symbolS *
+md_undefined_symbol (name)
+ char *name;
+{
+ debug ("In md_undefined_symbol()\n");
+ return (symbolS *) 0;
+}
+
+valueT
+md_section_align (segment, size)
+ segT segment;
+ valueT size;
+{
+ debug ("In md_section_align() segment = %d and size = %d\n", segment, size);
+ size = (size + 3) / 4;
+ size *= 4;
+ debug ("New size value = %d\n", size);
+ return size;
+}
+
+long
+md_pcrel_from (fixP)
+ fixS *fixP;
+{
+ int offset;
+
+ debug ("In md_pcrel_from()\n");
+ debug ("fx_where = %d\n", fixP->fx_where);
+ debug ("fx_size = %d\n", fixP->fx_size);
+ /* Find the opcode that represents the current instruction in the fr_literal
+ storage area, and check bit 21. Bit 21 contains whether the current instruction
+ is a delayed one or not, and then set the offset value appropriately. */
+ if (fixP->fx_frag->fr_literal[fixP->fx_where - fixP->fx_size + 1] & 0x20)
+ offset = 3;
+ else
+ offset = 1;
+ debug ("offset = %d\n", offset);
+ /* PC Relative instructions have a format:
+ displacement = Label - (PC + offset)
+ This function returns PC + offset where:
+ fx_where - fx_size = PC
+ INSN_SIZE * offset = offset number of instructions
+ */
+ return fixP->fx_where - fixP->fx_size + (INSN_SIZE * offset);
+}
+
+char *
+md_atof (what_statement_type, literalP, sizeP)
+ int what_statement_type;
+ char *literalP;
+ int *sizeP;
+{
+ int prec;
+ char *token;
+ char keepval;
+ unsigned long value;
+ /* char *atof_ieee (); */
+ float float_value;
+ debug ("In md_atof()\n");
+ debug ("precision = %c\n", what_statement_type);
+ debug ("literal = %s\n", literalP);
+ debug ("line = ");
+ token = input_line_pointer;
+ while (!is_end_of_line[(unsigned) *input_line_pointer] && (*input_line_pointer) && (*input_line_pointer != ','))
+ {
+ debug ("%c", *input_line_pointer);
+ input_line_pointer++;
+ }
+ keepval = *input_line_pointer;
+ *input_line_pointer = '\0';
+ debug ("\n");
+ float_value = (float) atof (token);
+ *input_line_pointer = keepval;
+ debug ("float_value = %f\n", float_value);
+ switch (what_statement_type)
+ {
+ case 'f':
+ case 'F':
+ case 's':
+ case 'S':
+ prec = 2;
+ break;
+
+ case 'd':
+ case 'D':
+ case 'r':
+ case 'R':
+ prec = 4;
+ break;
+
+ default:
+ *sizeP = 0;
+ return "Bad call to MD_ATOF()";
+ }
+ if (float_value == 0.0)
+ {
+ value = (prec == 2) ? 0x00008000L : 0x80000000L;
+ }
+ else
+ {
+ unsigned long exp, sign, mant, tmsfloat;
+ tmsfloat = *((long *) &float_value);
+ sign = tmsfloat & 0x80000000;
+ mant = tmsfloat & 0x007FFFFF;
+ exp = tmsfloat & 0x7F800000;
+ exp <<= 1;
+ if (exp == 0xFF000000)
+ {
+ if (mant == 0)
+ value = 0x7F7FFFFF;
+ else if (sign == 0)
+ value = 0x7F7FFFFF;
+ else
+ value = 0x7F800000;
+ }
+ else
+ {
+ exp -= 0x7F000000;
+ if (sign)
+ {
+ mant = mant & 0x007FFFFF;
+ mant = -mant;
+ mant = mant & 0x00FFFFFF;
+ if (mant == 0)
+ {
+ mant |= 0x00800000;
+ exp = (long) exp - 0x01000000;
+ }
+ }
+ tmsfloat = exp | mant;
+ value = tmsfloat;
+ }
+ if (prec == 2)
+ {
+ long exp, mant;
+
+ if (tmsfloat == 0x80000000)
+ {
+ value = 0x8000;
+ }
+ else
+ {
+ value = 0;
+ exp = (tmsfloat & 0xFF000000);
+ exp >>= 24;
+ mant = tmsfloat & 0x007FFFFF;
+ if (tmsfloat & 0x00800000)
+ {
+ mant |= 0xFF000000;
+ mant += 0x00000800;
+ mant >>= 12;
+ mant |= 0x00000800;
+ mant &= 0x0FFF;
+ if (exp > 7)
+ value = 0x7800;
+ }
+ else
+ {
+ mant |= 0x00800000;
+ mant += 0x00000800;
+ exp += (mant >> 24);
+ mant >>= 12;
+ mant &= 0x07FF;
+ if (exp > 7)
+ value = 0x77FF;
+ }
+ if (exp < -8)
+ value = 0x8000;
+ if (value == 0)
+ {
+ mant = (exp << 12) | mant;
+ value = mant & 0xFFFF;
+ }
+ }
+ }
+ }
+ md_number_to_chars (literalP, value, prec);
+ *sizeP = prec;
+ return 0;
+}
+
+void
+md_number_to_chars (buf, val, n)
+ char *buf;
+ valueT val;
+ int n;
+{
+ debug ("In md_number_to_chars()\n");
+ number_to_chars_bigendian (buf, val, n);
+ /* number_to_chars_littleendian(buf,val,n); */
+}
+
+#define F(SZ,PCREL) (((SZ) << 1) + (PCREL))
+#define MAP(SZ,PCREL,TYPE) case F(SZ,PCREL): code = (TYPE); break
+
+arelent *
+tc_gen_reloc (section, fixP)
+ asection *section;
+ fixS *fixP;
+{
+ arelent *rel;
+ bfd_reloc_code_real_type code = 0;
+
+ debug ("In tc_gen_reloc()\n");
+ debug ("fixP.size = %d\n", fixP->fx_size);
+ debug ("fixP.pcrel = %d\n", fixP->fx_pcrel);
+ debug ("addsy.name = %s\n", S_GET_NAME (fixP->fx_addsy));
+ switch (F (fixP->fx_size, fixP->fx_pcrel))
+ {
+ MAP (1, 0, BFD_RELOC_TIC30_LDP);
+ MAP (2, 0, BFD_RELOC_16);
+ MAP (3, 0, BFD_RELOC_24);
+ MAP (2, 1, BFD_RELOC_16_PCREL);
+ MAP (4, 0, BFD_RELOC_32);
+ default:
+ as_bad ("Can not do %d byte %srelocation", fixP->fx_size,
+ fixP->fx_pcrel ? "pc-relative " : "");
+ }
+#undef MAP
+#undef F
+
+ rel = (arelent *) xmalloc (sizeof (arelent));
+ assert (rel != 0);
+ rel->sym_ptr_ptr = &fixP->fx_addsy->bsym;
+ rel->address = fixP->fx_frag->fr_address + fixP->fx_where;
+ if (fixP->fx_pcrel)
+ rel->addend = fixP->fx_addnumber;
+ else
+ rel->addend = 0;
+ rel->howto = bfd_reloc_type_lookup (stdoutput, code);
+ if (!rel->howto)
+ {
+ const char *name;
+ name = S_GET_NAME (fixP->fx_addsy);
+ if (name == NULL)
+ name = "<unknown>";
+ as_fatal ("Cannot generate relocation type for symbol %s, code %s", name, bfd_get_reloc_code_name (code));
+ }
+ return rel;
+}
+
+void
+tc_aout_pre_write_hook ()
+{
+ debug ("In tc_aout_pre_write_hook()\n");
+}
+
+void
+md_operand (expressionP)
+ expressionS *expressionP;
+{
+ debug ("In md_operand()\n");
+}
+
+char output_invalid_buf[8];
+
+char *
+output_invalid (c)
+ char c;
+{
+ if (isprint (c))
+ sprintf (output_invalid_buf, "'%c'", c);
+ else
+ sprintf (output_invalid_buf, "(0x%x)", (unsigned) c);
+ return output_invalid_buf;
+}
diff --git a/contrib/binutils/gas/config/tc-tic30.h b/contrib/binutils/gas/config/tc-tic30.h
new file mode 100644
index 0000000..2fb9cb6
--- /dev/null
+++ b/contrib/binutils/gas/config/tc-tic30.h
@@ -0,0 +1,53 @@
+/* tc-tic30.h -- Header file for tc-tic30.c
+ Copyright (C) 1998 Free Software Foundation.
+ Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GAS is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#ifndef _TC_TIC30_H_
+#define _TC_TIC30_H_
+
+#define TC_TIC30 1
+
+#ifdef OBJ_AOUT
+#define TARGET_FORMAT "a.out-tic30"
+#endif
+
+#define TARGET_ARCH bfd_arch_tic30
+#define TARGET_BYTES_BIG_ENDIAN 1
+
+char *output_invalid PARAMS ((int c));
+
+#define END_OF_INSN '\0'
+#define MAX_OPERANDS 6
+#define DIRECT_REFERENCE '@'
+#define INDIRECT_REFERENCE '*'
+#define PARALLEL_SEPARATOR '|'
+#define INSN_SIZE 4
+
+/* Define this to 1 if you want the debug output to be on stdout,
+ otherwise stderr will be used. If stderr is used, there will be a
+ better synchronisation with the as_bad outputs, but you can't
+ capture the output. */
+#define USE_STDOUT 0
+
+#define tc_unrecognized_line tic30_unrecognized_line
+
+extern int tic30_unrecognized_line PARAMS ((int));
+
+#endif
diff --git a/contrib/binutils/gas/config/tc-v850.c b/contrib/binutils/gas/config/tc-v850.c
new file mode 100644
index 0000000..18ec114
--- /dev/null
+++ b/contrib/binutils/gas/config/tc-v850.c
@@ -0,0 +1,1902 @@
+/* tc-v850.c -- Assembler code for the NEC V850
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GAS is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <stdio.h>
+#include <ctype.h>
+#include "as.h"
+#include "subsegs.h"
+#include "opcode/v850.h"
+
+#define AREA_ZDA 0
+#define AREA_SDA 1
+#define AREA_TDA 2
+
+/* sign-extend a 16-bit number */
+#define SEXT16(x) ((((x) & 0xffff) ^ (~ 0x7fff)) + 0x8000)
+
+/* Temporarily holds the reloc in a cons expression. */
+static bfd_reloc_code_real_type hold_cons_reloc;
+
+/* Set to TRUE if we want to be pedantic about signed overflows. */
+static boolean warn_signed_overflows = FALSE;
+static boolean warn_unsigned_overflows = FALSE;
+
+/* Indicates the target BFD machine number. */
+static int machine = -1;
+
+/* Indicates the target processor(s) for the assemble. */
+static unsigned int processor_mask = -1;
+
+
+/* Structure to hold information about predefined registers. */
+struct reg_name
+{
+ const char * name;
+ int value;
+};
+
+/* Generic assembler global variables which must be defined by all targets. */
+
+/* Characters which always start a comment. */
+const char comment_chars[] = "#";
+
+/* Characters which start a comment at the beginning of a line. */
+const char line_comment_chars[] = ";#";
+
+/* Characters which may be used to separate multiple commands on a
+ single line. */
+const char line_separator_chars[] = ";";
+
+/* Characters which are used to indicate an exponent in a floating
+ point number. */
+const char EXP_CHARS[] = "eE";
+
+/* Characters which mean that a number is a floating point constant,
+ as in 0d1.0. */
+const char FLT_CHARS[] = "dD";
+
+
+const relax_typeS md_relax_table[] =
+{
+ /* Conditional branches. */
+ {0xff, -0x100, 2, 1},
+ {0x1fffff, -0x200000, 6, 0},
+ /* Unconditional branches. */
+ {0xff, -0x100, 2, 3},
+ {0x1fffff, -0x200000, 4, 0},
+};
+
+
+static segT sdata_section = NULL;
+static segT tdata_section = NULL;
+static segT zdata_section = NULL;
+static segT sbss_section = NULL;
+static segT tbss_section = NULL;
+static segT zbss_section = NULL;
+static segT rosdata_section = NULL;
+static segT rozdata_section = NULL;
+static segT scommon_section = NULL;
+static segT tcommon_section = NULL;
+static segT zcommon_section = NULL;
+
+/* fixups */
+#define MAX_INSN_FIXUPS (5)
+struct v850_fixup
+{
+ expressionS exp;
+ int opindex;
+ bfd_reloc_code_real_type reloc;
+};
+
+struct v850_fixup fixups [MAX_INSN_FIXUPS];
+static int fc;
+
+
+void
+v850_sdata (int ignore)
+{
+ obj_elf_section_change_hook();
+
+ subseg_set (sdata_section, (subsegT) get_absolute_expression ());
+
+ demand_empty_rest_of_line ();
+}
+
+void
+v850_tdata (int ignore)
+{
+ obj_elf_section_change_hook();
+
+ subseg_set (tdata_section, (subsegT) get_absolute_expression ());
+
+ demand_empty_rest_of_line ();
+}
+
+void
+v850_zdata (int ignore)
+{
+ obj_elf_section_change_hook();
+
+ subseg_set (zdata_section, (subsegT) get_absolute_expression ());
+
+ demand_empty_rest_of_line ();
+}
+
+void
+v850_sbss (int ignore)
+{
+ obj_elf_section_change_hook();
+
+ subseg_set (sbss_section, (subsegT) get_absolute_expression ());
+
+ demand_empty_rest_of_line ();
+}
+
+void
+v850_tbss (int ignore)
+{
+ obj_elf_section_change_hook();
+
+ subseg_set (tbss_section, (subsegT) get_absolute_expression ());
+
+ demand_empty_rest_of_line ();
+}
+
+void
+v850_zbss (int ignore)
+{
+ obj_elf_section_change_hook();
+
+ subseg_set (zbss_section, (subsegT) get_absolute_expression ());
+
+ demand_empty_rest_of_line ();
+}
+
+void
+v850_rosdata (int ignore)
+{
+ obj_elf_section_change_hook();
+
+ subseg_set (rosdata_section, (subsegT) get_absolute_expression ());
+
+ demand_empty_rest_of_line ();
+}
+
+void
+v850_rozdata (int ignore)
+{
+ obj_elf_section_change_hook();
+
+ subseg_set (rozdata_section, (subsegT) get_absolute_expression ());
+
+ demand_empty_rest_of_line ();
+}
+
+
+void
+v850_bss (int ignore)
+{
+ register int temp = get_absolute_expression ();
+
+ obj_elf_section_change_hook();
+
+ subseg_set (bss_section, (subsegT) temp);
+
+ demand_empty_rest_of_line ();
+}
+
+void
+v850_offset (int ignore)
+{
+ int temp = get_absolute_expression ();
+
+ temp -= frag_now_fix();
+
+ if (temp > 0)
+ (void) frag_more (temp);
+
+ demand_empty_rest_of_line ();
+}
+
+/* Copied from obj_elf_common() in gas/config/obj-elf.c */
+static void
+v850_comm (area)
+ int area;
+{
+ char * name;
+ char c;
+ char * p;
+ int temp;
+ int size;
+ symbolS * symbolP;
+ int have_align;
+
+ name = input_line_pointer;
+ c = get_symbol_end ();
+ /* just after name is now '\0' */
+ p = input_line_pointer;
+ *p = c;
+ SKIP_WHITESPACE ();
+ if (*input_line_pointer != ',')
+ {
+ as_bad ("Expected comma after symbol-name");
+ ignore_rest_of_line ();
+ return;
+ }
+ input_line_pointer++; /* skip ',' */
+ if ((temp = get_absolute_expression ()) < 0)
+ {
+ as_bad (".COMMon length (%d.) <0! Ignored.", temp);
+ ignore_rest_of_line ();
+ return;
+ }
+ size = temp;
+ *p = 0;
+ symbolP = symbol_find_or_make (name);
+ *p = c;
+ if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP))
+ {
+ as_bad ("Ignoring attempt to re-define symbol");
+ ignore_rest_of_line ();
+ return;
+ }
+ if (S_GET_VALUE (symbolP) != 0)
+ {
+ if (S_GET_VALUE (symbolP) != size)
+ {
+ as_warn ("Length of .comm \"%s\" is already %ld. Not changed to %d.",
+ S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
+ }
+ }
+ know (symbolP->sy_frag == &zero_address_frag);
+ if (*input_line_pointer != ',')
+ have_align = 0;
+ else
+ {
+ have_align = 1;
+ input_line_pointer++;
+ SKIP_WHITESPACE ();
+ }
+ if (! have_align || *input_line_pointer != '"')
+ {
+ if (! have_align)
+ temp = 0;
+ else
+ {
+ temp = get_absolute_expression ();
+ if (temp < 0)
+ {
+ temp = 0;
+ as_warn ("Common alignment negative; 0 assumed");
+ }
+ }
+ if (symbolP->local)
+ {
+ segT old_sec;
+ int old_subsec;
+ char * pfrag;
+ int align;
+
+ /* allocate_bss: */
+ old_sec = now_seg;
+ old_subsec = now_subseg;
+ if (temp)
+ {
+ /* convert to a power of 2 alignment */
+ for (align = 0; (temp & 1) == 0; temp >>= 1, ++align);
+ if (temp != 1)
+ {
+ as_bad ("Common alignment not a power of 2");
+ ignore_rest_of_line ();
+ return;
+ }
+ }
+ else
+ align = 0;
+ switch (area)
+ {
+ case AREA_SDA:
+ record_alignment (sbss_section, align);
+ obj_elf_section_change_hook();
+ subseg_set (sbss_section, 0);
+ break;
+
+ case AREA_ZDA:
+ record_alignment (zbss_section, align);
+ obj_elf_section_change_hook();
+ subseg_set (zbss_section, 0);
+ break;
+
+ case AREA_TDA:
+ record_alignment (tbss_section, align);
+ obj_elf_section_change_hook();
+ subseg_set (tbss_section, 0);
+ break;
+
+ default:
+ abort();
+ }
+
+ if (align)
+ frag_align (align, 0, 0);
+
+ switch (area)
+ {
+ case AREA_SDA:
+ if (S_GET_SEGMENT (symbolP) == sbss_section)
+ symbolP->sy_frag->fr_symbol = 0;
+ break;
+
+ case AREA_ZDA:
+ if (S_GET_SEGMENT (symbolP) == zbss_section)
+ symbolP->sy_frag->fr_symbol = 0;
+ break;
+
+ case AREA_TDA:
+ if (S_GET_SEGMENT (symbolP) == tbss_section)
+ symbolP->sy_frag->fr_symbol = 0;
+ break;
+
+ default:
+ abort();
+ }
+
+ symbolP->sy_frag = frag_now;
+ pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP,
+ (offsetT) size, (char *) 0);
+ *pfrag = 0;
+ S_SET_SIZE (symbolP, size);
+
+ switch (area)
+ {
+ case AREA_SDA: S_SET_SEGMENT (symbolP, sbss_section); break;
+ case AREA_ZDA: S_SET_SEGMENT (symbolP, zbss_section); break;
+ case AREA_TDA: S_SET_SEGMENT (symbolP, tbss_section); break;
+ default:
+ abort();
+ }
+
+ S_CLEAR_EXTERNAL (symbolP);
+ obj_elf_section_change_hook();
+ subseg_set (old_sec, old_subsec);
+ }
+ else
+ {
+ allocate_common:
+ S_SET_VALUE (symbolP, (valueT) size);
+ S_SET_ALIGN (symbolP, temp);
+ S_SET_EXTERNAL (symbolP);
+
+ switch (area)
+ {
+ case AREA_SDA: S_SET_SEGMENT (symbolP, scommon_section); break;
+ case AREA_ZDA: S_SET_SEGMENT (symbolP, zcommon_section); break;
+ case AREA_TDA: S_SET_SEGMENT (symbolP, tcommon_section); break;
+ default:
+ abort();
+ }
+ }
+ }
+ else
+ {
+ input_line_pointer++;
+ /* @@ Some use the dot, some don't. Can we get some consistency?? */
+ if (*input_line_pointer == '.')
+ input_line_pointer++;
+ /* @@ Some say data, some say bss. */
+ if (strncmp (input_line_pointer, "bss\"", 4)
+ && strncmp (input_line_pointer, "data\"", 5))
+ {
+ while (*--input_line_pointer != '"')
+ ;
+ input_line_pointer--;
+ goto bad_common_segment;
+ }
+ while (*input_line_pointer++ != '"')
+ ;
+ goto allocate_common;
+ }
+
+ symbolP->bsym->flags |= BSF_OBJECT;
+
+ demand_empty_rest_of_line ();
+ return;
+
+ {
+ bad_common_segment:
+ p = input_line_pointer;
+ while (*p && *p != '\n')
+ p++;
+ c = *p;
+ *p = '\0';
+ as_bad ("bad .common segment %s", input_line_pointer + 1);
+ *p = c;
+ input_line_pointer = p;
+ ignore_rest_of_line ();
+ return;
+ }
+}
+
+void
+set_machine (int number)
+{
+ machine = number;
+ bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine);
+
+ switch (machine)
+ {
+ case 0: processor_mask = PROCESSOR_V850; break;
+ }
+}
+
+/* The target specific pseudo-ops which we support. */
+const pseudo_typeS md_pseudo_table[] =
+{
+ {"sdata", v850_sdata, 0},
+ {"tdata", v850_tdata, 0},
+ {"zdata", v850_zdata, 0},
+ {"sbss", v850_sbss, 0},
+ {"tbss", v850_tbss, 0},
+ {"zbss", v850_zbss, 0},
+ {"rosdata", v850_rosdata, 0},
+ {"rozdata", v850_rozdata, 0},
+ {"bss", v850_bss, 0},
+ {"offset", v850_offset, 0},
+ {"word", cons, 4},
+ {"zcomm", v850_comm, AREA_ZDA},
+ {"scomm", v850_comm, AREA_SDA},
+ {"tcomm", v850_comm, AREA_TDA},
+ {"v850", set_machine, 0},
+ { NULL, NULL, 0}
+};
+
+/* Opcode hash table. */
+static struct hash_control *v850_hash;
+
+/* This table is sorted. Suitable for searching by a binary search. */
+static const struct reg_name pre_defined_registers[] =
+{
+ { "ep", 30 }, /* ep - element ptr */
+ { "gp", 4 }, /* gp - global ptr */
+ { "hp", 2 }, /* hp - handler stack ptr */
+ { "lp", 31 }, /* lp - link ptr */
+ { "r0", 0 },
+ { "r1", 1 },
+ { "r10", 10 },
+ { "r11", 11 },
+ { "r12", 12 },
+ { "r13", 13 },
+ { "r14", 14 },
+ { "r15", 15 },
+ { "r16", 16 },
+ { "r17", 17 },
+ { "r18", 18 },
+ { "r19", 19 },
+ { "r2", 2 },
+ { "r20", 20 },
+ { "r21", 21 },
+ { "r22", 22 },
+ { "r23", 23 },
+ { "r24", 24 },
+ { "r25", 25 },
+ { "r26", 26 },
+ { "r27", 27 },
+ { "r28", 28 },
+ { "r29", 29 },
+ { "r3", 3 },
+ { "r30", 30 },
+ { "r31", 31 },
+ { "r4", 4 },
+ { "r5", 5 },
+ { "r6", 6 },
+ { "r7", 7 },
+ { "r8", 8 },
+ { "r9", 9 },
+ { "sp", 3 }, /* sp - stack ptr */
+ { "tp", 5 }, /* tp - text ptr */
+ { "zero", 0 },
+};
+#define REG_NAME_CNT (sizeof (pre_defined_registers) / sizeof (struct reg_name))
+
+
+static const struct reg_name system_registers[] =
+{
+ { "ecr", 4 },
+ { "eipc", 0 },
+ { "eipsw", 1 },
+ { "fepc", 2 },
+ { "fepsw", 3 },
+ { "psw", 5 },
+};
+#define SYSREG_NAME_CNT (sizeof (system_registers) / sizeof (struct reg_name))
+
+
+static const struct reg_name cc_names[] =
+{
+ { "c", 0x1 },
+ { "e", 0x2 },
+ { "ge", 0xe },
+ { "gt", 0xf },
+ { "h", 0xb },
+ { "l", 0x1 },
+ { "le", 0x7 },
+ { "lt", 0x6 },
+ { "n", 0x4 },
+ { "nc", 0x9 },
+ { "ne", 0xa },
+ { "nh", 0x3 },
+ { "nl", 0x9 },
+ { "ns", 0xc },
+ { "nv", 0x8 },
+ { "nz", 0xa },
+ { "p", 0xc },
+ { "s", 0x4 },
+ { "sa", 0xd },
+ { "t", 0x5 },
+ { "v", 0x0 },
+ { "z", 0x2 },
+};
+#define CC_NAME_CNT (sizeof (cc_names) / sizeof (struct reg_name))
+
+/* reg_name_search does a binary search of the given register table
+ to see if "name" is a valid regiter name. Returns the register
+ number from the array on success, or -1 on failure. */
+
+static int
+reg_name_search (regs, regcount, name, accept_numbers)
+ const struct reg_name * regs;
+ int regcount;
+ const char * name;
+ boolean accept_numbers;
+{
+ int middle, low, high;
+ int cmp;
+ symbolS * symbolP;
+
+ /* If the register name is a symbol, then evaluate it. */
+ if ((symbolP = symbol_find (name)) != NULL)
+ {
+ /* If the symbol is an alias for another name then use that.
+ If the symbol is an alias for a number, then return the number. */
+ if (symbolP->sy_value.X_op == O_symbol)
+ {
+ name = S_GET_NAME (symbolP->sy_value.X_add_symbol);
+ }
+ else if (accept_numbers)
+ {
+ int reg = S_GET_VALUE (symbolP);
+
+ if (reg >= 0 && reg <= 31)
+ return reg;
+ }
+ }
+
+ low = 0;
+ high = regcount - 1;
+
+ do
+ {
+ middle = (low + high) / 2;
+ cmp = strcasecmp (name, regs[middle].name);
+ if (cmp < 0)
+ high = middle - 1;
+ else if (cmp > 0)
+ low = middle + 1;
+ else
+ return regs[middle].value;
+ }
+ while (low <= high);
+ return -1;
+}
+
+
+/* Summary of register_name().
+ *
+ * in: Input_line_pointer points to 1st char of operand.
+ *
+ * out: A expressionS.
+ * The operand may have been a register: in this case, X_op == O_register,
+ * X_add_number is set to the register number, and truth is returned.
+ * Input_line_pointer->(next non-blank) char after operand, or is in
+ * its original state.
+ */
+static boolean
+register_name (expressionP)
+ expressionS * expressionP;
+{
+ int reg_number;
+ char * name;
+ char * start;
+ char c;
+
+ /* Find the spelling of the operand */
+ start = name = input_line_pointer;
+
+ c = get_symbol_end ();
+
+ reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT,
+ name, FALSE);
+
+ * input_line_pointer = c; /* put back the delimiting char */
+
+ /* look to see if it's in the register table */
+ if (reg_number >= 0)
+ {
+ expressionP->X_op = O_register;
+ expressionP->X_add_number = reg_number;
+
+ /* make the rest nice */
+ expressionP->X_add_symbol = NULL;
+ expressionP->X_op_symbol = NULL;
+
+ return true;
+ }
+ else
+ {
+ /* reset the line as if we had not done anything */
+ input_line_pointer = start;
+
+ return false;
+ }
+}
+
+/* Summary of system_register_name().
+ *
+ * in: Input_line_pointer points to 1st char of operand.
+ * expressionP points to an expression structure to be filled in.
+ * accept_numbers is true iff numerical register names may be used.
+ *
+ * out: A expressionS structure in expressionP.
+ * The operand may have been a register: in this case, X_op == O_register,
+ * X_add_number is set to the register number, and truth is returned.
+ * Input_line_pointer->(next non-blank) char after operand, or is in
+ * its original state.
+ */
+static boolean
+system_register_name (expressionP, accept_numbers
+ )
+ expressionS * expressionP;
+ boolean accept_numbers;
+{
+ int reg_number;
+ char * name;
+ char * start;
+ char c;
+
+ /* Find the spelling of the operand */
+ start = name = input_line_pointer;
+
+ c = get_symbol_end ();
+ reg_number = reg_name_search (system_registers, SYSREG_NAME_CNT, name,
+ accept_numbers);
+
+ * input_line_pointer = c; /* put back the delimiting char */
+
+ if (reg_number < 0
+ && accept_numbers)
+ {
+ input_line_pointer = start; /* reset input_line pointer */
+
+ if (isdigit (* input_line_pointer))
+ {
+ reg_number = strtol (input_line_pointer, & input_line_pointer, 10);
+
+ /* Make sure that the register number is allowable. */
+ if ( reg_number < 0
+ || reg_number > 5
+ )
+ {
+ reg_number = -1;
+ }
+ }
+ }
+
+ /* look to see if it's in the register table */
+ if (reg_number >= 0)
+ {
+ expressionP->X_op = O_register;
+ expressionP->X_add_number = reg_number;
+
+ /* make the rest nice */
+ expressionP->X_add_symbol = NULL;
+ expressionP->X_op_symbol = NULL;
+
+ return true;
+ }
+ else
+ {
+ /* reset the line as if we had not done anything */
+ input_line_pointer = start;
+
+ return false;
+ }
+}
+
+/* Summary of cc_name().
+ *
+ * in: Input_line_pointer points to 1st char of operand.
+ *
+ * out: A expressionS.
+ * The operand may have been a register: in this case, X_op == O_register,
+ * X_add_number is set to the register number, and truth is returned.
+ * Input_line_pointer->(next non-blank) char after operand, or is in
+ * its original state.
+ */
+static boolean
+cc_name (expressionP)
+ expressionS * expressionP;
+{
+ int reg_number;
+ char * name;
+ char * start;
+ char c;
+
+ /* Find the spelling of the operand */
+ start = name = input_line_pointer;
+
+ c = get_symbol_end ();
+ reg_number = reg_name_search (cc_names, CC_NAME_CNT, name, FALSE);
+
+ * input_line_pointer = c; /* put back the delimiting char */
+
+ /* look to see if it's in the register table */
+ if (reg_number >= 0)
+ {
+ expressionP->X_op = O_constant;
+ expressionP->X_add_number = reg_number;
+
+ /* make the rest nice */
+ expressionP->X_add_symbol = NULL;
+ expressionP->X_op_symbol = NULL;
+
+ return true;
+ }
+ else
+ {
+ /* reset the line as if we had not done anything */
+ input_line_pointer = start;
+
+ return false;
+ }
+}
+
+static void
+skip_white_space (void)
+{
+ while ( * input_line_pointer == ' '
+ || * input_line_pointer == '\t')
+ ++ input_line_pointer;
+}
+
+
+CONST char * md_shortopts = "m:";
+
+struct option md_longopts[] =
+{
+ {NULL, no_argument, NULL, 0}
+};
+size_t md_longopts_size = sizeof md_longopts;
+
+
+void
+md_show_usage (stream)
+ FILE * stream;
+{
+ fprintf (stream, "V850 options:\n");
+ fprintf (stream, "\t-mwarn-signed-overflow Warn if signed immediate values overflow\n");
+ fprintf (stream, "\t-mwarn-unsigned-overflow Warn if unsigned immediate values overflow\n");
+ fprintf (stream, "\t-mv850 The code is targeted at the v850\n");
+}
+
+int
+md_parse_option (c, arg)
+ int c;
+ char * arg;
+{
+ if (c != 'm')
+ {
+ fprintf (stderr, "unknown command line option: -%c%s\n", c, arg);
+ return 0;
+ }
+
+ if (strcmp (arg, "warn-signed-overflow") == 0)
+ {
+ warn_signed_overflows = TRUE;
+ }
+ else if (strcmp (arg, "warn-unsigned-overflow") == 0)
+ {
+ warn_unsigned_overflows = TRUE;
+ }
+ else if (strcmp (arg, "v850") == 0)
+ {
+ machine = 0;
+ processor_mask = PROCESSOR_V850;
+ }
+ else
+ {
+ fprintf (stderr, "unknown command line option: -%c%s\n", c, arg);
+ return 0;
+ }
+
+ return 1;
+}
+
+symbolS *
+md_undefined_symbol (name)
+ char * name;
+{
+ return 0;
+}
+
+char *
+md_atof (type, litp, sizep)
+ int type;
+ char * litp;
+ int * sizep;
+{
+ int prec;
+ LITTLENUM_TYPE words[4];
+ char * t;
+ int i;
+
+ switch (type)
+ {
+ case 'f':
+ prec = 2;
+ break;
+
+ case 'd':
+ prec = 4;
+ break;
+
+ default:
+ *sizep = 0;
+ return "bad call to md_atof";
+ }
+
+ t = atof_ieee (input_line_pointer, type, words);
+ if (t)
+ input_line_pointer = t;
+
+ *sizep = prec * 2;
+
+ for (i = prec - 1; i >= 0; i--)
+ {
+ md_number_to_chars (litp, (valueT) words[i], 2);
+ litp += 2;
+ }
+
+ return NULL;
+}
+
+
+/* Very gross. */
+void
+md_convert_frag (abfd, sec, fragP)
+ bfd * abfd;
+ asection * sec;
+ fragS * fragP;
+{
+ subseg_change (sec, 0);
+
+ /* In range conditional or unconditional branch. */
+ if (fragP->fr_subtype == 0 || fragP->fr_subtype == 2)
+ {
+ fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol,
+ fragP->fr_offset, 1, BFD_RELOC_UNUSED + (int)fragP->fr_opcode);
+ fragP->fr_var = 0;
+ fragP->fr_fix += 2;
+ }
+ /* Out of range conditional branch. Emit a branch around a jump. */
+ else if (fragP->fr_subtype == 1)
+ {
+ unsigned char *buffer =
+ (unsigned char *) (fragP->fr_fix + fragP->fr_literal);
+
+ /* Reverse the condition of the first branch. */
+ buffer[0] ^= 0x08;
+ /* Mask off all the displacement bits. */
+ buffer[0] &= 0x8f;
+ buffer[1] &= 0x07;
+ /* Now set the displacement bits so that we branch
+ around the unconditional branch. */
+ buffer[0] |= 0x30;
+
+ /* Now create the unconditional branch + fixup to the final
+ target. */
+ md_number_to_chars (buffer + 2, 0x00000780, 4);
+ fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol,
+ fragP->fr_offset, 1, BFD_RELOC_UNUSED + (int) fragP->fr_opcode
+ + 1);
+ fragP->fr_var = 0;
+ fragP->fr_fix += 6;
+ }
+ /* Out of range unconditional branch. Emit a jump. */
+ else if (fragP->fr_subtype == 3)
+ {
+ md_number_to_chars (fragP->fr_fix + fragP->fr_literal, 0x00000780, 4);
+ fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
+ fragP->fr_offset, 1, BFD_RELOC_UNUSED + (int) fragP->fr_opcode
+ + 1);
+ fragP->fr_var = 0;
+ fragP->fr_fix += 4;
+ }
+ else
+ abort ();
+}
+
+valueT
+md_section_align (seg, addr)
+ asection * seg;
+ valueT addr;
+{
+ int align = bfd_get_section_alignment (stdoutput, seg);
+ return ((addr + (1 << align) - 1) & (-1 << align));
+}
+
+void
+md_begin ()
+{
+ char * prev_name = "";
+ register const struct v850_opcode * op;
+ flagword applicable;
+
+ if (strncmp (TARGET_CPU, "v850", 4) == 0)
+ {
+ if (machine == -1)
+ machine = 0;
+
+ if (processor_mask == -1)
+ processor_mask = PROCESSOR_V850;
+ }
+ else
+ as_bad ("Unable to determine default target processor from string: %s",
+ TARGET_CPU);
+
+ v850_hash = hash_new();
+
+ /* Insert unique names into hash table. The V850 instruction set
+ has many identical opcode names that have different opcodes based
+ on the operands. This hash table then provides a quick index to
+ the first opcode with a particular name in the opcode table. */
+
+ op = v850_opcodes;
+ while (op->name)
+ {
+ if (strcmp (prev_name, op->name))
+ {
+ prev_name = (char *) op->name;
+ hash_insert (v850_hash, op->name, (char *) op);
+ }
+ op++;
+ }
+
+ bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine);
+
+ applicable = bfd_applicable_section_flags (stdoutput);
+
+ sdata_section = subseg_new (".sdata", 0);
+ bfd_set_section_flags (stdoutput, sdata_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS));
+
+ tdata_section = subseg_new (".tdata", 0);
+ bfd_set_section_flags (stdoutput, tdata_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS));
+
+ zdata_section = subseg_new (".zdata", 0);
+ bfd_set_section_flags (stdoutput, zdata_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS));
+
+ sbss_section = subseg_new (".sbss", 0);
+ bfd_set_section_flags (stdoutput, sbss_section, applicable & SEC_ALLOC);
+ seg_info (sbss_section)->bss = 1;
+
+ tbss_section = subseg_new (".tbss", 0);
+ bfd_set_section_flags (stdoutput, tbss_section, applicable & SEC_ALLOC);
+ seg_info (tbss_section)->bss = 1;
+
+ zbss_section = subseg_new (".zbss", 0);
+ bfd_set_section_flags (stdoutput, zbss_section, applicable & SEC_ALLOC);
+ seg_info (zbss_section)->bss = 1;
+
+ rosdata_section = subseg_new (".rosdata", 0);
+ bfd_set_section_flags (stdoutput, rosdata_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY));
+
+ rozdata_section = subseg_new (".rozdata", 0);
+ bfd_set_section_flags (stdoutput, rozdata_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY));
+
+ scommon_section = subseg_new (".scommon", 0);
+ bfd_set_section_flags (stdoutput, scommon_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS | SEC_IS_COMMON));
+
+ zcommon_section = subseg_new (".zcommon", 0);
+ bfd_set_section_flags (stdoutput, zcommon_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS | SEC_IS_COMMON));
+
+ tcommon_section = subseg_new (".tcommon", 0);
+ bfd_set_section_flags (stdoutput, tcommon_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS | SEC_IS_COMMON));
+
+}
+
+
+
+static bfd_reloc_code_real_type
+handle_sdaoff (const struct v850_operand * operand)
+{
+ if (operand == NULL) return BFD_RELOC_V850_SDA_16_16_OFFSET;
+ if (operand->bits == 15 && operand->shift == 17) return BFD_RELOC_V850_SDA_15_16_OFFSET;
+
+ if ( operand->bits != 16
+ || operand->shift != 16)
+ {
+ as_bad ("sdaoff() relocation used on an instruction which does not support it");
+ return BFD_RELOC_64; /* Used to indicate an error condition. */
+ }
+
+ return BFD_RELOC_V850_SDA_16_16_OFFSET;
+}
+
+static bfd_reloc_code_real_type
+handle_zdaoff (const struct v850_operand * operand)
+{
+ if (operand == NULL) return BFD_RELOC_V850_ZDA_16_16_OFFSET;
+ if (operand->bits == 15 && operand->shift == 17) return BFD_RELOC_V850_ZDA_15_16_OFFSET;
+
+ if ( operand->bits != 16
+ || operand->shift != 16)
+ {
+ as_bad ("zdaoff() relocation used on an instruction which does not support it");
+ return BFD_RELOC_64; /* Used to indicate an error condition. */
+ }
+
+ return BFD_RELOC_V850_ZDA_16_16_OFFSET;
+}
+
+static bfd_reloc_code_real_type
+handle_tdaoff (const struct v850_operand * operand)
+{
+ if (operand == NULL) return BFD_RELOC_V850_TDA_7_7_OFFSET; /* data item, not an instruction. */
+ if (operand->bits == 6 && operand->shift == 1) return BFD_RELOC_V850_TDA_6_8_OFFSET; /* sld.w/sst.w, operand: D8_6 */
+ if (operand->bits == 16 && operand->shift == 16) return BFD_RELOC_V850_TDA_16_16_OFFSET; /* set1 & chums, operands: D16 */
+
+ if (operand->bits != 7)
+ {
+ as_bad ("tdaoff() relocation used on an instruction which does not support it");
+ return BFD_RELOC_64; /* Used to indicate an error condition. */
+ }
+
+ return operand->insert != NULL
+ ? BFD_RELOC_V850_TDA_7_8_OFFSET /* sld.h/sst.h, operand: D8_7 */
+ : BFD_RELOC_V850_TDA_7_7_OFFSET; /* sld.b/sst.b, opreand: D7 */
+}
+
+/* Warning: The code in this function relies upon the definitions
+ in the v850_operands[] array (defined in opcodes/v850-opc.c)
+ matching the hard coded values contained herein. */
+
+static bfd_reloc_code_real_type
+v850_reloc_prefix (const struct v850_operand * operand)
+{
+ boolean paren_skipped = false;
+
+
+ /* Skip leading opening parenthesis. */
+ if (* input_line_pointer == '(')
+ {
+ ++ input_line_pointer;
+ paren_skipped = true;
+ }
+
+#define CHECK_(name, reloc) \
+ if (strncmp (input_line_pointer, name##"(", strlen (name) + 1) == 0) \
+ { \
+ input_line_pointer += strlen (name); \
+ return reloc; \
+ }
+
+ CHECK_ ("hi0", BFD_RELOC_HI16);
+ CHECK_ ("hi", BFD_RELOC_HI16_S);
+ CHECK_ ("lo", BFD_RELOC_LO16);
+ CHECK_ ("sdaoff", handle_sdaoff (operand));
+ CHECK_ ("zdaoff", handle_zdaoff (operand));
+ CHECK_ ("tdaoff", handle_tdaoff (operand));
+
+
+ /* Restore skipped parenthesis. */
+ if (paren_skipped)
+ -- input_line_pointer;
+
+ return BFD_RELOC_UNUSED;
+}
+
+/* Insert an operand value into an instruction. */
+
+static unsigned long
+v850_insert_operand (insn, operand, val, file, line, str)
+ unsigned long insn;
+ const struct v850_operand * operand;
+ offsetT val;
+ char * file;
+ unsigned int line;
+ char * str;
+{
+ if (operand->insert)
+ {
+ const char * message = NULL;
+
+ insn = operand->insert (insn, val, & message);
+ if (message != NULL)
+ {
+ if ((operand->flags & V850_OPERAND_SIGNED)
+ && ! warn_signed_overflows
+ && strstr (message, "out of range") != NULL)
+ {
+ /* skip warning... */
+ }
+ else if ((operand->flags & V850_OPERAND_SIGNED) == 0
+ && ! warn_unsigned_overflows
+ && strstr (message, "out of range") != NULL)
+ {
+ /* skip warning... */
+ }
+ else if (str)
+ {
+ if (file == (char *) NULL)
+ as_warn ("%s: %s", str, message);
+ else
+ as_warn_where (file, line, "%s: %s", str, message);
+ }
+ else
+ {
+ if (file == (char *) NULL)
+ as_warn (message);
+ else
+ as_warn_where (file, line, message);
+ }
+ }
+ }
+ else
+ {
+ if (operand->bits != 32)
+ {
+ long min, max;
+ offsetT test;
+
+ if ((operand->flags & V850_OPERAND_SIGNED) != 0)
+ {
+ if (! warn_signed_overflows)
+ max = (1 << operand->bits) - 1;
+ else
+ max = (1 << (operand->bits - 1)) - 1;
+
+ min = - (1 << (operand->bits - 1));
+ }
+ else
+ {
+ max = (1 << operand->bits) - 1;
+
+ if (! warn_unsigned_overflows)
+ min = - (1 << (operand->bits - 1));
+ else
+ min = 0;
+ }
+
+ if (val < (offsetT) min || val > (offsetT) max)
+ {
+ const char * err = "operand out of range (%s not between %ld and %ld)";
+ char buf[100];
+
+ /* Restore min and mix to expected values for decimal ranges. */
+ if ((operand->flags & V850_OPERAND_SIGNED)
+ && ! warn_signed_overflows)
+ max = (1 << (operand->bits - 1)) - 1;
+
+ if (! (operand->flags & V850_OPERAND_SIGNED)
+ && ! warn_unsigned_overflows)
+ min = 0;
+
+ if (str)
+ {
+ sprintf (buf, "%s: ", str);
+
+ sprint_value (buf + strlen (buf), val);
+ }
+ else
+ sprint_value (buf, val);
+
+ if (file == (char *) NULL)
+ as_warn (err, buf, min, max);
+ else
+ as_warn_where (file, line, err, buf, min, max);
+ }
+ }
+
+ insn |= (((long) val & ((1 << operand->bits) - 1)) << operand->shift);
+ }
+
+ return insn;
+}
+
+
+static char copy_of_instruction [128];
+
+void
+md_assemble (str)
+ char * str;
+{
+ char * s;
+ char * start_of_operands;
+ struct v850_opcode * opcode;
+ struct v850_opcode * next_opcode;
+ const unsigned char * opindex_ptr;
+ int next_opindex;
+ int relaxable;
+ unsigned long insn;
+ unsigned long insn_size;
+ char * f;
+ int i;
+ int match;
+ boolean extra_data_after_insn = false;
+ unsigned extra_data_len;
+ unsigned long extra_data;
+ char * saved_input_line_pointer;
+
+
+ strncpy (copy_of_instruction, str, sizeof (copy_of_instruction) - 1);
+
+ /* Get the opcode. */
+ for (s = str; *s != '\0' && ! isspace (*s); s++)
+ continue;
+
+ if (*s != '\0')
+ *s++ = '\0';
+
+ /* find the first opcode with the proper name */
+ opcode = (struct v850_opcode *) hash_find (v850_hash, str);
+ if (opcode == NULL)
+ {
+ as_bad ("Unrecognized opcode: `%s'", str);
+ ignore_rest_of_line ();
+ return;
+ }
+
+ str = s;
+ while (isspace (* str))
+ ++ str;
+
+ start_of_operands = str;
+
+ saved_input_line_pointer = input_line_pointer;
+
+ for (;;)
+ {
+ const char * errmsg = NULL;
+
+ match = 0;
+
+ if ((opcode->processors & processor_mask) == 0)
+ {
+ errmsg = "Target processor does not support this instruction.";
+ goto error;
+ }
+
+ relaxable = 0;
+ fc = 0;
+ next_opindex = 0;
+ insn = opcode->opcode;
+ extra_data_after_insn = false;
+
+ input_line_pointer = str = start_of_operands;
+
+ for (opindex_ptr = opcode->operands; *opindex_ptr != 0; opindex_ptr ++)
+ {
+ const struct v850_operand * operand;
+ char * hold;
+ expressionS ex;
+ bfd_reloc_code_real_type reloc;
+
+ if (next_opindex == 0)
+ {
+ operand = & v850_operands[ * opindex_ptr ];
+ }
+ else
+ {
+ operand = & v850_operands[ next_opindex ];
+ next_opindex = 0;
+ }
+
+ errmsg = NULL;
+
+ while (*str == ' ' || *str == ',' || *str == '[' || *str == ']')
+ ++ str;
+
+ if (operand->flags & V850_OPERAND_RELAX)
+ relaxable = 1;
+
+ /* Gather the operand. */
+ hold = input_line_pointer;
+ input_line_pointer = str;
+
+ /* lo(), hi(), hi0(), etc... */
+ if ((reloc = v850_reloc_prefix (operand)) != BFD_RELOC_UNUSED)
+ {
+ /* This is a fake reloc, used to indicate an error condition. */
+ if (reloc == BFD_RELOC_64)
+ {
+ match = 1;
+ goto error;
+ }
+
+ expression (& ex);
+
+ if (ex.X_op == O_constant)
+ {
+ switch (reloc)
+ {
+ case BFD_RELOC_V850_ZDA_16_16_OFFSET:
+ /* To cope with "not1 7, zdaoff(0xfffff006)[r0]"
+ and the like. */
+ /* Fall through. */
+
+ case BFD_RELOC_LO16:
+ {
+ /* Truncate, then sign extend the value. */
+ ex.X_add_number = SEXT16 (ex.X_add_number);
+ break;
+ }
+
+ case BFD_RELOC_HI16:
+ {
+ /* Truncate, then sign extend the value. */
+ ex.X_add_number = SEXT16 (ex.X_add_number >> 16);
+ break;
+ }
+
+ case BFD_RELOC_HI16_S:
+ {
+ /* Truncate, then sign extend the value. */
+ int temp = (ex.X_add_number >> 16) & 0xffff;
+
+ temp += (ex.X_add_number >> 15) & 1;
+
+ ex.X_add_number = SEXT16 (temp);
+ break;
+ }
+
+
+ default:
+ fprintf (stderr, "reloc: %d\n", reloc);
+ as_bad ("AAARG -> unhandled constant reloc");
+ break;
+ }
+
+ insn = v850_insert_operand (insn, operand, ex.X_add_number,
+ (char *) NULL, 0,
+ copy_of_instruction);
+ }
+ else
+ {
+
+ if (fc > MAX_INSN_FIXUPS)
+ as_fatal ("too many fixups");
+
+ fixups[ fc ].exp = ex;
+ fixups[ fc ].opindex = * opindex_ptr;
+ fixups[ fc ].reloc = reloc;
+ fc++;
+ }
+ }
+ else
+ {
+ errmsg = NULL;
+
+ if ((operand->flags & V850_OPERAND_REG) != 0)
+ {
+ if (!register_name (& ex))
+ {
+ errmsg = "invalid register name";
+ }
+ else if ((operand->flags & V850_NOT_R0)
+ && ex.X_add_number == 0)
+ {
+ errmsg = "register r0 cannot be used here";
+
+ /* Force an error message to be generated by
+ skipping over any following potential matches
+ for this opcode. */
+ opcode += 3;
+ }
+ }
+ else if ((operand->flags & V850_OPERAND_SRG) != 0)
+ {
+ if (!system_register_name (& ex, true
+ ))
+ {
+ errmsg = "invalid system register name";
+ }
+ }
+ else if ((operand->flags & V850_OPERAND_EP) != 0)
+ {
+ char * start = input_line_pointer;
+ char c = get_symbol_end ();
+
+ if (strcmp (start, "ep") != 0 && strcmp (start, "r30") != 0)
+ {
+ /* Put things back the way we found them. */
+ *input_line_pointer = c;
+ input_line_pointer = start;
+ errmsg = "expected EP register";
+ goto error;
+ }
+
+ *input_line_pointer = c;
+ str = input_line_pointer;
+ input_line_pointer = hold;
+
+ while ( *str == ' ' || *str == ',' || *str == '['
+ || *str == ']')
+ ++ str;
+ continue;
+ }
+ else if ((operand->flags & V850_OPERAND_CC) != 0)
+ {
+ if (!cc_name (& ex))
+ {
+ errmsg = "invalid condition code name";
+ }
+ }
+ else if (register_name (& ex)
+ && (operand->flags & V850_OPERAND_REG) == 0)
+ {
+ /* It is possible that an alias has been defined that
+ matches a register name. For example the code may
+ include a ".set ZERO, 0" directive, which matches
+ the register name "zero". Attempt to reparse the
+ field as an expression, and only complain if we
+ cannot generate a constant. */
+
+ input_line_pointer = str;
+
+ expression (& ex);
+
+ if (ex.X_op != O_constant)
+ {
+ /* If this register is actually occuring too early on
+ the parsing of the instruction, (because another
+ field is missing) then report this. */
+ if (opindex_ptr[1] != 0
+ && (v850_operands [opindex_ptr [1]].flags & V850_OPERAND_REG))
+ errmsg = "syntax error: value is missing before the register name";
+ else
+ errmsg = "syntax error: register not expected";
+ }
+ }
+ else if (system_register_name (& ex, false
+ )
+ && (operand->flags & V850_OPERAND_SRG) == 0)
+ {
+ errmsg = "syntax error: system register not expected";
+ }
+ else if (cc_name (&ex)
+ && (operand->flags & V850_OPERAND_CC) == 0)
+ {
+ errmsg = "syntax error: condition code not expected";
+ }
+ else
+ {
+ expression (& ex);
+ }
+
+ if (errmsg)
+ goto error;
+
+/* fprintf (stderr, " insn: %x, operand %d, op: %d, add_number: %d\n", insn, opindex_ptr - opcode->operands, ex.X_op, ex.X_add_number); */
+
+ switch (ex.X_op)
+ {
+ case O_illegal:
+ errmsg = "illegal operand";
+ goto error;
+ case O_absent:
+ errmsg = "missing operand";
+ goto error;
+ case O_register:
+ if ((operand->flags & (V850_OPERAND_REG | V850_OPERAND_SRG)) == 0)
+ {
+ errmsg = "invalid operand";
+ goto error;
+ }
+ insn = v850_insert_operand (insn, operand, ex.X_add_number,
+ (char *) NULL, 0,
+ copy_of_instruction);
+ break;
+
+ case O_constant:
+ insn = v850_insert_operand (insn, operand, ex.X_add_number,
+ (char *) NULL, 0,
+ copy_of_instruction);
+ break;
+
+ default:
+ /* We need to generate a fixup for this expression. */
+ if (fc >= MAX_INSN_FIXUPS)
+ as_fatal ("too many fixups");
+
+ fixups[ fc ].exp = ex;
+ fixups[ fc ].opindex = * opindex_ptr;
+ fixups[ fc ].reloc = BFD_RELOC_UNUSED;
+ ++fc;
+ break;
+ }
+ }
+
+ str = input_line_pointer;
+ input_line_pointer = hold;
+
+ while (*str == ' ' || *str == ',' || *str == '[' || *str == ']'
+ || *str == ')')
+ ++str;
+ }
+ match = 1;
+
+ error:
+ if (match == 0)
+ {
+ next_opcode = opcode + 1;
+ if (next_opcode->name != NULL
+ && strcmp (next_opcode->name, opcode->name) == 0)
+ {
+ opcode = next_opcode;
+
+ /* Skip versions that are not supported by the target
+ processor. */
+ if ((opcode->processors & processor_mask) == 0)
+ goto error;
+
+ continue;
+ }
+
+ as_bad ("%s: %s", copy_of_instruction, errmsg);
+
+ if (* input_line_pointer == ']')
+ ++ input_line_pointer;
+
+ ignore_rest_of_line ();
+ input_line_pointer = saved_input_line_pointer;
+ return;
+ }
+ break;
+ }
+
+ while (isspace (*str))
+ ++str;
+
+ if (*str != '\0')
+ as_bad ("junk at end of line: `%s'", str);
+
+ input_line_pointer = str;
+
+ /* Write out the instruction. */
+
+ if (relaxable && fc > 0)
+ {
+ insn_size = 2;
+ fc = 0;
+
+ if (!strcmp (opcode->name, "br"))
+ {
+ f = frag_var (rs_machine_dependent, 4, 2, 2,
+ fixups[0].exp.X_add_symbol,
+ fixups[0].exp.X_add_number,
+ (char *)fixups[0].opindex);
+ md_number_to_chars (f, insn, insn_size);
+ md_number_to_chars (f + 2, 0, 2);
+ }
+ else
+ {
+ f = frag_var (rs_machine_dependent, 6, 4, 0,
+ fixups[0].exp.X_add_symbol,
+ fixups[0].exp.X_add_number,
+ (char *)fixups[0].opindex);
+ md_number_to_chars (f, insn, insn_size);
+ md_number_to_chars (f + 2, 0, 4);
+ }
+ }
+ else
+ {
+ /* Four byte insns have an opcode with the two high bits on. */
+ if ((insn & 0x0600) == 0x0600)
+ insn_size = 4;
+ else
+ insn_size = 2;
+
+
+ f = frag_more (insn_size);
+
+ md_number_to_chars (f, insn, insn_size);
+
+ if (extra_data_after_insn)
+ {
+ f = frag_more (extra_data_len);
+
+ md_number_to_chars (f, extra_data, extra_data_len);
+
+ extra_data_after_insn = false;
+ }
+ }
+
+ /* Create any fixups. At this point we do not use a
+ bfd_reloc_code_real_type, but instead just use the
+ BFD_RELOC_UNUSED plus the operand index. This lets us easily
+ handle fixups for any operand type, although that is admittedly
+ not a very exciting feature. We pick a BFD reloc type in
+ md_apply_fix. */
+ for (i = 0; i < fc; i++)
+ {
+ const struct v850_operand * operand;
+ bfd_reloc_code_real_type reloc;
+
+ operand = & v850_operands[ fixups[i].opindex ];
+
+ reloc = fixups[i].reloc;
+
+ if (reloc != BFD_RELOC_UNUSED)
+ {
+ reloc_howto_type * reloc_howto = bfd_reloc_type_lookup (stdoutput,
+ reloc);
+ int size;
+ int address;
+ fixS * fixP;
+
+ if (!reloc_howto)
+ abort();
+
+ size = bfd_get_reloc_size (reloc_howto);
+
+ /* XXX This will abort on an R_V850_8 reloc -
+ is this reloc actually used ? */
+ if (size != 2 && size != 4)
+ abort();
+
+ address = (f - frag_now->fr_literal) + insn_size - size;
+
+ if (reloc == BFD_RELOC_32)
+ {
+ address += 2;
+ }
+
+ fixP = fix_new_exp (frag_now, address, size,
+ & fixups[i].exp,
+ reloc_howto->pc_relative,
+ reloc);
+
+ switch (reloc)
+ {
+ case BFD_RELOC_LO16:
+ case BFD_RELOC_HI16:
+ case BFD_RELOC_HI16_S:
+ fixP->fx_no_overflow = 1;
+ break;
+ }
+ }
+ else
+ {
+ fix_new_exp (
+ frag_now,
+ f - frag_now->fr_literal, 4,
+ & fixups[i].exp,
+ 1 /* FIXME: V850_OPERAND_RELATIVE ??? */,
+ (bfd_reloc_code_real_type) (fixups[i].opindex
+ + (int) BFD_RELOC_UNUSED)
+ );
+ }
+ }
+
+ input_line_pointer = saved_input_line_pointer;
+}
+
+
+/* If while processing a fixup, a reloc really needs to be created */
+/* then it is done here. */
+
+arelent *
+tc_gen_reloc (seg, fixp)
+ asection * seg;
+ fixS * fixp;
+{
+ arelent * reloc;
+
+ reloc = (arelent *) xmalloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = & fixp->fx_addsy->bsym;
+ reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
+
+ if (reloc->howto == (reloc_howto_type *) NULL)
+ {
+ as_bad_where (fixp->fx_file, fixp->fx_line,
+ "reloc %d not supported by object file format",
+ (int)fixp->fx_r_type);
+
+ xfree (reloc);
+
+ return NULL;
+ }
+
+ reloc->addend = fixp->fx_addnumber;
+
+ return reloc;
+}
+
+/* Assume everything will fit in two bytes, then expand as necessary. */
+int
+md_estimate_size_before_relax (fragp, seg)
+ fragS * fragp;
+ asection * seg;
+{
+ if (fragp->fr_subtype == 0)
+ fragp->fr_var = 4;
+ else if (fragp->fr_subtype == 2)
+ fragp->fr_var = 2;
+ else
+ abort ();
+ return 2;
+}
+
+long
+md_pcrel_from (fixp)
+ fixS * fixp;
+{
+ /* If the symbol is undefined, or in a section other than our own,
+ then let the linker figure it out. */
+ if (fixp->fx_addsy != (symbolS *) NULL && ! S_IS_DEFINED (fixp->fx_addsy))
+ {
+ /* The symbol is undefined. Let the linker figure it out. */
+ return 0;
+ }
+ return fixp->fx_frag->fr_address + fixp->fx_where;
+}
+
+int
+md_apply_fix3 (fixp, valuep, seg)
+ fixS * fixp;
+ valueT * valuep;
+ segT seg;
+{
+ valueT value;
+ char * where;
+
+ if (fixp->fx_addsy == (symbolS *) NULL)
+ {
+ value = * valuep;
+ fixp->fx_done = 1;
+ }
+ else if (fixp->fx_pcrel)
+ value = * valuep;
+ else
+ {
+ value = fixp->fx_offset;
+ if (fixp->fx_subsy != (symbolS *) NULL)
+ {
+ if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section)
+ value -= S_GET_VALUE (fixp->fx_subsy);
+ else
+ {
+ /* We don't actually support subtracting a symbol. */
+ as_bad_where (fixp->fx_file, fixp->fx_line,
+ "expression too complex");
+ }
+ }
+ }
+
+ if ((int) fixp->fx_r_type >= (int) BFD_RELOC_UNUSED)
+ {
+ int opindex;
+ const struct v850_operand * operand;
+ unsigned long insn;
+
+ opindex = (int) fixp->fx_r_type - (int) BFD_RELOC_UNUSED;
+ operand = & v850_operands[ opindex ];
+
+ /* Fetch the instruction, insert the fully resolved operand
+ value, and stuff the instruction back again.
+
+ Note the instruction has been stored in little endian
+ format! */
+ where = fixp->fx_frag->fr_literal + fixp->fx_where;
+
+ insn = bfd_getl32 ((unsigned char *) where);
+ insn = v850_insert_operand (insn, operand, (offsetT) value,
+ fixp->fx_file, fixp->fx_line, NULL);
+ bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
+
+ if (fixp->fx_done)
+ {
+ /* Nothing else to do here. */
+ return 1;
+ }
+
+ /* Determine a BFD reloc value based on the operand information.
+ We are only prepared to turn a few of the operands into relocs. */
+
+ if (operand->bits == 22)
+ fixp->fx_r_type = BFD_RELOC_V850_22_PCREL;
+ else if (operand->bits == 9)
+ fixp->fx_r_type = BFD_RELOC_V850_9_PCREL;
+ else
+ {
+ /* fprintf (stderr, "bits: %d, insn: %x\n", operand->bits, insn); */
+
+ as_bad_where(fixp->fx_file, fixp->fx_line,
+ "unresolved expression that must be resolved");
+ fixp->fx_done = 1;
+ return 1;
+ }
+ }
+ else if (fixp->fx_done)
+ {
+ /* We still have to insert the value into memory! */
+ where = fixp->fx_frag->fr_literal + fixp->fx_where;
+
+ if (fixp->fx_size == 1)
+ *where = value & 0xff;
+ else if (fixp->fx_size == 2)
+ bfd_putl16 (value & 0xffff, (unsigned char *) where);
+ else if (fixp->fx_size == 4)
+ bfd_putl32 (value, (unsigned char *) where);
+ }
+
+ fixp->fx_addnumber = value;
+ return 1;
+}
+
+
+/* Parse a cons expression. We have to handle hi(), lo(), etc
+ on the v850. */
+void
+parse_cons_expression_v850 (exp)
+ expressionS *exp;
+{
+ /* See if there's a reloc prefix like hi() we have to handle. */
+ hold_cons_reloc = v850_reloc_prefix (NULL);
+
+ /* Do normal expression parsing. */
+ expression (exp);
+}
+
+/* Create a fixup for a cons expression. If parse_cons_expression_v850
+ found a reloc prefix, then we use that reloc, else we choose an
+ appropriate one based on the size of the expression. */
+void
+cons_fix_new_v850 (frag, where, size, exp)
+ fragS *frag;
+ int where;
+ int size;
+ expressionS *exp;
+{
+ if (hold_cons_reloc == BFD_RELOC_UNUSED)
+ {
+ if (size == 4)
+ hold_cons_reloc = BFD_RELOC_32;
+ if (size == 2)
+ hold_cons_reloc = BFD_RELOC_16;
+ if (size == 1)
+ hold_cons_reloc = BFD_RELOC_8;
+ }
+
+ if (exp != NULL)
+ fix_new_exp (frag, where, size, exp, 0, hold_cons_reloc);
+ else
+ fix_new (frag, where, size, NULL, 0, 0, hold_cons_reloc);
+}
diff --git a/contrib/binutils/gas/config/tc-v850.h b/contrib/binutils/gas/config/tc-v850.h
new file mode 100644
index 0000000..f031366
--- /dev/null
+++ b/contrib/binutils/gas/config/tc-v850.h
@@ -0,0 +1,80 @@
+/* tc-v850.h -- Header file for tc-v850.c.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GAS is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#define TC_V850
+
+#include <elf/v850.h>
+
+#define TARGET_BYTES_BIG_ENDIAN 0
+
+#ifndef BFD_ASSEMBLER
+ #error V850 support requires BFD_ASSEMBLER
+#endif
+
+/* The target BFD architecture. */
+#define TARGET_ARCH bfd_arch_v850
+
+/* The target BFD format. */
+#define TARGET_FORMAT "elf32-v850"
+
+
+#define MD_APPLY_FIX3
+#define md_operand(x)
+
+/* Permit temporary numeric labels. */
+#define LOCAL_LABELS_FB 1
+
+#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */
+
+/* We don't need to handle .word strangely. */
+#define WORKING_DOT_WORD
+
+#define md_number_to_chars number_to_chars_littleendian
+
+/* We need to handle lo(), hi(), etc etc in .hword, .word, etc
+ directives, so we have to parse "cons" expressions ourselves. */
+#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) parse_cons_expression_v850 (EXP)
+#define TC_CONS_FIX_NEW cons_fix_new_v850
+extern const struct relax_type md_relax_table[];
+#define TC_GENERIC_RELAX_TABLE md_relax_table
+
+
+/* This section must be in the small data area (pointed to by GP). */
+#define SHF_V850_GPREL 0x10000000
+/* This section must be in the tiny data area (pointed to by EP). */
+#define SHF_V850_EPREL 0x20000000
+/* This section must be in the zero data area (pointed to by R0). */
+#define SHF_V850_R0REL 0x40000000
+
+#define ELF_TC_SPECIAL_SECTIONS \
+ { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL }, \
+ { ".rosdata", SHT_PROGBITS, SHF_ALLOC + SHF_V850_GPREL }, \
+ { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL }, \
+ { ".scommon", SHT_V850_SCOMMON, SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL }, \
+ { ".tdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL }, \
+ { ".tbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL }, \
+ { ".tcommon", SHT_V850_TCOMMON, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, \
+ { ".zdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, \
+ { ".rozdata", SHT_PROGBITS, SHF_ALLOC + SHF_V850_R0REL }, \
+ { ".zbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, \
+ { ".zcommon", SHT_V850_ZCOMMON, SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL }, \
+ { ".call_table_data", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \
+ { ".call_table_text", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_EXECINSTR },
+
diff --git a/contrib/binutils/gas/config/te-nbsd.h b/contrib/binutils/gas/config/te-nbsd.h
index 2291ba5..cee4600 100644
--- a/contrib/binutils/gas/config/te-nbsd.h
+++ b/contrib/binutils/gas/config/te-nbsd.h
@@ -1,5 +1,5 @@
/* te-nbsd.h -- NetBSD target environment declarations.
- Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 90, 91, 92, 94, 95, 1998 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -14,8 +14,10 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#define TE_NetBSD 1
+#define LOCAL_LABELS_FB 1
#include "obj-format.h"
diff --git a/contrib/binutils/gas/depend.c b/contrib/binutils/gas/depend.c
new file mode 100644
index 0000000..8cb3267
--- /dev/null
+++ b/contrib/binutils/gas/depend.c
@@ -0,0 +1,208 @@
+/* depend.c - Handle dependency tracking.
+ Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GAS is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "as.h"
+
+/* The file to write to, or NULL if no dependencies being kept. */
+static char *dep_file = NULL;
+
+struct dependency
+{
+ char *file;
+ struct dependency *next;
+};
+
+/* All the files we depend on. */
+static struct dependency *dep_chain = NULL;
+
+/* Current column in output file. */
+static int column = 0;
+
+static int quote_string_for_make PARAMS ((FILE *, char *));
+static void wrap_output PARAMS ((FILE *, char *, int));
+
+/* Number of columns allowable. */
+#define MAX_COLUMNS 72
+
+
+
+/* Start saving dependencies, to be written to FILENAME. If this is
+ never called, then dependency tracking is simply skipped. */
+
+void
+start_dependencies (filename)
+ char *filename;
+{
+ dep_file = filename;
+}
+
+/* Noticed a new filename, so try to register it. */
+
+void
+register_dependency (filename)
+ char *filename;
+{
+ struct dependency *dep;
+
+ if (dep_file == NULL)
+ return;
+
+ for (dep = dep_chain; dep != NULL; dep = dep->next)
+ {
+ if (! strcmp (filename, dep->file))
+ return;
+ }
+
+ dep = (struct dependency *) xmalloc (sizeof (struct dependency));
+ dep->file = xstrdup (filename);
+ dep->next = dep_chain;
+ dep_chain = dep;
+}
+
+/* Quote a file name the way `make' wants it, and print it to FILE.
+ If FILE is NULL, do no printing, but return the length of the
+ quoted string.
+
+ This code is taken from gcc with only minor changes. */
+
+static int
+quote_string_for_make (file, src)
+ FILE *file;
+ char *src;
+{
+ char *p = src;
+ int i = 0;
+ for (;;)
+ {
+ char c = *p++;
+ switch (c)
+ {
+ case '\0':
+ case ' ':
+ case '\t':
+ {
+ /* GNU make uses a weird quoting scheme for white space.
+ A space or tab preceded by 2N+1 backslashes represents
+ N backslashes followed by space; a space or tab
+ preceded by 2N backslashes represents N backslashes at
+ the end of a file name; and backslashes in other
+ contexts should not be doubled. */
+ char *q;
+ for (q = p - 1; src < q && q[-1] == '\\'; q--)
+ {
+ if (file)
+ putc ('\\', file);
+ i++;
+ }
+ }
+ if (!c)
+ return i;
+ if (file)
+ putc ('\\', file);
+ i++;
+ goto ordinary_char;
+
+ case '$':
+ if (file)
+ putc (c, file);
+ i++;
+ /* Fall through. This can mishandle things like "$(" but
+ there's no easy fix. */
+ default:
+ ordinary_char:
+ /* This can mishandle characters in the string "\0\n%*?[\\~";
+ exactly which chars are mishandled depends on the `make' version.
+ We know of no portable solution for this;
+ even GNU make 3.76.1 doesn't solve the problem entirely.
+ (Also, '\0' is mishandled due to our calling conventions.) */
+ if (file)
+ putc (c, file);
+ i++;
+ break;
+ }
+ }
+}
+
+/* Append some output to the file, keeping track of columns and doing
+ wrapping as necessary. */
+
+static void
+wrap_output (f, string, spacer)
+ FILE *f;
+ char *string;
+ int spacer;
+{
+ int len = quote_string_for_make (NULL, string);
+
+ if (len == 0)
+ return;
+
+ if (column && MAX_COLUMNS - 1 /*spacer*/ - 2 /*` \'*/ < column + len)
+ {
+ fprintf (f, " \\\n ");
+ column = 0;
+ if (spacer == ' ')
+ spacer = '\0';
+ }
+
+ if (spacer == ' ')
+ {
+ putc (spacer, f);
+ ++column;
+ }
+
+ quote_string_for_make (f, string);
+ column += len;
+
+ if (spacer == ':')
+ {
+ putc (spacer, f);
+ ++column;
+ }
+}
+
+/* Print dependency file. */
+
+void
+print_dependencies ()
+{
+ FILE *f;
+ struct dependency *dep;
+
+ if (dep_file == NULL)
+ return;
+
+ f = fopen (dep_file, "w");
+ if (f == NULL)
+ {
+ as_warn ("Can't open `%s' for writing", dep_file);
+ return;
+ }
+
+ column = 0;
+ wrap_output (f, out_file_name, ':');
+ for (dep = dep_chain; dep != NULL; dep = dep->next)
+ wrap_output (f, dep->file, ' ');
+
+ putc ('\n', f);
+
+ if (fclose (f))
+ as_warn ("Can't close %s", dep_file);
+}
diff --git a/contrib/binutils/gas/doc/Makefile.am b/contrib/binutils/gas/doc/Makefile.am
new file mode 100644
index 0000000..8949476
--- /dev/null
+++ b/contrib/binutils/gas/doc/Makefile.am
@@ -0,0 +1,43 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus
+
+# What version of the manual you want; "all" includes everything
+CONFIG=all
+
+man_MANS = as.1
+
+info_TEXINFOS = as.texinfo gasp.texi
+
+asconfig.texi: $(CONFIG).texi
+ rm -f asconfig.texi
+ ln -s $(srcdir)/$(CONFIG).texi ./asconfig.texi >/dev/null 2>&1 \
+ || ln $(srcdir)/$(CONFIG).texi ./asconfig.texi >/dev/null 2>&1 \
+ || cp $(srcdir)/$(CONFIG).texi ./asconfig.texi
+
+CPU_DOCS = \
+ c-a29k.texi \
+ c-arm.texi \
+ c-d10v.texi \
+ c-h8300.texi \
+ c-h8500.texi \
+ c-hppa.texi \
+ c-i386.texi \
+ c-i960.texi \
+ c-m68k.texi \
+ c-mips.texi \
+ c-ns32k.texi \
+ c-sh.texi \
+ c-sparc.texi \
+ c-vax.texi \
+ c-v850.texi \
+ c-z8k.texi
+
+as.info: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS)
+as.dvi: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS)
+
+# This one isn't ready for prime time yet. Not even a little bit.
+
+noinst_TEXINFOS = internals.texi
+
+DISTCLEANFILES = asconfig.texi
diff --git a/contrib/binutils/gas/doc/Makefile.in b/contrib/binutils/gas/doc/Makefile.in
index 3749cbc..d9ee2b2 100644
--- a/contrib/binutils/gas/doc/Makefile.in
+++ b/contrib/binutils/gas/doc/Makefile.in
@@ -1,193 +1,350 @@
-# Makefile for GNU Assembler documentation
-# Copyright (C) 1987-1993 Free Software Foundation, Inc.
+# Makefile.in generated automatically by automake 1.2e from Makefile.am
-#This file is part of GNU GAS.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
-#GNU GAS is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2, or (at your option)
-#any later version.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-#GNU GAS is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#You should have received a copy of the GNU General Public License
-#along with GNU GAS; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# The targets for external use include:
-# all, doc, proto, install, uninstall, includes, TAGS,
-# clean, cleanconfig, realclean, stage1, stage2, stage3, stage4.
-
-# Variables that exist for you to override.
+SHELL = @SHELL@
srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
-
prefix = @prefix@
-
-program_transform_name = @program_transform_name@
exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
datadir = @datadir@
-mandir = @mandir@
-man1dir = $(mandir)/man1
-man2dir = $(mandir)/man2
-man3dir = $(mandir)/man3
-man4dir = $(mandir)/man4
-man5dir = $(mandir)/man5
-man6dir = $(mandir)/man6
-man7dir = $(mandir)/man7
-man8dir = $(mandir)/man8
-man9dir = $(mandir)/man9
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
infodir = @infodir@
+mandir = @mandir@
includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
-SHELL = /bin/sh
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-INSTALL_XFORM1 = $(INSTALL) -b $(program_transform_name) .1
-
-AR = ar
-AR_FLAGS = qv
-BISON = bison
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-DVIPS = dvips
-RANLIB = ranlib
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+ALL_OBJ_DEPS = @ALL_OBJ_DEPS@
+BFDLIB = @BFDLIB@
+CC = @CC@
+EXEEXT = @EXEEXT@
+LD = @LD@
+LEX = @LEX@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OPCODES_LIB = @OPCODES_LIB@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+YACC = @YACC@
+atof = @atof@
+extra_objects = @extra_objects@
+obj_format = @obj_format@
+target_cpu_type = @target_cpu_type@
+te_file = @te_file@
+
+AUTOMAKE_OPTIONS = cygnus
# What version of the manual you want; "all" includes everything
CONFIG=all
-# Where to find texinfo.tex to format docn with TeX
-TEXIDIR = $(srcdir)/../../texinfo
+man_MANS = as.1
+
+info_TEXINFOS = as.texinfo gasp.texi
+
+CPU_DOCS = \
+ c-a29k.texi \
+ c-arm.texi \
+ c-d10v.texi \
+ c-h8300.texi \
+ c-h8500.texi \
+ c-hppa.texi \
+ c-i386.texi \
+ c-i960.texi \
+ c-m68k.texi \
+ c-mips.texi \
+ c-ns32k.texi \
+ c-sh.texi \
+ c-sparc.texi \
+ c-vax.texi \
+ c-v850.texi \
+ c-z8k.texi
-##
+# This one isn't ready for prime time yet. Not even a little bit.
-all:
-install:
- $(INSTALL_XFORM1) $(srcdir)/as.1 $(man1dir)/as.1
+noinst_TEXINFOS = internals.texi
-info: as.info gasp.info
-dvi: as.dvi gasp.dvi
-ps: as.ps gasp.ps
+DISTCLEANFILES = asconfig.texi
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
+TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
+INFO_DEPS = as.info gasp.info
+DVIS = as.dvi gasp.dvi
+TEXINFOS = as.texinfo gasp.texi
+MANS = as.1
-asconfig.texi: $(CONFIG).texi
- rm -f asconfig.texi
- ln -s $(srcdir)/$(CONFIG).texi ./asconfig.texi || \
- ln $(srcdir)/$(CONFIG).texi ./asconfig.texi || \
- cp $(srcdir)/$(CONFIG).texi ./asconfig.texi
-
-as.info: $(srcdir)/as.texinfo asconfig.texi
- $(MAKEINFO) -I$(TEXIDIR) -I$(srcdir) -o as.info $(srcdir)/as.texinfo
-
-gasp.info: $(srcdir)/gasp.texi
- $(MAKEINFO) -o gasp.info $(srcdir)/gasp.texi
-
-install-info: install-info-as install-info-gasp
-install-info-as: as.info
- if [ -r as.info ]; then \
- dir=. ; \
- else \
- dir=$(srcdir) ; \
- fi ; \
- for i in `cd $$dir ; echo as.info*` ; do \
- $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i ; \
+NROFF = nroff
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP = --best
+default: all
+
+.SUFFIXES:
+.SUFFIXES: .dvi .info .ps .texi .texinfo
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+as.info: as.texinfo
+as.dvi: as.texinfo
+
+
+gasp.info: gasp.texi
+gasp.dvi: gasp.texi
+
+
+DVIPS = dvips
+
+.texi.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texi.dvi:
+ TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.texi:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.texinfo.dvi:
+ TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+.dvi.ps:
+ $(DVIPS) $< -o $@
+
+install-info-am: $(INFO_DEPS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(infodir)
+ @for file in $(INFO_DEPS); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+ if test -f $$d/$$ifile; then \
+ echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
+ $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+ else : ; fi; \
+ done; \
+ done
+ @$(POST_INSTALL)
+ @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ for file in $(INFO_DEPS); do \
+ echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
+ install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+ done; \
+ else : ; fi
+
+uninstall-info:
+ $(PRE_UNINSTALL)
+ @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ ii=yes; \
+ else ii=; fi; \
+ for file in $(INFO_DEPS); do \
+ test -z "$ii" \
+ || install-info --info-dir=$(infodir) --remove $$file; \
done
-install-info-gasp: gasp.info
- if [ -r gasp.info ]; then \
- dir=. ; \
- else \
- dir=$(srcdir) ; \
- fi ; \
- for i in `cd $$dir ; echo gasp.info*` ; do \
- $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i ; \
+ $(NORMAL_UNINSTALL)
+ for file in $(INFO_DEPS); do \
+ (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done
-as.dvi: $(srcdir)/as.texinfo asconfig.texi
- TEXINPUTS=$(srcdir):$(TEXIDIR):$$TEXINPUTS MAKEINFO='$(MAKEINFO) -I$(srcdir)' \
- $(TEXI2DVI) $(srcdir)/as.texinfo
+dist-info: $(INFO_DEPS)
+ for base in $(INFO_DEPS); do \
+ if test -f $$base; then d=.; else d=$(srcdir); fi; \
+ for file in `cd $$d && eval echo $$base*`; do \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done; \
+ done
-as.ps: as.dvi
- $(DVIPS) -o $@ $?
+mostlyclean-aminfo:
+ -rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps \
+ as.log as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr \
+ as.cv as.cn gasp.aux gasp.cp gasp.cps gasp.dvi gasp.fn \
+ gasp.fns gasp.ky gasp.kys gasp.ps gasp.log gasp.pg gasp.toc \
+ gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op gasp.tr gasp.cv \
+ gasp.cn
-gasp.dvi: $(srcdir)/gasp.texi
- TEXINPUTS=$(srcdir):$(TEXIDIR):$$TEXINPUTS MAKEINFO='$(MAKEINFO) -I$(srcdir)' \
- $(TEXI2DVI) $(srcdir)/gasp.texi
+clean-aminfo:
-gasp.ps: gasp.dvi
- $(DVIPS) -o $@ $?
+distclean-aminfo:
-# This one isn't ready for prime time yet. Not even a little bit.
+maintainer-clean-aminfo:
+ for i in $(INFO_DEPS); do \
+ rm -f $$i; \
+ if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
+ rm -f $$i-[0-9]*; \
+ fi; \
+ done
+clean-info: mostlyclean-aminfo
+install-man: $(MANS)
+ $(NORMAL_INSTALL)
+ $(mkinstalldirs) $(mandir)/man1
+ @sect=1; \
+ inst=`echo "as" | sed '$(transform)'`.1; \
+ if test -f $(srcdir)/as.1; then file=$(srcdir)/as.1; \
+ else file=as.1; fi; \
+ echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
+ $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
+
+uninstall-man:
+ $(NORMAL_UNINSTALL)
+ -inst=`echo "as" | sed '$(transform)'`.1; \
+ rm -f $(mandir)/man1/$$inst
+
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = doc
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done
+ $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
+info: $(INFO_DEPS)
+dvi: $(DVIS)
+check:
+ $(MAKE)
+installcheck:
+install-info: install-info-am
+install-exec:
+ @$(NORMAL_INSTALL)
+
+install-data: install-man
+ @$(NORMAL_INSTALL)
+
+install: install-exec install-data all
+ @:
+
+uninstall: uninstall-man
+
+all: Makefile $(MANS)
+
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs:
+ $(mkinstalldirs) $(mandir)/man1
+
+
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean: mostlyclean-aminfo mostlyclean-generic
+
+clean: clean-aminfo clean-generic mostlyclean
+
+distclean: distclean-aminfo distclean-generic clean
+ -rm -f config.status
+ -rm -f libtool
+
+maintainer-clean: maintainer-clean-aminfo maintainer-clean-generic \
+ distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
+distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man \
+uninstall-man tags distdir info dvi installcheck install-info \
+install-exec install-data install uninstall all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+asconfig.texi: $(CONFIG).texi
+ rm -f asconfig.texi
+ ln -s $(srcdir)/$(CONFIG).texi ./asconfig.texi >/dev/null 2>&1 \
+ || ln $(srcdir)/$(CONFIG).texi ./asconfig.texi >/dev/null 2>&1 \
+ || cp $(srcdir)/$(CONFIG).texi ./asconfig.texi
+
+as.info: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS)
+as.dvi: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS)
-internals.info: $(srcdir)/internals.texi
- $(MAKEINFO) -o $@ $?
-
-internals.dvi: $(srcdir)/internals.texi
- TEXINPUTS=$(srcdir):$(TEXIDIR):$$TEXINPUTS MAKEINFO='$(MAKEINFO) -I$(srcdir)' \
- $(TEXI2DVI) $(srcdir)/internals.texi
-
-internals.ps: internals.dvi
- $(DVIPS) -o $@ $?
-
-internals.ps4: internals.ps
- psnup -4 <$? >$@
-
-# ROFF doc targets as.ms, as.mm, as.me
-# (we don't use a variable because we don't trust all makes to handle
-# a var in the target name right).
-# roff output (-ms)
-# THESE ARE PROBABLY BROKEN until texi2roff extended for Texinfo conditionals
-as.ms: $(srcdir)/as.texinfo asconfig.texi
- sed -e '/\\input texinfo/d' \
- -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
- -e 's/{.*,,/{/' \
- $(srcdir)/as.texinfo | \
- texi2roff -ms >as.ms
-
-# roff output (-mm)
-as.mm: $(srcdir)/as.texinfo asconfig.texi
- sed -e '/\\input texinfo/d' \
- -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
- -e 's/{.*,,/{/' \
- -e '/@noindent/d' \
- $(srcdir)/as.texinfo | \
- texi2roff -mm | \
- sed -e 's/---/\\(em/g' \
- >as.mm
-
-# roff output (-me)
-as.me: $(srcdir)/as.texinfo asconfig.texi
- sed -e '/\\input texinfo/d' \
- -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
- -e 's/{.*,,/{/' \
- $(srcdir)/as.texinfo | \
- texi2roff -me >as.me
-
-clean mostlyclean: clean-dvi clean-info
- rm -f asconfig.texi core *~
-
-distclean:
- rm -f Makefile config.status asconfig.texi \
- as.?? as.??s as.aux as.log as.toc \
- internals.?? internals.??s internals.aux internals.log internals.toc \
- gasp.?? gasp.??s gasp.aux gasp.log gasp.toc
-
-clean-dvi:
- rm -f as.?? as.??? gasp.?? gasp.??? internals.?? internals.???
-
-clean-info:
- rm -f as.info* gasp.info*
-
-maintainer-clean realclean: clean-info distclean
-
-force:
-
-Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
- (cd .. ; $(SHELL) ./config.status)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/binutils/gas/doc/all.texi b/contrib/binutils/gas/doc/all.texi
index 8476921..2638dbc 100644
--- a/contrib/binutils/gas/doc/all.texi
+++ b/contrib/binutils/gas/doc/all.texi
@@ -26,6 +26,8 @@
@c CPUs of interest
@c ================
@set A29K
+@set ARC
+@set ARM
@set D10V
@set H8/300
@set H8/500
@@ -33,12 +35,14 @@
@set I80386
@set I960
@set MIPS
+@set M32R
@set M680X0
@set Z8000
@set SPARC
@set VAX
@set VXWORKS
@set HPPA
+@set V850
@c Does this version of the assembler use the difference-table kluge?
@set DIFF-TBL-KLUGE
diff --git a/contrib/binutils/gas/doc/as.1 b/contrib/binutils/gas/doc/as.1
index 1ff0d0b..adf2886 100644
--- a/contrib/binutils/gas/doc/as.1
+++ b/contrib/binutils/gas/doc/as.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1991, 1992, 1996 Free Software Foundation
+.\" Copyright (c) 1991, 1992, 1996, 1997, 1998 Free Software Foundation
.\" See section COPYING for conditions for redistribution
.TH as 1 "29 March 1996" "cygnus support" "GNU Development Tools"
@@ -15,6 +15,7 @@ GNU as \- the portable GNU assembler.
.RB "[\|" \-D "\|]"
.RB "[\|" \-\-defsym\ SYM=VAL "\|]"
.RB "[\|" \-f "\|]"
+.RB "[\|" \-\-gstabs "\|]"
.RB "[\|" \-I
.I path\c
\&\|]
@@ -25,6 +26,7 @@ GNU as \- the portable GNU assembler.
.I objfile\c
\&\|]
.RB "[\|" \-R "\|]"
+.RB "[\|" \-\-traditional\-format "\|]"
.RB "[\|" \-v "\|]"
.RB "[\|" \-w "\|]"
.RB "[\|" \-\^\- "\ |\ " \c
@@ -163,6 +165,10 @@ to the search list for
.B .include
directives.
.TP
+.B \-\-gstabs
+Generate stabs debugging information for each assembler line. This
+may help debugging assembler code, if the debugger can handle it.
+.TP
.B \-K
Issue warnings when difference tables altered for long displacements.
.TP
@@ -181,6 +187,9 @@ Name the object-file output from \c
.B \-R
Fold data section into text section
.TP
+.B \-\-traditional\-format
+Use same format as native assembler, when possible.
+.TP
.B \-v
Announce \c
.B as\c
diff --git a/contrib/binutils/gas/doc/as.texinfo b/contrib/binutils/gas/doc/as.texinfo
index c6ad48f..7bfdc08 100644
--- a/contrib/binutils/gas/doc/as.texinfo
+++ b/contrib/binutils/gas/doc/as.texinfo
@@ -1,5 +1,6 @@
\input texinfo @c -*-Texinfo-*-
-@c Copyright (c) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+@c Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998
+@c Free Software Foundation, Inc.
@c UPDATE!! On future updates--
@c (1) check for new machine-dep cmdline options in
@c md_parse_option definitions in config/tc-*.c
@@ -20,6 +21,9 @@
@ifset AOUT
@set aout-bout
@end ifset
+@ifset ARM/Thumb
+@set ARM
+@end ifset
@ifset BOUT
@set aout-bout
@end ifset
@@ -82,7 +86,7 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the GNU Assembler "@value{AS}".
-Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -137,7 +141,7 @@ done.
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -196,16 +200,26 @@ Here is a brief summary of how to invoke @code{@value{AS}}. For details,
@c to be limited to one line for the header.
@smallexample
@value{AS} [ -a[cdhlns][=file] ] [ -D ] [ --defsym @var{sym}=@var{val} ]
- [ -f ] [ --help ] [ -I @var{dir} ] [ -J ] [ -K ] [ -L ]
- [ -o @var{objfile} ] [ -R ] [ --statistics ] [ -v ] [ -version ]
- [ --version ] [ -W ] [ -w ] [ -x ] [ -Z ]
+ [ -f ] [ --gstabs ] [ --help ] [ -I @var{dir} ] [ -J ] [ -K ] [ -L ]
+ [ --keep-locals ] [ -o @var{objfile} ] [ -R ] [ --statistics ] [ -v ]
+ [ -version ] [ --version ] [ -W ] [ -w ] [ -x ] [ -Z ]
@ifset A29K
@c am29k has no machine-dependent assembler options
@end ifset
+@ifset ARC
+ [ -mbig-endian | -mlittle-endian ]
+@end ifset
+@ifset ARM
+ [ -m[arm]1 | -m[arm]2 | -m[arm]250 | -m[arm]3 | -m[arm]6 | -m[arm]7[t][[d]m[i]] ]
+ [ -m[arm]v2 | -m[arm]v2a | -m[arm]v3 | -m[arm]v3m | -m[arm]v4 | -m[arm]v4t ]
+ [ -mthumb | -mall ]
+ [ -mfpa10 | -mfpa11 | -mfpe-old | -mno-fpu ]
+ [ -EB | -EL ]
+ [ -mapcs-32 | -mapcs-26 ]
+@end ifset
@ifset D10V
[ -O ]
@end ifset
-
@ifset H8
@c Hitachi family chips have no machine-dependent assembler options
@end ifset
@@ -214,8 +228,9 @@ Here is a brief summary of how to invoke @code{@value{AS}}. For details,
@end ifset
@ifset SPARC
@c The order here is important. See c-sparc.texi.
- [ -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite | -Av9 | -Av9a ]
- [ -xarch=v8plus | -xarch=v8plusa ] [ -bump ]
+ [ -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite
+ -Av8plus | -Av8plusa | -Av9 | -Av9a ]
+ [ -xarch=v8plus | -xarch=v8plusa ] [ -bump ] [ -32 | -64 ]
@end ifset
@ifset Z8000
@c Z8000 has no machine-dependent assembler options
@@ -238,10 +253,13 @@ Here is a brief summary of how to invoke @code{@value{AS}}. For details,
@end smallexample
@table @code
-@item -a[dhlns]
+@item -a[cdhlmns]
Turn on listings, in any of a variety of ways:
@table @code
+@item -ac
+omit false conditionals
+
@item -ad
omit debugging directives
@@ -251,6 +269,9 @@ include high-level source
@item -al
include assembly
+@item -am
+include macro expansions
+
@item -an
omit forms processing
@@ -263,8 +284,7 @@ set the name of the listing file
You may combine these options; for example, use @samp{-aln} for assembly
listing without forms processing. The @samp{=file} option, if used, must be
-the last one. By itself, @samp{-a} defaults to @samp{-ahls}---that is, all
-listings turned on.
+the last one. By itself, @samp{-a} defaults to @samp{-ahls}.
@item -D
Ignored. This option is accepted for script compatibility with calls to
@@ -279,6 +299,10 @@ indicates a hexadecimal value, and a leading @samp{0} indicates an octal value.
``fast''---skip whitespace and comment preprocessing (assume source is
compiler output).
+@item --gstabs
+Generate stabs debugging information for each assembler line. This
+may help debugging assembler code, if the debugger can handle it.
+
@item --help
Print a summary of the command line options and exit.
@@ -297,7 +321,10 @@ Issue warnings when difference tables altered for long displacements.
@end ifset
@item -L
-Keep (in the symbol table) local symbols, starting with @samp{L}.
+@itemx --keep-locals
+Keep (in the symbol table) local symbols. On traditional a.out systems
+these start with @samp{L}, but different systems have different local
+label prefixes.
@item -o @var{objfile}
Name the object-file output from @code{@value{AS}} @var{objfile}.
@@ -309,6 +336,9 @@ Fold the data section into the text section.
Print the maximum space (in bytes) and total time (in seconds) used by
assembly.
+@item --strip-local-absolute
+Remove local absolute symbols from the outgoing symbol table.
+
@item -v
@itemx -version
Print the @code{as} version.
@@ -352,6 +382,24 @@ Generate ``little endian'' format output.
@end table
@end ifset
+@ifset ARM
+The following options are available when @value{AS} is configured for the ARM
+processor family.
+
+@table @code
+@item -m[arm]1 | -m[arm]2 | -m[arm]250 | -m[arm]3 | -m[arm]6 | -m[arm]7[t][[d]m] | -m[arm]v2 | -m[arm]v2a | -m[arm]v3 | -m[arm]v3m | -m[arm]v4 | -m[arm]v4t
+Specify which variant of the ARM architecture is the target.
+@item -mthumb | -mall
+Enable or disable Thumb only instruction decoding.
+@item -mfpa10 | -mfpa11 | -mfpe-old | -mno-fpu
+Select which Floating Point architcture is the target.
+@item -mapcs-32 | -mapcs-26
+Select which procedure calling convention is in use.
+@item -EB | -EL
+Select either big-endian (-EB) or little-endian (-EL) output.
+@end table
+@end ifset
+
@ifset D10V
The following options are available when @value{AS} is configured for
a D10V processor.
@@ -363,6 +411,7 @@ Optimize output by parallelizing instructions.
@end table
@end ifset
+
@ifset I960
The following options are available when @value{AS} is configured for the
Intel 80960 processor.
@@ -381,6 +430,7 @@ error if necessary.
@end table
@end ifset
+
@ifset M680X0
The following options are available when @value{AS} is configured for the
Motorola 68000 series.
@@ -414,12 +464,19 @@ The following options are available when @code{@value{AS}} is configured
for the SPARC architecture:
@table @code
-@item -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite | -Av9 | -Av9a
+@item -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite
+@itemx -Av8plus | -Av8plusa | -Av9 | -Av9a
Explicitly select a variant of the SPARC architecture.
+@samp{-Av8plus} and @samp{-Av8plusa} select a 32 bit environment.
+@samp{-Av9} and @samp{-Av9a} select a 64 bit environment.
+
+@samp{-Av8plusa} and @samp{-Av9a} enable the SPARC V9 instruction set with
+UltraSPARC extensions.
+
@item -xarch=v8plus | -xarch=v8plusa
For compatibility with the Solaris v9 assembler. These options are
-equivalent to -Av9 and -Av9a, respectively.
+equivalent to -Av8plus and -Av8plusa, respectively.
@item -bump
Warn when the assembler switches to another architecture.
@@ -456,7 +513,7 @@ Generate code for a particular MIPS Instruction Set Architecture level.
processor.
@item -m4650
-@item -no-m4650
+@itemx -no-m4650
Generate code for the MIPS @sc{r4650} chip. This tells the assembler to accept
the @samp{mad} and @samp{madu} instruction, and to not schedule @samp{nop}
instructions around accesses to the @samp{HI} and @samp{LO} registers.
@@ -468,7 +525,7 @@ assembler, but it is passed by @code{@value{GCC}}.
@cindex emulation
@item --emulation=@var{name}
-This option causes @code{@value{AS}} to emulated @code{@value{AS}} configured
+This option causes @code{@value{AS}} to emulate @code{@value{AS}} configured
for some other target, in all respects, including output format (choosing
between ELF and ECOFF only), handling of pseudo-opcodes which may generate
debugging information or store symbol table information, and default
@@ -870,9 +927,11 @@ assembler.)
* L:: -L to retain local labels
* M:: -M or --mri to assemble in MRI compatibility mode
+* MD:: --MD for dependency tracking
* o:: -o to name the object file
* R:: -R to join data and text sections
* statistics:: --statistics to see statistics about assembly
+* traditional-format:: --traditional-format for compatible output
* v:: -v to announce version
* W:: -W to suppress warnings
* Z:: -Z to make object file even after errors
@@ -1004,6 +1063,9 @@ target is allowed to redefine the local label prefix.
@ifset HPPA
On the HPPA local labels begin with @samp{L$}.
@end ifset
+@ifset ARM
+@samp{;} for the ARM family;
+@end ifset
@node M
@section Assemble in MRI Compatibility Mode: @code{-M}
@@ -1136,6 +1198,21 @@ The i960 @code{.setreal} pseudo-op is not supported.
@end itemize
+@node MD
+@section Dependency tracking: @code{--MD}
+
+@kindex --MD
+@cindex dependency tracking
+@cindex make rules
+
+@code{@value{AS}} can generate a dependency file for the file it creates. This
+file consists of a single rule suitable for @code{make} describing the
+dependencies of the main source file.
+
+The rule is written to the file named in its argument.
+
+This feature is used in the automatic updating of makefiles.
+
@node o
@section Name the Object File: @code{-o}
@@ -1209,6 +1286,17 @@ Use @samp{--statistics} to display two statistics about the resources used by
(in bytes), and the total execution time taken for the assembly (in @sc{cpu}
seconds).
+@node traditional-format
+@section Compatible output: @code{--traditional-format}
+
+@kindex --traditional-format
+For some targets, the output of @code{@value{AS}} is different in some ways
+from the output of some existing assembler. This switch requests
+@code{@value{AS}} to use the traditional format instead.
+
+For example, it disables the exception frame optimizations which
+@code{@value{AS}} normally does by default on @code{@value{GCC}} output.
+
@node v
@section Announce Version: @code{-v}
@@ -1352,6 +1440,9 @@ is considered a comment and is ignored. The line comment character is
@ifset A29K
@samp{;} for the AMD 29K family;
@end ifset
+@ifset ARC
+@samp{;} on the ARC;
+@end ifset
@ifset H8/300
@samp{;} for the H8/300 family;
@end ifset
@@ -1370,6 +1461,9 @@ is considered a comment and is ignored. The line comment character is
@ifset SPARC
@samp{!} on the SPARC;
@end ifset
+@ifset M32R
+@samp{#} on the m32r;
+@end ifset
@ifset M680X0
@samp{|} on the 680x0;
@end ifset
@@ -1379,6 +1473,9 @@ is considered a comment and is ignored. The line comment character is
@ifset Z8000
@samp{!} for the Z8000;
@end ifset
+@ifset V850
+@samp{#} on the V850;
+@end ifset
see @ref{Machine Dependencies}. @refill
@c FIXME What about i386, m88k, i860?
@@ -1388,6 +1485,13 @@ character only begins a comment if it is the first non-whitespace character on
a line, while the other always begins a comment.
@end ifset
+@ifset V850
+The V850 assembler also supports a double dash as starting a comment that
+extends to the end of the line.
+
+@samp{--};
+@end ifset
+
@kindex #
@cindex lines starting with @code{#}
@cindex logical line numbers
@@ -1811,6 +1915,8 @@ Hitachi SH,
and AMD 29K architectures, the letter must be
one of the letters @samp{DFPRSX} (in upper or lower case).
+On the ARC, the letter must be one of the letters @samp{DFRS}
+(in upper or lower case).
On the Intel 960 architecture, the letter must be
one of the letters @samp{DFT} (in upper or lower case).
@@ -1821,6 +1927,9 @@ On the HPPA architecture, the letter must be @samp{E} (upper case only).
@ifset A29K
One of the letters @samp{DFPRSX} (in upper or lower case).
@end ifset
+@ifset ARC
+One of the letters @samp{DFRS} (in upper or lower case).
+@end ifset
@ifset H8
One of the letters @samp{DFPRSX} (in upper or lower case).
@end ifset
@@ -2943,8 +3052,6 @@ Some machine configurations provide additional directives.
* Sbttl:: @code{.sbttl "@var{subheading}"}
@ifset COFF
* Scl:: @code{.scl @var{class}}
-@end ifset
-@ifset COFF
* Section:: @code{.section @var{name}, @var{subsection}}
@end ifset
@@ -2956,6 +3063,7 @@ Some machine configurations provide additional directives.
@end ifset
* Skip:: @code{.skip @var{size} , @var{fill}}
+* Sleb128:: @code{.sleb128 @var{expressions}}
* Space:: @code{.space @var{size} , @var{fill}}
@ifset have-stabs
* Stab:: @code{.stabd, .stabn, .stabs}
@@ -2976,6 +3084,7 @@ Some machine configurations provide additional directives.
* Val:: @code{.val @var{addr}}
@end ifset
+* Uleb128:: @code{.uleb128 @var{expressions}}
* Word:: @code{.word @var{expressions}}
* Deprecated:: Deprecated Directives
@end menu
@@ -4206,6 +4315,14 @@ ignores it.
@end ifset
@end ifset
+@node Sleb128
+@section @code{.sleb128 @var{expressions}}
+
+@cindex @code{sleb128} directive
+@var{sleb128} stands for ``signed little endian base 128.'' This is a
+compact, variable length representation of numbers used by the DWARF
+symbolic debugging format. @xref{Uleb128,@code{.uleb128}}.
+
@ifclear no-space-dir
@node Skip
@section @code{.skip @var{size} , @var{fill}}
@@ -4436,6 +4553,14 @@ configured for @code{b.out}, it accepts this directive but ignores it.
@end ifset
@end ifset
+@node Uleb128
+@section @code{.uleb128 @var{expressions}}
+
+@cindex @code{uleb128} directive
+@var{uleb128} stands for ``unsigned little endian base 128.'' This is a
+compact, variable length representation of numbers used by the DWARF
+symbolic debugging format. @xref{Sleb128,@code{.sleb128}}.
+
@node Word
@section @code{.word @var{expressions}}
@@ -4536,6 +4661,12 @@ subject, see the hardware manufacturer's manual.
@ifset A29K
* AMD29K-Dependent:: AMD 29K Dependent Features
@end ifset
+@ifset ARC
+* ARC-Dependent:: ARC Dependent Features
+@end ifset
+@ifset ARM
+* ARM-Dependent:: ARM Dependent Features
+@end ifset
@ifset D10V
* D10V-Dependent:: D10V Dependent Features
@end ifset
@@ -4566,6 +4697,9 @@ subject, see the hardware manufacturer's manual.
@ifset SPARC
* Sparc-Dependent:: SPARC Dependent Features
@end ifset
+@ifset V850
+* V850-Dependent:: V850 Dependent Features
+@end ifset
@ifset Z8000
* Z8000-Dependent:: Z8000 Dependent Features
@end ifset
@@ -4585,11 +4719,91 @@ subject, see the hardware manufacturer's manual.
@c node and sectioning commands; hence the repetition of @chapter BLAH
@c in both conditional blocks.
+@ifset ARC
+@ifset GENERIC
+@page
+@node ARC-Dependent
+@chapter ARC Dependent Features
+@end ifset
+@ifclear GENERIC
+@node Machine Dependencies
+@chapter ARC Dependent Features
+@end ifclear
+
+@cindex ARC support
+@menu
+* ARC-Opts:: Options
+* ARC-Float:: Floating Point
+* ARC-Directives:: Sparc Machine Directives
+@end menu
+
+@node ARC-Opts
+@section Options
+
+@cindex options for ARC
+@cindex ARC options
+@cindex architectures, ARC
+@cindex ARC architectures
+The ARC chip family includes several successive levels (or other
+variants) of chip, using the same core instruction set, but including
+a few additional instructions at each level.
+
+By default, @code{@value{AS}} assumes the core instruction set (ARC
+base). The @code{.cpu} pseudo-op is intended to be used to select
+the variant.
+
+@table @code
+@cindex @code{-mbig-endian} option (ARC)
+@cindex @code{-mlittle-endian} option (ARC)
+@cindex ARC big-endian output
+@cindex ARC little-endian output
+@cindex big-endian output, ARC
+@cindex little-endian output, ARC
+@item -mbig-endian
+@itemx -mlittle-endian
+Any @sc{arc} configuration of @code{@value{AS}} can select big-endian or
+little-endian output at run time (unlike most other @sc{gnu} development
+tools, which must be configured for one or the other). Use
+@samp{-mbig-endian} to select big-endian output, and @samp{-mlittle-endian}
+for little-endian.
+@end table
+
+@node ARC-Float
+@section Floating Point
+
+@cindex floating point, ARC (@sc{ieee})
+@cindex ARC floating point (@sc{ieee})
+The ARC cpu family currently does not have hardware floating point
+support. Software floating point support is provided by @code{GCC}
+and uses @sc{ieee} floating-point numbers.
+
+@node ARC-Directives
+@section ARC Machine Directives
+
+@cindex ARC machine directives
+@cindex machine directives, ARC
+The ARC version of @code{@value{AS}} supports the following additional
+machine directives:
+
+@table @code
+@item .cpu
+@cindex @code{cpu} directive, SPARC
+This must be followed by the desired cpu.
+The ARC is intended to be customizable, @code{.cpu} is used to
+select the desired variant [though currently there are none].
+
+@end table
+
+@end ifset
@ifset A29K
@include c-a29k.texi
@end ifset
+@ifset ARM
+@include c-arm.texi
+@end ifset
+
@ifset Hitachi-all
@ifclear GENERIC
@node Machine Dependencies
@@ -4613,6 +4827,7 @@ family.
@include c-d10v.texi
@end ifset
+
@ifset H8/300
@include c-h8300.texi
@end ifset
@@ -4633,6 +4848,7 @@ family.
@include c-i960.texi
@end ifset
+
@ifset M680X0
@include c-m68k.texi
@end ifset
@@ -4661,6 +4877,10 @@ family.
@include c-vax.texi
@end ifset
+@ifset V850
+@include c-v850.texi
+@end ifset
+
@ifset GENERIC
@c reverse effect of @down at top of generic Machine-Dep chapter
@raisesections
@@ -4729,7 +4949,7 @@ individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
distribution.
In any event, we also recommend that you send bug reports for @code{@value{AS}}
-to @samp{bug-gnu-utils@@prep.ai.mit.edu}.
+to @samp{bug-gnu-utils@@gnu.org}.
The fundamental principle of reporting bugs usefully is this:
@strong{report all the facts}. If you are not sure whether to state a
diff --git a/contrib/binutils/gas/doc/c-i386.texi b/contrib/binutils/gas/doc/c-i386.texi
index 9cd3d4c..bb51be3 100644
--- a/contrib/binutils/gas/doc/c-i386.texi
+++ b/contrib/binutils/gas/doc/c-i386.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+@c Copyright (C) 1991, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@ifset GENERIC
@@ -388,17 +388,6 @@ only present in the @samp{fildq} (load quad integer to stack top) and
Register to register operations do not require opcode suffixes,
so that @samp{fst %st, %st(1)} is equivalent to @samp{fstl %st, %st(1)}.
-@cindex i386 @code{fwait} instruction
-@cindex @code{fwait instruction}, i386
-Since the 80387 automatically synchronizes with the 80386 @samp{fwait}
-instructions are almost never needed (this is not the case for the
-80286/80287 and 8086/8087 combinations). Therefore, @code{@value{AS}} suppresses
-the @samp{fwait} instruction whenever it is implicitly selected by one
-of the @samp{fn@dots{}} instructions. For example, @samp{fsave} and
-@samp{fnsave} are treated identically. In general, all the @samp{fn@dots{}}
-instructions are made equivalent to @samp{f@dots{}} instructions. If
-@samp{fwait} is desired it must be explicitly coded.
-
@node i386-16bit
@section Writing 16-bit Code
diff --git a/contrib/binutils/gas/doc/c-sh.texi b/contrib/binutils/gas/doc/c-sh.texi
index d7b410b..e20f554 100644
--- a/contrib/binutils/gas/doc/c-sh.texi
+++ b/contrib/binutils/gas/doc/c-sh.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+@c Copyright (C) 1991, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@page
@@ -137,11 +137,18 @@ with other development tools.
@node SH Directives
@section SH Machine Directives
-@cindex SH machine directives (none)
-@cindex machine directives, SH (none)
-@cindex @code{word} directive, SH
-@cindex @code{int} directive, SH
-@code{@value{AS}} has no machine-dependent directives for the SH.
+@cindex SH machine directives
+@cindex machine directives, SH
+@cindex @code{uaword} directive, SH
+@cindex @code{ualong} directive, SH
+
+@table @code
+@item uaword
+@itemx ualong
+@code{@value{AS}} will issue a warning when a misaligned @code{.word} or
+@code{.long} directive is used. You may use @code{.uaword} or
+@code{.ualong} to indicate that the value is intentionally misaligned.
+@end table
@node SH Opcodes
@section Opcodes
diff --git a/contrib/binutils/gas/doc/c-v850.texi b/contrib/binutils/gas/doc/c-v850.texi
new file mode 100644
index 0000000..a7608f4
--- /dev/null
+++ b/contrib/binutils/gas/doc/c-v850.texi
@@ -0,0 +1,308 @@
+@c Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+@c This is part of the GAS manual.
+@c For copying conditions, see the file as.texinfo.
+
+@node V850-Dependent
+@chapter v850 Dependent Features
+
+@cindex V850 support
+@menu
+* V850 Options:: Options
+* V850 Syntax:: Syntax
+* V850 Floating Point:: Floating Point
+* V850 Directives:: V850 Machine Directives
+* V850 Opcodes:: Opcodes
+@end menu
+
+@node V850 Options
+@section Options
+@cindex V850 options (none)
+@cindex options for V850 (none)
+@code{@value{AS}} supports the following additional command-line options
+for the V850 processor family:
+
+@cindex command line options, V850
+@cindex V850 command line options
+@table @code
+
+@cindex @code{-wsigned_overflow} command line option, V850
+@item -wsigned_overflow
+Causes warnings to be produced when signed immediate values overflow the
+space available for then within their opcodes. By default this option
+is disabled as it is possible to receive spurious warnings due to using
+exact bit patterns as immediate constants.
+
+@cindex @code{-wunsigned_overflow} command line option, V850
+@item -wunsigned_overflow
+Causes warnings to be produced when unsigned immediate values overflow
+the space available for then within their opcodes. By default this
+option is disabled as it is possible to receive spurious warnings due to
+using exact bit patterns as immediate constants.
+
+@cindex @code{-mv850} command line option, V850
+@item -mv850
+Specifies that the assembled code should be marked as being targeted at
+the V850 processor. This allows the linker to detect attempts to link
+such code with code assembled for other processors.
+
+
+
+@end table
+
+
+@node V850 Syntax
+@section Syntax
+@menu
+* V850-Chars:: Special Characters
+* V850-Regs:: Register Names
+@end menu
+
+@node V850-Chars
+@subsection Special Characters
+
+@cindex line comment character, V850
+@cindex V850 line comment character
+@samp{#} is the line comment character.
+@node V850-Regs
+@subsection Register Names
+
+@cindex V850 register names
+@cindex register names, V850
+@code{@value{AS}} supports the following names for registers:
+@table @code
+@cindex @code{zero} register, V850
+@item general register 0
+r0, zero
+@item general register 1
+r1
+@item general register 2
+r2, hp
+@cindex @code{sp} register, V850
+@item general register 3
+r3, sp
+@cindex @code{gp} register, V850
+@item general register 4
+r4, gp
+@cindex @code{tp} register, V850
+@item general register 5
+r5, tp
+@item general register 6
+r6
+@item general register 7
+r7
+@item general register 8
+r8
+@item general register 9
+r9
+@item general register 10
+r10
+@item general register 11
+r11
+@item general register 12
+r12
+@item general register 13
+r13
+@item general register 14
+r14
+@item general register 15
+r15
+@item general register 16
+r16
+@item general register 17
+r17
+@item general register 18
+r18
+@item general register 19
+r19
+@item general register 20
+r20
+@item general register 21
+r21
+@item general register 22
+r22
+@item general register 23
+r23
+@item general register 24
+r24
+@item general register 25
+r25
+@item general register 26
+r26
+@item general register 27
+r27
+@item general register 28
+r28
+@item general register 29
+r29
+@cindex @code{ep} register, V850
+@item general register 30
+r30, ep
+@cindex @code{lp} register, V850
+@item general register 31
+r31, lp
+@cindex @code{eipc} register, V850
+@item system register 0
+eipc
+@cindex @code{eipsw} register, V850
+@item system register 1
+eipsw
+@cindex @code{fepc} register, V850
+@item system register 2
+fepc
+@cindex @code{fepsw} register, V850
+@item system register 3
+fepsw
+@cindex @code{ecr} register, V850
+@item system register 4
+ecr
+@cindex @code{psw} register, V850
+@item system register 5
+psw
+@end table
+
+@node V850 Floating Point
+@section Floating Point
+
+@cindex floating point, V850 (@sc{ieee})
+@cindex V850 floating point (@sc{ieee})
+The V850 family uses @sc{ieee} floating-point numbers.
+
+@node V850 Directives
+@section V850 Machine Directives
+
+@cindex machine directives, V850
+@cindex V850 machine directives
+@table @code
+@cindex @code{offset} directive, V850
+@item .offset @var{<expression>}
+Moves the offset into the current section to the specified amount.
+
+@cindex @code{section} directive, V850
+@item .section "name", <type>
+This is an extension to the standard .section directive. It sets the
+current section to be <type> and creates an alias for this section
+called "name".
+
+@cindex @code{.v850} directive, V850
+@item .v850
+Specifies that the assembled code should be marked as being targeted at
+the V850 processor. This allows the linker to detect attempts to link
+such code with code assembled for other processors.
+
+
+
+@end table
+
+@node V850 Opcodes
+@section Opcodes
+
+@cindex V850 opcodes
+@cindex opcodes for V850
+@code{@value{AS}} implements all the standard V850 opcodes.
+
+@code{@value{AS}} also implements the following pseudo ops:
+
+@table @code
+
+@cindex @code{hi0} pseudo-op, V850
+@item hi0()
+Computes the higher 16 bits of the given expression and stores it into
+the immediate operand field of the given instruction. For example:
+
+ @samp{mulhi hi0(here - there), r5, r6}
+
+computes the difference between the address of labels 'here' and
+'there', takes the upper 16 bits of this difference, shifts it down 16
+bits and then mutliplies it by the lower 16 bits in register 5, putting
+the result into register 6.
+
+@cindex @code{lo} pseudo-op, V850
+@item lo()
+Computes the lower 16 bits of the given expression and stores it into
+the immediate operand field of the given instruction. For example:
+
+ @samp{addi lo(here - there), r5, r6}
+
+computes the difference between the address of labels 'here' and
+'there', takes the lower 16 bits of this difference and adds it to
+register 5, putting the result into register 6.
+
+@cindex @code{hi} pseudo-op, V850
+@item hi()
+Computes the higher 16 bits of the given expression and then adds the
+value of the most significant bit of the lower 16 bits of the expression
+and stores the result into the immediate operand field of the given
+instruction. For example the following code can be used to compute the
+address of the label 'here' and store it into register 6:
+
+ @samp{movhi hi(here), r0, r6}
+ @samp{movea lo(here), r6, r6}
+
+The reason for this special behaviour is that movea performs a sign
+extention on its immediate operand. So for example if the address of
+'here' was 0xFFFFFFFF then without the special behaviour of the hi()
+pseudo-op the movhi instruction would put 0xFFFF0000 into r6, then the
+movea instruction would takes its immediate operand, 0xFFFF, sign extend
+it to 32 bits, 0xFFFFFFFF, and then add it into r6 giving 0xFFFEFFFF
+which is wrong (the fifth nibble is E). With the hi() pseudo op adding
+in the top bit of the lo() pseudo op, the movhi instruction actually
+stores 0 into r6 (0xFFFF + 1 = 0x0000), so that the movea instruction
+stores 0xFFFFFFFF into r6 - the right value.
+
+
+@cindex @code{sdaoff} pseudo-op, V850
+@item sdaoff()
+Computes the offset of the named variable from the start of the Small
+Data Area (whoes address is held in register 4, the GP register) and
+stores the result as a 16 bit signed value in the immediate operand
+field of the given instruction. For example:
+
+ @samp{ld.w sdaoff(_a_variable)[gp],r6}
+
+loads the contents of the location pointed to by the label '_a_variable'
+into register 6, provided that the label is located somewhere within +/-
+32K of the address held in the GP register. [Note the linker assumes
+that the GP register contains a fixed address set to the address of the
+label called '__gp'. This can either be set up automatically by the
+linker, or specifically set by using the @samp{--defsym __gp=<value>}
+command line option].
+
+@cindex @code{tdaoff} pseudo-op, V850
+@item tdaoff()
+Computes the offset of the named variable from the start of the Tiny
+Data Area (whoes address is held in register 30, the EP register) and
+stores the result as a
+7 or 8 bit unsigned value in the immediate
+operand field of the given instruction. For example:
+
+ @samp{sld.w tdaoff(_a_variable)[ep],r6}
+
+loads the contents of the location pointed to by the label '_a_variable'
+into register 6, provided that the label is located somewhere within +256
+bytes of the address held in the EP register. [Note the linker assumes
+that the EP register contains a fixed address set to the address of the
+label called '__ep'. This can either be set up automatically by the
+linker, or specifically set by using the @samp{--defsym __ep=<value>}
+command line option].
+
+@cindex @code{zdaoff} pseudo-op, V850
+@item zdaoff()
+Computes the offset of the named variable from address 0 and stores the
+result as a 16 bit signed value in the immediate operand field of the
+given instruction. For example:
+
+ @samp{movea zdaoff(_a_variable),zero,r6}
+
+puts the address of the label '_a_variable' into register 6, assuming
+that the label is somewhere within the first 32K of memory. (Strictly
+speaking it also possible to access the last 32K of memory as well, as
+the offsets are signed).
+
+
+@end table
+
+
+For information on the V850 instruction set, see @cite{V850
+Family 32-/16-Bit single-Chip Microcontroller Architecture Manual} from NEC.
+Ltd.
+
diff --git a/contrib/binutils/gas/doc/internals.texi b/contrib/binutils/gas/doc/internals.texi
index ad57afd..eb9f44b 100644
--- a/contrib/binutils/gas/doc/internals.texi
+++ b/contrib/binutils/gas/doc/internals.texi
@@ -8,7 +8,7 @@
This chapter describes the internals of the assembler. It is incomplete, but
it may help a bit.
-This chapter was last modified on $Date: 1997/04/25 18:20:48 $. It is not updated regularly, and it
+This chapter was last modified on $Date: 1998/02/06 03:42:57 $. It is not updated regularly, and it
may be out of date.
@menu
@@ -469,11 +469,9 @@ This normally indicates the symbol to use when relaxing the frag according to
@item fr_opcode
Points to the lowest-addressed byte of the opcode, for use in relaxation.
-@item fr_pcrel_adjust
-@itemx fr_bsr
-These fields are only used in the NS32k configuration. But since @code{struct
-frag} is defined before the CPU-specific header files are included, they must
-unconditionally be defined.
+@item tc_frag_data
+Target specific fragment data of type TC_FRAG_TYPE.
+Only present if @code{TC_FRAG_TYPE} is defined.
@item fr_file
@itemx fr_line
@@ -506,11 +504,26 @@ This indicates that ``broken word'' processing should be done (@pxref{Broken
words}). If broken word processing is not necessary on the target machine,
this enumerator value will not be defined.
+@item rs_cfa
+This state is used to implement exception frame optimizations. The
+@code{fr_symbol} is an expression symbol for the subtraction which may be
+relaxed. The @code{fr_opcode} field holds the frag for the preceding command
+byte. The @code{fr_offset} field holds the offset within that frag. The
+@code{fr_subtype} field is used during relaxation to hold the current size of
+the frag.
+
@item rs_fill
The variable characters are to be repeated @code{fr_offset} times. If
@code{fr_offset} is 0, this frag has a length of @code{fr_fix}. Most frags
have this type.
+@item rs_leb128
+This state is used to implement the DWARF ``little endian base 128''
+variable length number format. The @code{fr_symbol} is always an expression
+symbol, as constant expressions are emitted directly. The @code{fr_offset}
+field is used during relaxation to hold the previous size of the number so
+that we can determine if the fragment changed size.
+
@item rs_machine_dependent
Displacement relaxation is to be done on this frag. The target is indicated by
@code{fr_symbol} and @code{fr_offset}, and @code{fr_subtype} indicates the
@@ -923,6 +936,21 @@ pseudo-op.
@cindex TC_CONS_FIX_NEW
You may define this macro to generate a fixup for a data allocation pseudo-op.
+@item TC_INIT_FIX_DATA (@var{fixp})
+@cindex TC_INIT_FIX_DATA
+A C statement to initialize the target specific fields of fixup @var{fixp}.
+These fields are defined with the @code{TC_FIX_TYPE} macro.
+
+@item TC_FIX_DATA_PRINT (@var{stream}, @var{fixp})
+@cindex TC_FIX_DATA_PRINT
+A C statement to output target specific debugging information for
+fixup @var{fixp} to @var{stream}. This macro is called by @code{print_fixup}.
+
+@item TC_FRAG_INIT (@var{fragp})
+@cindex TC_FRAG_INIT
+A C statement to initialize the target specific fields of frag @var{fragp}.
+These fields are defined with the @code{TC_FRAG_TYPE} macro.
+
@item md_number_to_chars
@cindex md_number_to_chars
This should just call either @code{number_to_chars_bigendian} or
@@ -1255,7 +1283,7 @@ the value to be stored is outside the range accessible by the current
addressing mode. The @code{fr_symbol} field of the frag indicates what symbol
is to be accessed; the @code{fr_offset} field is added in.
-If the @code{fr_pcrel_adjust} field is set, which currently should only happen
+If the @code{TC_PCREL_ADJUST} macro is defined, which currently should only happen
for the NS32k family, the @code{TC_PCREL_ADJUST} macro is called on the frag to
compute an adjustment to be made to the displacement.
diff --git a/contrib/binutils/gas/ecoff.c b/contrib/binutils/gas/ecoff.c
index 60e111f..0cb4d50 100644
--- a/contrib/binutils/gas/ecoff.c
+++ b/contrib/binutils/gas/ecoff.c
@@ -1,5 +1,5 @@
/* ECOFF debugging support.
- Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file was put together by Ian Lance Taylor <ian@cygnus.com>. A
good deal of it comes directly from mips-tfile.c, by Michael
@@ -768,13 +768,24 @@ enum aux_type {
If PAGE_SIZE is > 4096, the string length in the shash_t structure
can't be represented (assuming there are strings > 4096 bytes). */
+/* FIXME: Yes, there can be such strings while emitting C++ class debug
+ info. Templates are the offender here, the test case in question
+ having a mangled class name of
+
+ t7rb_tree4Z4xkeyZt4pair2ZC4xkeyZt7xsocket1Z4UserZt9select1st2Zt4pair\
+ 2ZC4xkeyZt7xsocket1Z4UserZ4xkeyZt4less1Z4xkey
+
+ Repeat that a couple dozen times while listing the class members and
+ you've got strings over 4k. Hack around this for now by increasing
+ the page size. A proper solution would abandon this structure scheme
+ certainly for very large strings, and possibly entirely. */
+
#ifndef PAGE_SIZE
-#define PAGE_SIZE 4096 /* size of varray pages */
+#define PAGE_SIZE (8*1024) /* size of varray pages */
#endif
#define PAGE_USIZE ((unsigned long) PAGE_SIZE)
-
#ifndef MAX_CLUSTER_PAGES /* # pages to get from system */
#define MAX_CLUSTER_PAGES 63
#endif
@@ -1046,13 +1057,13 @@ typedef union page {
forward_t forward [ PAGE_SIZE / sizeof (forward_t) ];
thead_t thead [ PAGE_SIZE / sizeof (thead_t) ];
lineno_list_t lineno [ PAGE_SIZE / sizeof (lineno_list_t) ];
-} page_t;
+} page_type;
/* Structure holding allocation information for small sized structures. */
typedef struct alloc_info {
char *alloc_name; /* name of this allocation type (must be first) */
- page_t *cur_page; /* current page being allocated from */
+ page_type *cur_page; /* current page being allocated from */
small_free_t free_list; /* current free list if any */
int unallocated; /* number of elements unallocated on page */
int total_alloc; /* total number of allocations */
@@ -1469,8 +1480,8 @@ static unsigned long ecoff_build_fdr
PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend,
unsigned long offset));
static void ecoff_setup_ext PARAMS ((void));
-static page_t *allocate_cluster PARAMS ((unsigned long npages));
-static page_t *allocate_page PARAMS ((void));
+static page_type *allocate_cluster PARAMS ((unsigned long npages));
+static page_type *allocate_page PARAMS ((void));
static scope_t *allocate_scope PARAMS ((void));
static void free_scope PARAMS ((scope_t *ptr));
static vlinks_t *allocate_vlinks PARAMS ((void));
@@ -1482,7 +1493,6 @@ static forward_t *allocate_forward PARAMS ((void));
static thead_t *allocate_thead PARAMS ((void));
static void free_thead PARAMS ((thead_t *ptr));
static lineno_list_t *allocate_lineno_list PARAMS ((void));
-static void generate_ecoff_stab PARAMS ((int, const char *, int, int, int));
/* This function should be called when the assembler starts up. */
@@ -1526,7 +1536,7 @@ add_varray_page (vp)
#ifdef MALLOC_CHECK
if (vp->object_size > 1)
- new_links->datum = (page_t *) xcalloc (1, vp->object_size);
+ new_links->datum = (page_type *) xcalloc (1, vp->object_size);
else
#endif
new_links->datum = allocate_page ();
@@ -2215,11 +2225,14 @@ add_file (file_name, indx, fake)
as_where (&file, (unsigned int *) NULL);
file_name = (const char *) file;
- if (! symbol_table_frozen)
- generate_asm_lineno = 1;
+ /* Automatically generate ECOFF debugging information, since I
+ think that's what other ECOFF assemblers do. We don't do
+ this if we see a .file directive with a string, since that
+ implies that some sort of debugging information is being
+ provided. */
+ if (! symbol_table_frozen && debug_type == DEBUG_NONE)
+ debug_type = DEBUG_ECOFF;
}
- else
- generate_asm_lineno = 0;
#ifndef NO_LISTING
if (listing)
@@ -2319,23 +2332,6 @@ add_file (file_name, indx, fake)
fil_ptr->int_type = add_aux_sym_tir (&int_type_info,
hash_yes,
&cur_file_ptr->thash_head[0]);
- /* gas used to have a bug that if the file does not have any
- symbol, it either will abort or will not build the file,
- the following is to get around that problem. ---kung*/
-#if 0
- if (generate_asm_lineno)
- {
- mark_stabs (0);
- (void) add_ecoff_symbol (file_name, st_Nil, sc_Nil,
- symbol_new ("L0\001", now_seg,
- (valueT) frag_now_fix (),
- frag_now),
- (bfd_vma) 0, 0, ECOFF_MARK_STAB (N_SO));
- (void) add_ecoff_symbol ("void:t1=1", st_Nil, sc_Nil,
- (symbolS *) NULL, (bfd_vma) 0, 0,
- ECOFF_MARK_STAB (N_LSYM));
- }
-#endif
}
}
@@ -2350,7 +2346,11 @@ ecoff_new_file (name)
if (cur_file_ptr != NULL && strcmp (cur_file_ptr->name, name) == 0)
return;
add_file (name, 0, 0);
- generate_asm_lineno = 1;
+
+ /* This is a hand coded assembler file, so automatically turn on
+ debugging information. */
+ if (debug_type == DEBUG_NONE)
+ debug_type = DEBUG_ECOFF;
}
#ifdef ECOFF_DEBUG
@@ -3058,25 +3058,11 @@ ecoff_directive_end (ignore)
if (ent == (symbolS *) NULL)
as_warn (".end directive names unknown symbol");
else
- {
- (void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text,
- symbol_new ("L0\001", now_seg,
- (valueT) frag_now_fix (),
- frag_now),
- (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
-
- if (stabs_seen && generate_asm_lineno)
- {
- char *n;
-
- n = xmalloc (strlen (name) + 4);
- strcpy (n, name);
- strcat (n, ":F1");
- (void) add_ecoff_symbol ((const char *) n, stGlobal, scText,
- ent, (bfd_vma) 0, 0,
- ECOFF_MARK_STAB (N_FUN));
- }
- }
+ (void) add_ecoff_symbol ((const char *) NULL, st_End, sc_Text,
+ symbol_new ("L0\001", now_seg,
+ (valueT) frag_now_fix (),
+ frag_now),
+ (bfd_vma) 0, (symint_t) 0, (symint_t) 0);
cur_proc_ptr = (proc_t *) NULL;
@@ -4297,6 +4283,11 @@ ecoff_build_symbols (backend, buf, bufend, offset)
&& local)
sym_ptr->ecoff_sym.asym.index = isym - ifilesym - 1;
sym_ptr->ecoff_sym.ifd = fil_ptr->file_index;
+
+ /* Don't try to merge an FDR which has an
+ external symbol attached to it. */
+ if (S_IS_EXTERNAL (as_sym) || S_IS_WEAK (as_sym))
+ fil_ptr->fdr.fMerge = 0;
}
}
}
@@ -4841,11 +4832,11 @@ ecoff_build_debug (hdr, bufp, backend)
#ifndef MALLOC_CHECK
-static page_t *
+static page_type *
allocate_cluster (npages)
unsigned long npages;
{
- register page_t *value = (page_t *) xmalloc (npages * PAGE_USIZE);
+ register page_type *value = (page_type *) xmalloc (npages * PAGE_USIZE);
#ifdef ECOFF_DEBUG
if (debug > 3)
@@ -4858,14 +4849,14 @@ allocate_cluster (npages)
}
-static page_t *cluster_ptr = NULL;
+static page_type *cluster_ptr = NULL;
static unsigned long pages_left = 0;
#endif /* MALLOC_CHECK */
/* Allocate one page (which is initialized to 0). */
-static page_t *
+static page_type *
allocate_page ()
{
#ifndef MALLOC_CHECK
@@ -4881,7 +4872,7 @@ allocate_page ()
#else /* MALLOC_CHECK */
- page_t *ptr;
+ page_type *ptr;
ptr = xmalloc (PAGE_USIZE);
memset (ptr, 0, PAGE_USIZE);
@@ -4906,7 +4897,7 @@ allocate_scope ()
else
{
register int unallocated = alloc_counts[(int)alloc_type_scope].unallocated;
- register page_t *cur_page = alloc_counts[(int)alloc_type_scope].cur_page;
+ register page_type *cur_page = alloc_counts[(int)alloc_type_scope].cur_page;
if (unallocated == 0)
{
@@ -4957,7 +4948,7 @@ allocate_vlinks ()
#ifndef MALLOC_CHECK
register int unallocated = alloc_counts[(int)alloc_type_vlinks].unallocated;
- register page_t *cur_page = alloc_counts[(int)alloc_type_vlinks].cur_page;
+ register page_type *cur_page = alloc_counts[(int)alloc_type_vlinks].cur_page;
if (unallocated == 0)
{
@@ -4991,7 +4982,7 @@ allocate_shash ()
#ifndef MALLOC_CHECK
register int unallocated = alloc_counts[(int)alloc_type_shash].unallocated;
- register page_t *cur_page = alloc_counts[(int)alloc_type_shash].cur_page;
+ register page_type *cur_page = alloc_counts[(int)alloc_type_shash].cur_page;
if (unallocated == 0)
{
@@ -5025,7 +5016,7 @@ allocate_thash ()
#ifndef MALLOC_CHECK
register int unallocated = alloc_counts[(int)alloc_type_thash].unallocated;
- register page_t *cur_page = alloc_counts[(int)alloc_type_thash].cur_page;
+ register page_type *cur_page = alloc_counts[(int)alloc_type_thash].cur_page;
if (unallocated == 0)
{
@@ -5064,7 +5055,7 @@ allocate_tag ()
else
{
register int unallocated = alloc_counts[(int)alloc_type_tag].unallocated;
- register page_t *cur_page = alloc_counts[(int)alloc_type_tag].cur_page;
+ register page_type *cur_page = alloc_counts[(int)alloc_type_tag].cur_page;
if (unallocated == 0)
{
@@ -5115,7 +5106,7 @@ allocate_forward ()
#ifndef MALLOC_CHECK
register int unallocated = alloc_counts[(int)alloc_type_forward].unallocated;
- register page_t *cur_page = alloc_counts[(int)alloc_type_forward].cur_page;
+ register page_type *cur_page = alloc_counts[(int)alloc_type_forward].cur_page;
if (unallocated == 0)
{
@@ -5154,7 +5145,7 @@ allocate_thead ()
else
{
register int unallocated = alloc_counts[(int)alloc_type_thead].unallocated;
- register page_t *cur_page = alloc_counts[(int)alloc_type_thead].cur_page;
+ register page_type *cur_page = alloc_counts[(int)alloc_type_thead].cur_page;
if (unallocated == 0)
{
@@ -5203,7 +5194,7 @@ allocate_lineno_list ()
#ifndef MALLOC_CHECK
register int unallocated = alloc_counts[(int)alloc_type_lineno].unallocated;
- register page_t *cur_page = alloc_counts[(int)alloc_type_lineno].cur_page;
+ register page_type *cur_page = alloc_counts[(int)alloc_type_lineno].cur_page;
if (unallocated == 0)
{
@@ -5243,103 +5234,6 @@ ecoff_set_gp_prolog_size (sz)
cur_proc_ptr->pdr.gp_used = 1;
}
-static void
-generate_ecoff_stab (what, string, type, other, desc)
- int what;
- const char *string;
- int type;
- int other;
- int desc;
-{
- efdr_t *save_file_ptr = cur_file_ptr;
- symbolS *sym;
- symint_t value;
- st_t st;
- sc_t sc;
- symint_t indx;
- localsym_t *hold = NULL;
-
- /* We don't handle .stabd. */
- if (what != 's' && what != 'n')
- {
- as_bad (".stab%c is not supported", what);
- return;
- }
-
- /* We ignore the other field. */
- if (other != 0)
- as_warn (".stab%c: ignoring non-zero other field", what);
-
- /* Make sure we have a current file. */
- if (cur_file_ptr == (efdr_t *) NULL)
- {
- add_file ((const char *) NULL, 0, 1);
- save_file_ptr = cur_file_ptr;
- }
-
- /* For stabs in ECOFF, the first symbol must be @stabs. This is a
- signal to gdb. */
- if (stabs_seen == 0)
- mark_stabs (0);
-
- /* Line number stabs are handled differently, since they have two
- values, the line number and the address of the label. We use the
- index field (aka desc) to hold the line number, and the value
- field to hold the address. The symbol type is st_Label, which
- should be different from the other stabs, so that gdb can
- recognize it. */
- if (type == N_SLINE)
- {
- SYMR dummy_symr;
-
-#ifndef NO_LISTING
- if (listing)
- listing_source_line ((unsigned int) desc);
-#endif
-
- dummy_symr.index = desc;
- if (dummy_symr.index != desc)
- {
- as_warn ("Line number (%d) for .stab%c directive cannot fit in index field (20 bits)",
- desc, what);
- return;
- }
-
- sym = symbol_find_or_make ((char *)string);
- value = 0;
- st = st_Label;
- sc = sc_Text;
- indx = desc;
- }
- else
- {
-#ifndef NO_LISTING
- if (listing && (type == N_SO || type == N_SOL))
- listing_source_file (string);
-#endif
-
- sym = symbol_find_or_make ((char *)string);
- sc = sc_Nil;
- st = st_Nil;
- value = 0;
- indx = ECOFF_MARK_STAB (type);
- }
-
- /* Don't store the stabs symbol we are creating as the type of the
- ECOFF symbol. We want to compute the type of the ECOFF symbol
- independently. */
- if (sym != (symbolS *) NULL)
- hold = sym->ecoff_symbol;
-
- (void) add_ecoff_symbol (string, st, sc, sym, (bfd_vma) 0, value, indx);
-
- if (sym != (symbolS *) NULL)
- sym->ecoff_symbol = hold;
-
- /* Restore normal file type. */
- cur_file_ptr = save_file_ptr;
-}
-
int
ecoff_no_current_file ()
{
@@ -5353,18 +5247,9 @@ ecoff_generate_asm_lineno (filename, lineno)
{
lineno_list_t *list;
- /* this potential can cause problem, when we start to see stab half the
- way thru the file */
-/*
- if (stabs_seen)
- ecoff_generate_asm_line_stab(filename, lineno);
-*/
-
- if (current_stabs_filename == (char *)NULL || strcmp (current_stabs_filename, filename))
- {
- add_file (filename, 0, 1);
- generate_asm_lineno = 1;
- }
+ if (current_stabs_filename == (char *)NULL
+ || strcmp (current_stabs_filename, filename))
+ add_file (filename, 0, 1);
list = allocate_lineno_list ();
@@ -5398,29 +5283,4 @@ ecoff_generate_asm_lineno (filename, lineno)
}
}
-static int line_label_cnt = 0;
-void
-ecoff_generate_asm_line_stab (filename, lineno)
- char *filename;
- int lineno;
-{
- char *ll;
-
- if (strcmp (current_stabs_filename, filename))
- {
- add_file (filename, 0, 1);
- generate_asm_lineno = 1;
- }
-
- line_label_cnt++;
- /* generate local label $LMnn */
- ll = xmalloc(10);
- sprintf(ll, "$LM%d", line_label_cnt);
- colon (ll);
-
- /* generate stab for the line */
- generate_ecoff_stab ('n', ll, N_SLINE, 0, lineno);
-
-}
-
#endif /* ECOFF_DEBUGGING */
diff --git a/contrib/binutils/gas/ecoff.h b/contrib/binutils/gas/ecoff.h
index a835477..68f2b03 100644
--- a/contrib/binutils/gas/ecoff.h
+++ b/contrib/binutils/gas/ecoff.h
@@ -1,5 +1,5 @@
/* ecoff.h -- header file for ECOFF debugging support
- Copyright (C) 1993, 94, 95, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Put together by Ian Lance Taylor <ian@cygnus.com>.
@@ -103,9 +103,5 @@ extern int ecoff_no_current_file PARAMS ((void));
file. */
extern void ecoff_generate_asm_lineno PARAMS ((const char *, int));
-/* This routine is called from read.c to generate line number stabs
- for .s file. */
-extern void ecoff_generate_asm_line_stab PARAMS ((char *, int));
-
#endif /* ! GAS_ECOFF_H */
#endif /* ECOFF_DEBUGGING */
diff --git a/contrib/binutils/gas/ehopt.c b/contrib/binutils/gas/ehopt.c
new file mode 100644
index 0000000..068e824
--- /dev/null
+++ b/contrib/binutils/gas/ehopt.c
@@ -0,0 +1,434 @@
+/* ehopt.c--optimize gcc exception frame information.
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor <ian@cygnus.com>.
+
+This file is part of GAS, the GNU Assembler.
+
+GAS is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GAS is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GAS; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#include "as.h"
+#include "subsegs.h"
+
+/* We include this ELF file, even though we may not be assembling for
+ ELF, since the exception frame information is always in a format
+ derived from DWARF. */
+
+#include "elf/dwarf2.h"
+
+/* Try to optimize gcc 2.8 exception frame information.
+
+ Exception frame information is emitted for every function in the
+ .eh_frame section. Simple information for a function with no
+ exceptions looks like this:
+
+__FRAME_BEGIN__:
+ .4byte .LLCIE1 / Length of Common Information Entry
+.LSCIE1:
+ .4byte 0x0 / CIE Identifier Tag
+ .byte 0x1 / CIE Version
+ .byte 0x0 / CIE Augmentation (none)
+ .byte 0x1 / ULEB128 0x1 (CIE Code Alignment Factor)
+ .byte 0x7c / SLEB128 -4 (CIE Data Alignment Factor)
+ .byte 0x8 / CIE RA Column
+ .byte 0xc / DW_CFA_def_cfa
+ .byte 0x4 / ULEB128 0x4
+ .byte 0x4 / ULEB128 0x4
+ .byte 0x88 / DW_CFA_offset, column 0x8
+ .byte 0x1 / ULEB128 0x1
+ .align 4
+.LECIE1:
+ .set .LLCIE1,.LECIE1-.LSCIE1 / CIE Length Symbol
+ .4byte .LLFDE1 / FDE Length
+.LSFDE1:
+ .4byte .LSFDE1-__FRAME_BEGIN__ / FDE CIE offset
+ .4byte .LFB1 / FDE initial location
+ .4byte .LFE1-.LFB1 / FDE address range
+ .byte 0x4 / DW_CFA_advance_loc4
+ .4byte .LCFI0-.LFB1
+ .byte 0xe / DW_CFA_def_cfa_offset
+ .byte 0x8 / ULEB128 0x8
+ .byte 0x85 / DW_CFA_offset, column 0x5
+ .byte 0x2 / ULEB128 0x2
+ .byte 0x4 / DW_CFA_advance_loc4
+ .4byte .LCFI1-.LCFI0
+ .byte 0xd / DW_CFA_def_cfa_register
+ .byte 0x5 / ULEB128 0x5
+ .byte 0x4 / DW_CFA_advance_loc4
+ .4byte .LCFI2-.LCFI1
+ .byte 0x2e / DW_CFA_GNU_args_size
+ .byte 0x4 / ULEB128 0x4
+ .byte 0x4 / DW_CFA_advance_loc4
+ .4byte .LCFI3-.LCFI2
+ .byte 0x2e / DW_CFA_GNU_args_size
+ .byte 0x0 / ULEB128 0x0
+ .align 4
+.LEFDE1:
+ .set .LLFDE1,.LEFDE1-.LSFDE1 / FDE Length Symbol
+
+ The immediate issue we can address in the assembler is the
+ DW_CFA_advance_loc4 followed by a four byte value. The value is
+ the difference of two addresses in the function. Since gcc does
+ not know this value, it always uses four bytes. We will know the
+ value at the end of assembly, so we can do better. */
+
+static int eh_frame_code_alignment PARAMS ((void));
+
+/* Get the code alignment factor from the CIE. */
+
+static int
+eh_frame_code_alignment ()
+{
+ static int code_alignment;
+ segT current_seg;
+ subsegT current_subseg;
+ fragS *f;
+ fixS *fix;
+ int offset;
+ char augmentation[10];
+ int iaug;
+
+ if (code_alignment != 0)
+ return code_alignment;
+
+ /* We should find the CIE at the start of the .eh_frame section. */
+
+ current_seg = now_seg;
+ current_subseg = now_subseg;
+ subseg_new (".eh_frame", 0);
+#if defined (BFD_ASSEMBLER) || defined (MANY_SEGMENTS)
+ f = seg_info (now_seg)->frchainP->frch_root;
+#else
+ f = frchain_now->frch_root;
+#endif
+#ifdef BFD_ASSEMBLER
+ fix = seg_info (now_seg)->frchainP->fix_root;
+#else
+ fix = *seg_fix_rootP;
+#endif
+ subseg_set (current_seg, current_subseg);
+
+ /* Look through the frags of the section to find the code alignment. */
+
+ /* First make sure that the CIE Identifier Tag is 0. */
+
+ offset = 4;
+ while (f != NULL && offset >= f->fr_fix)
+ {
+ offset -= f->fr_fix;
+ f = f->fr_next;
+ }
+ if (f == NULL
+ || f->fr_fix - offset < 4
+ || f->fr_literal[offset] != 0
+ || f->fr_literal[offset + 1] != 0
+ || f->fr_literal[offset + 2] != 0
+ || f->fr_literal[offset + 3] != 0)
+ {
+ code_alignment = -1;
+ return -1;
+ }
+
+ /* Next make sure the CIE version number is 1. */
+
+ offset += 4;
+ while (f != NULL && offset >= f->fr_fix)
+ {
+ offset -= f->fr_fix;
+ f = f->fr_next;
+ }
+ if (f == NULL
+ || f->fr_fix - offset < 1
+ || f->fr_literal[offset] != 1)
+ {
+ code_alignment = -1;
+ return -1;
+ }
+
+ /* Skip the augmentation (a null terminated string). */
+
+ iaug = 0;
+ ++offset;
+ while (1)
+ {
+ while (f != NULL && offset >= f->fr_fix)
+ {
+ offset -= f->fr_fix;
+ f = f->fr_next;
+ }
+ if (f == NULL)
+ {
+ code_alignment = -1;
+ return -1;
+ }
+ while (offset < f->fr_fix && f->fr_literal[offset] != '\0')
+ {
+ if ((size_t) iaug < (sizeof augmentation) - 1)
+ {
+ augmentation[iaug] = f->fr_literal[offset];
+ ++iaug;
+ }
+ ++offset;
+ }
+ if (offset < f->fr_fix)
+ break;
+ }
+ ++offset;
+ while (f != NULL && offset >= f->fr_fix)
+ {
+ offset -= f->fr_fix;
+ f = f->fr_next;
+ }
+ if (f == NULL)
+ {
+ code_alignment = -1;
+ return -1;
+ }
+
+ augmentation[iaug] = '\0';
+ if (augmentation[0] == '\0')
+ {
+ /* No augmentation. */
+ }
+ else if (strcmp (augmentation, "eh") == 0)
+ {
+ /* We have to skip a pointer. Unfortunately, we don't know how
+ large it is. We find out by looking for a matching fixup. */
+ while (fix != NULL
+ && (fix->fx_frag != f || fix->fx_where != offset))
+ fix = fix->fx_next;
+ if (fix == NULL)
+ offset += 4;
+ else
+ offset += fix->fx_size;
+ while (f != NULL && offset >= f->fr_fix)
+ {
+ offset -= f->fr_fix;
+ f = f->fr_next;
+ }
+ if (f == NULL)
+ {
+ code_alignment = -1;
+ return -1;
+ }
+ }
+ else
+ {
+ code_alignment = -1;
+ return -1;
+ }
+
+ /* We're now at the code alignment factor, which is a ULEB128. If
+ it isn't a single byte, forget it. */
+
+ code_alignment = f->fr_literal[offset] & 0xff;
+ if ((code_alignment & 0x80) != 0 || code_alignment == 0)
+ {
+ code_alignment = -1;
+ return -1;
+ }
+
+ return code_alignment;
+}
+
+/* This function is called from emit_expr. It looks for cases which
+ we can optimize.
+
+ Rather than try to parse all this information as we read it, we
+ look for a single byte DW_CFA_advance_loc4 followed by a 4 byte
+ difference. We turn that into a rs_cfa_advance frag, and handle
+ those frags at the end of the assembly. If the gcc output changes
+ somewhat, this optimization may stop working.
+
+ This function returns non-zero if it handled the expression and
+ emit_expr should not do anything, or zero otherwise. It can also
+ change *EXP and *PNBYTES. */
+
+int
+check_eh_frame (exp, pnbytes)
+ expressionS *exp;
+ unsigned int *pnbytes;
+{
+ static int saw_advance_loc4;
+ static fragS *loc4_frag;
+ static int loc4_fix;
+
+ if (flag_traditional_format)
+ {
+ /* Don't optimize. */
+ }
+ else if (strcmp (segment_name (now_seg), ".eh_frame") != 0)
+ saw_advance_loc4 = 0;
+ else if (*pnbytes == 1
+ && exp->X_op == O_constant
+ && exp->X_add_number == DW_CFA_advance_loc4)
+ {
+ /* This might be a DW_CFA_advance_loc4. Record the frag and the
+ position within the frag, so that we can change it later. */
+ saw_advance_loc4 = 1;
+ frag_grow (1);
+ loc4_frag = frag_now;
+ loc4_fix = frag_now_fix ();
+ }
+ else if (saw_advance_loc4
+ && *pnbytes == 4
+ && exp->X_op == O_constant)
+ {
+ int ca;
+
+ /* This is a case which we can optimize. The two symbols being
+ subtracted were in the same frag and the expression was
+ reduced to a constant. We can do the optimization entirely
+ in this function. */
+
+ saw_advance_loc4 = 0;
+
+ ca = eh_frame_code_alignment ();
+ if (ca < 0)
+ {
+ /* Don't optimize. */
+ }
+ else if (exp->X_add_number % ca == 0
+ && exp->X_add_number / ca < 0x40)
+ {
+ loc4_frag->fr_literal[loc4_fix]
+ = DW_CFA_advance_loc | (exp->X_add_number / ca);
+ /* No more bytes needed. */
+ return 1;
+ }
+ else if (exp->X_add_number < 0x100)
+ {
+ loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc1;
+ *pnbytes = 1;
+ }
+ else if (exp->X_add_number < 0x10000)
+ {
+ loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc2;
+ *pnbytes = 2;
+ }
+ }
+ else if (saw_advance_loc4
+ && *pnbytes == 4
+ && exp->X_op == O_subtract)
+ {
+
+ /* This is a case we can optimize. The expression was not
+ reduced, so we can not finish the optimization until the end
+ of the assembly. We set up a variant frag which we handle
+ later. */
+
+ saw_advance_loc4 = 0;
+
+ frag_var (rs_cfa, 4, 0, 0, make_expr_symbol (exp),
+ loc4_fix, (char *) loc4_frag);
+
+ return 1;
+ }
+ else
+ saw_advance_loc4 = 0;
+
+ return 0;
+}
+
+/* The function estimates the size of a rs_cfa variant frag based on
+ the current values of the symbols. It is called before the
+ relaxation loop. We set fr_subtype to the expected length. */
+
+int
+eh_frame_estimate_size_before_relax (frag)
+ fragS *frag;
+{
+ int ca;
+ offsetT diff;
+ int ret;
+
+ ca = eh_frame_code_alignment ();
+ diff = resolve_symbol_value (frag->fr_symbol, 0);
+
+ if (ca < 0)
+ ret = 4;
+ else if (diff % ca == 0 && diff / ca < 0x40)
+ ret = 0;
+ else if (diff < 0x100)
+ ret = 1;
+ else if (diff < 0x10000)
+ ret = 2;
+ else
+ ret = 4;
+
+ frag->fr_subtype = ret;
+
+ return ret;
+}
+
+/* This function relaxes a rs_cfa variant frag based on the current
+ values of the symbols. fr_subtype is the current length of the
+ frag. This returns the change in frag length. */
+
+int
+eh_frame_relax_frag (frag)
+ fragS *frag;
+{
+ int oldsize, newsize;
+
+ oldsize = frag->fr_subtype;
+ newsize = eh_frame_estimate_size_before_relax (frag);
+ return newsize - oldsize;
+}
+
+/* This function converts a rs_cfa variant frag into a normal fill
+ frag. This is called after all relaxation has been done.
+ fr_subtype will be the desired length of the frag. */
+
+void
+eh_frame_convert_frag (frag)
+ fragS *frag;
+{
+ offsetT diff;
+ fragS *loc4_frag;
+ int loc4_fix;
+
+ loc4_frag = (fragS *) frag->fr_opcode;
+ loc4_fix = (int) frag->fr_offset;
+
+ diff = resolve_symbol_value (frag->fr_symbol, 1);
+
+ if (frag->fr_subtype == 0)
+ {
+ int ca;
+
+ ca = eh_frame_code_alignment ();
+ assert (ca > 0 && diff % ca == 0 && diff / ca < 0x40);
+ loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc | (diff / ca);
+ }
+ else if (frag->fr_subtype == 1)
+ {
+ assert (diff < 0x100);
+ loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc1;
+ frag->fr_literal[frag->fr_fix] = diff;
+ }
+ else if (frag->fr_subtype == 2)
+ {
+ assert (diff < 0x10000);
+ loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc2;
+ md_number_to_chars (frag->fr_literal + frag->fr_fix, diff, 2);
+ }
+ else
+ md_number_to_chars (frag->fr_literal + frag->fr_fix, diff, 4);
+
+ frag->fr_fix += frag->fr_subtype;
+ frag->fr_type = rs_fill;
+ frag->fr_offset = 0;
+}
diff --git a/contrib/binutils/gas/expr.c b/contrib/binutils/gas/expr.c
index d69f65a..47e6933 100644
--- a/contrib/binutils/gas/expr.c
+++ b/contrib/binutils/gas/expr.c
@@ -1,5 +1,5 @@
/* expr.c -operands, expressions-
- Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -28,6 +28,7 @@
#include <ctype.h>
#include <string.h>
+#define min(a, b) ((a) < (b) ? (a) : (b))
#include "as.h"
#include "obstack.h"
@@ -85,7 +86,7 @@ make_expr_symbol (expressionP)
symbolP->sy_value = *expressionP;
if (expressionP->X_op == O_constant)
- resolve_symbol_value (symbolP);
+ resolve_symbol_value (symbolP, 1);
n = (struct expr_symbol_line *) xmalloc (sizeof *n);
n->sym = symbolP;
@@ -121,6 +122,62 @@ expr_symbol_where (sym, pfile, pline)
return 0;
}
+/* Utilities for building expressions.
+ Since complex expressions are recorded as symbols for use in other
+ expressions these return a symbolS * and not an expressionS *.
+ These explicitly do not take an "add_number" argument. */
+/* ??? For completeness' sake one might want expr_build_symbol.
+ It would just return its argument. */
+
+/* Build an expression for an unsigned constant.
+ The corresponding one for signed constants is missing because
+ there's currently no need for it. One could add an unsigned_p flag
+ but that seems more clumsy. */
+
+symbolS *
+expr_build_uconstant (value)
+ offsetT value;
+{
+ expressionS e;
+
+ e.X_op = O_constant;
+ e.X_add_number = value;
+ e.X_unsigned = 1;
+ return make_expr_symbol (&e);
+}
+
+/* Build an expression for OP s1. */
+
+symbolS *
+expr_build_unary (op, s1)
+ operatorT op;
+ symbolS *s1;
+{
+ expressionS e;
+
+ e.X_op = op;
+ e.X_add_symbol = s1;
+ e.X_add_number = 0;
+ return make_expr_symbol (&e);
+}
+
+/* Build an expression for s1 OP s2. */
+
+symbolS *
+expr_build_binary (op, s1, s2)
+ operatorT op;
+ symbolS *s1;
+ symbolS *s2;
+{
+ expressionS e;
+
+ e.X_op = op;
+ e.X_add_symbol = s1;
+ e.X_op_symbol = s2;
+ e.X_add_number = 0;
+ return make_expr_symbol (&e);
+}
+
/*
* Build any floating-point literal here.
* Also build any bignum literal here.
@@ -171,6 +228,32 @@ floating_constant (expressionP)
expressionP->X_add_number = -1;
}
+static valueT
+generic_bignum_to_int32 ()
+{
+ valueT number =
+ ((generic_bignum[1] & LITTLENUM_MASK) << LITTLENUM_NUMBER_OF_BITS)
+ | (generic_bignum[0] & LITTLENUM_MASK);
+ number &= 0xffffffff;
+ return number;
+}
+
+#ifdef BFD64
+static valueT
+generic_bignum_to_int64 ()
+{
+ valueT number =
+ ((((((((valueT) generic_bignum[3] & LITTLENUM_MASK)
+ << LITTLENUM_NUMBER_OF_BITS)
+ | ((valueT) generic_bignum[2] & LITTLENUM_MASK))
+ << LITTLENUM_NUMBER_OF_BITS)
+ | ((valueT) generic_bignum[1] & LITTLENUM_MASK))
+ << LITTLENUM_NUMBER_OF_BITS)
+ | ((valueT) generic_bignum[0] & LITTLENUM_MASK));
+ return number;
+}
+#endif
+
static void
integer_constant (radix, expressionP)
int radix;
@@ -219,7 +302,9 @@ integer_constant (radix, expressionP)
/* In MRI mode, the number may have a suffix indicating the
radix. For that matter, it might actually be a floating
point constant. */
- for (suffix = input_line_pointer; isalnum (*suffix); suffix++)
+ for (suffix = input_line_pointer;
+ isalnum ((unsigned char) *suffix);
+ suffix++)
{
if (*suffix == 'e' || *suffix == 'E')
flt = 1;
@@ -233,7 +318,7 @@ integer_constant (radix, expressionP)
else
{
c = *--suffix;
- if (islower (c))
+ if (islower ((unsigned char) c))
c = toupper (c);
if (c == 'B')
radix = 2;
@@ -286,7 +371,83 @@ integer_constant (radix, expressionP)
/* c contains character after number. */
/* input_line_pointer->char after c. */
small = (input_line_pointer - start - 1) < too_many_digits;
- if (!small)
+
+ if (radix == 16 && c == '_')
+ {
+ /* This is literal of the form 0x333_0_12345678_1.
+ This example is equivalent to 0x00000333000000001234567800000001. */
+
+ int num_little_digits = 0;
+ int i;
+ input_line_pointer = start; /*->1st digit. */
+
+ know (LITTLENUM_NUMBER_OF_BITS == 16);
+
+ for (c = '_'; c == '_'; num_little_digits+=2)
+ {
+
+ /* Convert one 64-bit word. */
+ int ndigit = 0;
+ number = 0;
+ for (c = *input_line_pointer++;
+ (digit = hex_value (c)) < maxdig;
+ c = *(input_line_pointer++))
+ {
+ number = number * radix + digit;
+ ndigit++;
+ }
+
+ /* Check for 8 digit per word max. */
+ if (ndigit > 8)
+ as_bad ("An bignum with underscores may not have more than 8 hex digits in any word.");
+
+ /* Add this chunk to the bignum. Shift things down 2 little digits.*/
+ know (LITTLENUM_NUMBER_OF_BITS == 16);
+ for (i = min (num_little_digits + 1, SIZE_OF_LARGE_NUMBER - 1); i >= 2; i--)
+ generic_bignum[i] = generic_bignum[i-2];
+
+ /* Add the new digits as the least significant new ones. */
+ generic_bignum[0] = number & 0xffffffff;
+ generic_bignum[1] = number >> 16;
+ }
+
+ /* Again, c is char after number, input_line_pointer->after c. */
+
+ if (num_little_digits > SIZE_OF_LARGE_NUMBER - 1)
+ num_little_digits = SIZE_OF_LARGE_NUMBER - 1;
+
+ assert (num_little_digits >= 4);
+
+ if (num_little_digits != 8)
+ as_bad ("A bignum with underscores must have exactly 4 words.");
+
+ /* We might have some leading zeros. These can be trimmed to give
+ * us a change to fit this constant into a small number.
+ */
+ while (generic_bignum[num_little_digits-1] == 0 && num_little_digits > 1)
+ num_little_digits--;
+
+ if (num_little_digits <= 2)
+ {
+ /* will fit into 32 bits. */
+ number = generic_bignum_to_int32 ();
+ small = 1;
+ }
+#ifdef BFD64
+ else if (num_little_digits <= 4)
+ {
+ /* Will fit into 64 bits. */
+ number = generic_bignum_to_int64 ();
+ small = 1;
+ }
+#endif
+ else
+ {
+ small = 0;
+ number = num_little_digits; /* number of littlenums in the bignum. */
+ }
+ }
+ else if (!small)
{
/*
* we saw a lot of digits. manufacture a bignum the hard way.
@@ -298,6 +459,8 @@ integer_constant (radix, expressionP)
leader = generic_bignum;
generic_bignum[0] = 0;
generic_bignum[1] = 0;
+ generic_bignum[2] = 0;
+ generic_bignum[3] = 0;
input_line_pointer = start; /*->1st digit. */
c = *input_line_pointer++;
for (;
@@ -329,11 +492,17 @@ integer_constant (radix, expressionP)
if (leader < generic_bignum + 2)
{
/* will fit into 32 bits. */
- number =
- ((generic_bignum[1] & LITTLENUM_MASK) << LITTLENUM_NUMBER_OF_BITS)
- | (generic_bignum[0] & LITTLENUM_MASK);
+ number = generic_bignum_to_int32 ();
small = 1;
}
+#ifdef BFD64
+ else if (leader < generic_bignum + 4)
+ {
+ /* Will fit into 64 bits. */
+ number = generic_bignum_to_int64 ();
+ small = 1;
+ }
+#endif
else
{
number = leader - generic_bignum + 1; /* number of littlenums in the bignum. */
@@ -651,7 +820,8 @@ operand (expressionP)
{
input_line_pointer++;
floating_constant (expressionP);
- expressionP->X_add_number = -(isupper (c) ? tolower (c) : c);
+ expressionP->X_add_number =
+ - (isupper ((unsigned char) c) ? tolower (c) : c);
}
else
{
@@ -766,7 +936,8 @@ operand (expressionP)
case 'G':
input_line_pointer++;
floating_constant (expressionP);
- expressionP->X_add_number = -(isupper (c) ? tolower (c) : c);
+ expressionP->X_add_number =
+ - (isupper ((unsigned char) c) ? tolower (c) : c);
break;
case '$':
@@ -1328,6 +1499,13 @@ operator ()
++input_line_pointer;
return ret;
+ case '=':
+ if (input_line_pointer[1] != '=')
+ return op_encoding[c];
+
+ ++input_line_pointer;
+ return O_eq;
+
case '>':
switch (input_line_pointer[1])
{
@@ -1370,7 +1548,7 @@ operator ()
}
/*NOTREACHED*/
-}
+}
/* Parse an expression. */
diff --git a/contrib/binutils/gas/expr.h b/contrib/binutils/gas/expr.h
index 5002556..a963148 100644
--- a/contrib/binutils/gas/expr.h
+++ b/contrib/binutils/gas/expr.h
@@ -1,5 +1,5 @@
/* expr.h -> header file for expr.c
- Copyright (C) 1987, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 92-97, 1998 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -152,4 +152,9 @@ extern struct symbol *make_expr_symbol PARAMS ((expressionS * expressionP));
extern int expr_symbol_where
PARAMS ((struct symbol *, char **, unsigned int *));
+extern struct symbol * expr_build_uconstant PARAMS ((offsetT));
+extern struct symbol * expr_build_unary PARAMS ((operatorT, struct symbol *));
+extern struct symbol * expr_build_binary
+ PARAMS ((operatorT, struct symbol *, struct symbol *));
+
/* end of expr.h */
diff --git a/contrib/binutils/gas/frags.c b/contrib/binutils/gas/frags.c
index 0418b40..aa22f35 100644
--- a/contrib/binutils/gas/frags.c
+++ b/contrib/binutils/gas/frags.c
@@ -1,5 +1,5 @@
/* frags.c - manage frags -
- Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -218,10 +218,9 @@ frag_var (type, max_chars, var, subtype, symbol, offset, opcode)
frag_now->fr_symbol = symbol;
frag_now->fr_offset = offset;
frag_now->fr_opcode = opcode;
- /* Default these to zero. Only the ns32k uses these but they can't be
- conditionally included in `struct frag'. See as.h. */
- frag_now->fr_targ.ns32k.pcrel_adjust = 0;
- frag_now->fr_targ.ns32k.bsr = 0;
+#ifdef TC_FRAG_INIT
+ TC_FRAG_INIT (frag_now);
+#endif
as_where (&frag_now->fr_file, &frag_now->fr_line);
frag_new (max_chars);
return (retval);
@@ -254,10 +253,9 @@ frag_variant (type, max_chars, var, subtype, symbol, offset, opcode)
frag_now->fr_symbol = symbol;
frag_now->fr_offset = offset;
frag_now->fr_opcode = opcode;
- /* Default these to zero. Only the ns32k uses these but they can't be
- conditionally included in `struct frag'. See as.h. */
- frag_now->fr_targ.ns32k.pcrel_adjust = 0;
- frag_now->fr_targ.ns32k.bsr = 0;
+#ifdef TC_FRAG_INIT
+ TC_FRAG_INIT (frag_now);
+#endif
as_where (&frag_now->fr_file, &frag_now->fr_line);
frag_new (max_chars);
return (retval);
@@ -296,7 +294,7 @@ frag_align (alignment, fill_character, max)
new_off = ((abs_section_offset + alignment - 1)
&~ ((1 << alignment) - 1));
- if (max == 0 || new_off - abs_section_offset <= max)
+ if (max == 0 || new_off - abs_section_offset <= (addressT) max)
abs_section_offset = new_off;
}
else
@@ -330,13 +328,13 @@ frag_align_pattern (alignment, fill_pattern, n_fill, max)
memcpy (p, fill_pattern, n_fill);
}
-int
+addressT
frag_now_fix ()
{
if (now_seg == absolute_section)
return abs_section_offset;
- return ((char*)obstack_next_free (&frchain_now->frch_obstack)
- - frag_now->fr_literal);
+ return (addressT) ((char*) obstack_next_free (&frchain_now->frch_obstack)
+ - frag_now->fr_literal);
}
void
diff --git a/contrib/binutils/gas/frags.h b/contrib/binutils/gas/frags.h
index 53877a9..fa834ee 100644
--- a/contrib/binutils/gas/frags.h
+++ b/contrib/binutils/gas/frags.h
@@ -1,5 +1,6 @@
/* frags.h - Header file for the frag concept.
- Copyright (C) 1987, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 92, 93, 94, 95, 97, 1998
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -18,10 +19,90 @@
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
+#ifndef FRAGS_H
+#define FRAGS_H
+
#ifdef ANSI_PROTOTYPES
struct obstack;
#endif
+/*
+ * A code fragment (frag) is some known number of chars, followed by some
+ * unknown number of chars. Typically the unknown number of chars is an
+ * instruction address whose size is yet unknown. We always know the greatest
+ * possible size the unknown number of chars may become, and reserve that
+ * much room at the end of the frag.
+ * Once created, frags do not change address during assembly.
+ * We chain the frags in (a) forward-linked list(s). The object-file address
+ * of the 1st char of a frag is generally not known until after relax().
+ * Many things at assembly time describe an address by {object-file-address
+ * of a particular frag}+offset.
+
+ BUG: it may be smarter to have a single pointer off to various different
+ notes for different frag kinds. See how code pans
+ */
+
+struct frag
+{
+ /* Object file address. */
+ addressT fr_address;
+ /* Chain forward; ascending address order. Rooted in frch_root. */
+ struct frag *fr_next;
+
+ /* (Fixed) number of chars we know we have. May be 0. */
+ offsetT fr_fix;
+ /* (Variable) number of chars after above. May be 0. */
+ offsetT fr_var;
+ /* For variable-length tail. */
+ struct symbol *fr_symbol;
+ /* For variable-length tail. */
+ offsetT fr_offset;
+ /* Points to opcode low addr byte, for relaxation. */
+ char *fr_opcode;
+
+#ifndef NO_LISTING
+ struct list_info_struct *line;
+#endif
+
+ /* What state is my tail in? */
+ relax_stateT fr_type;
+ relax_substateT fr_subtype;
+
+#ifdef USING_CGEN
+ /* Don't include this unless using CGEN to keep frag size down. */
+ struct {
+ const struct cgen_insn *insn;
+ unsigned char opindex, opinfo;
+ } fr_cgen;
+#endif
+
+#ifdef TC_FRAG_TYPE
+ TC_FRAG_TYPE tc_frag_data;
+#endif
+
+ /* Where the frag was created, or where it became a variant frag. */
+ char *fr_file;
+ unsigned int fr_line;
+
+ /* Data begins here. */
+ char fr_literal[1];
+};
+
+#define SIZEOF_STRUCT_FRAG \
+((char *)zero_address_frag.fr_literal-(char *)&zero_address_frag)
+/* We want to say fr_literal[0] above. */
+
+/* Current frag we are building. This frag is incomplete. It is,
+ however, included in frchain_now. The fr_fix field is bogus;
+ instead, use frag_now_fix (). */
+COMMON fragS *frag_now;
+extern addressT frag_now_fix PARAMS ((void));
+
+/* For foreign-segment symbol fixups. */
+COMMON fragS zero_address_frag;
+/* For local common (N_BSS segment) fixups. */
+COMMON fragS bss_address_frag;
+
#if 0
/*
* A macro to speed up appending exactly 1 char
@@ -70,4 +151,4 @@ char *frag_var PARAMS ((relax_stateT type,
offsetT offset,
char *opcode));
-/* end of frags.h */
+#endif /* FRAGS_H */
diff --git a/contrib/binutils/gas/gasp.c b/contrib/binutils/gas/gasp.c
index 3fb51b8..d64c242 100644
--- a/contrib/binutils/gas/gasp.c
+++ b/contrib/binutils/gas/gasp.c
@@ -1,5 +1,5 @@
/* gasp.c - Gnu assembler preprocessor main program.
- Copyright (C) 1994, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
@@ -105,12 +105,12 @@ FILE *outfile;
#define WHITEBIT 8
#define COMMENTBIT 16
#define BASEBIT 32
-#define ISCOMMENTCHAR(x) (chartype[(unsigned)(x)] & COMMENTBIT)
-#define ISFIRSTCHAR(x) (chartype[(unsigned)(x)] & FIRSTBIT)
-#define ISNEXTCHAR(x) (chartype[(unsigned)(x)] & NEXTBIT)
-#define ISSEP(x) (chartype[(unsigned)(x)] & SEPBIT)
-#define ISWHITE(x) (chartype[(unsigned)(x)] & WHITEBIT)
-#define ISBASE(x) (chartype[(unsigned)(x)] & BASEBIT)
+#define ISCOMMENTCHAR(x) (chartype[(unsigned char)(x)] & COMMENTBIT)
+#define ISFIRSTCHAR(x) (chartype[(unsigned char)(x)] & FIRSTBIT)
+#define ISNEXTCHAR(x) (chartype[(unsigned char)(x)] & NEXTBIT)
+#define ISSEP(x) (chartype[(unsigned char)(x)] & SEPBIT)
+#define ISWHITE(x) (chartype[(unsigned char)(x)] & WHITEBIT)
+#define ISBASE(x) (chartype[(unsigned char)(x)] & BASEBIT)
static char chartype[256];
@@ -607,7 +607,7 @@ level_0 (idx, string, lhs)
lhs->value = 0;
- if (isdigit (string->ptr[idx]))
+ if (isdigit ((unsigned char) string->ptr[idx]))
{
idx = sb_strtol (idx, string, 10, &lhs->value);
}
@@ -1165,7 +1165,7 @@ change_base (idx, in, out)
idx++;
}
}
- else if (isdigit (in->ptr[idx]))
+ else if (isdigit ((unsigned char) in->ptr[idx]))
{
int value;
/* all numbers must start with a digit, let's chew it and
@@ -1717,7 +1717,7 @@ doinstr (idx, in, out)
idx = sb_skip_comma (idx, in);
idx = get_and_process (idx, in, &search);
idx = sb_skip_comma (idx, in);
- if (isdigit (in->ptr[idx]))
+ if (isdigit ((unsigned char) in->ptr[idx]))
{
idx = exp_get_abs (".instr needs absolute expresson.\n", idx, in, &start);
}
@@ -3579,7 +3579,7 @@ Usage: %s \n\
[-Ipath] add to include path list\n\
[in-file]\n");
if (status == 0)
- printf ("\nReport bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ printf ("\nReport bugs to bug-gnu-utils@gnu.org\n");
exit (status);
}
@@ -3630,6 +3630,7 @@ main (argc, argv)
case 'I':
{
include_path *p = (include_path *) xmalloc (sizeof (include_path));
+ p->next = NULL;
sb_new (&p->path);
sb_add_string (&p->path, optarg);
if (paths_tail)
diff --git a/contrib/binutils/gas/hash.c b/contrib/binutils/gas/hash.c
index 51a3d84..dccd660 100644
--- a/contrib/binutils/gas/hash.c
+++ b/contrib/binutils/gas/hash.c
@@ -1,5 +1,5 @@
/* hash.c - hash table lookup strings -
- Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 1996
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -705,7 +705,7 @@ hash_ask (handle, string, access_type)
hash_found = TRUE;
break;
}
- if (slot->h == hcode)
+ if (slot->h == (unsigned long) hcode)
{
if (!strcmp (string, s))
{
@@ -735,7 +735,7 @@ hash_ask (handle, string, access_type)
hash_found = TRUE;
break;
}
- if (slot->h == hcode)
+ if (slot->h == (unsigned long) hcode)
{
if (!strcmp (string, s))
{
diff --git a/contrib/binutils/gas/input-scrub.c b/contrib/binutils/gas/input-scrub.c
index 5271065..fee00f3 100644
--- a/contrib/binutils/gas/input-scrub.c
+++ b/contrib/binutils/gas/input-scrub.c
@@ -265,8 +265,11 @@ input_scrub_include_sb (from, position)
next_saved_file = input_scrub_push (position);
sb_new (&from_sb);
- /* Add the sentinel required by read.c. */
- sb_add_char (&from_sb, '\n');
+ if (from->len >= 1 && from->ptr[0] != '\n')
+ {
+ /* Add the sentinel required by read.c. */
+ sb_add_char (&from_sb, '\n');
+ }
sb_add_sb (&from_sb, from);
sb_index = 1;
@@ -408,21 +411,27 @@ bump_line_counters ()
* to support the .appfile pseudo-op inserted into the stream by
* do_scrub_chars).
* If the fname is NULL, we don't change the current logical file name.
+ * Returns nonzero if the filename actually changes.
*/
-void
+int
new_logical_line (fname, line_number)
char *fname; /* DON'T destroy it! We point to it! */
int line_number;
{
- if (fname)
- {
- logical_input_file = fname;
- } /* if we have a file name */
-
if (line_number >= 0)
logical_input_line = line_number;
else if (line_number == -2 && logical_input_line > 0)
--logical_input_line;
+
+ if (fname
+ && (logical_input_file == NULL
+ || strcmp (logical_input_file, fname)))
+ {
+ logical_input_file = fname;
+ return 1;
+ }
+ else
+ return 0;
} /* new_logical_line() */
/*
diff --git a/contrib/binutils/gas/itbl-lex.l b/contrib/binutils/gas/itbl-lex.l
index 1703eda..a905ddd 100644
--- a/contrib/binutils/gas/itbl-lex.l
+++ b/contrib/binutils/gas/itbl-lex.l
@@ -105,8 +105,10 @@ HEX [0-9A-Fa-f]
}
%%
+#ifndef yywrap
int
yywrap ()
{
return 1;
}
+#endif
diff --git a/contrib/binutils/gas/listing.c b/contrib/binutils/gas/listing.c
index f0c2295..2fa8ae9 100644
--- a/contrib/binutils/gas/listing.c
+++ b/contrib/binutils/gas/listing.c
@@ -1,5 +1,6 @@
/* listing.c - mainting assembly listings
- Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -100,6 +101,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "subsegs.h"
#ifndef NO_LISTING
+
#ifndef LISTING_HEADER
#define LISTING_HEADER "GAS LISTING"
#endif
@@ -119,45 +121,42 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define LISTING_LHS_CONT_LINES 4
#endif
-
-
-
/* This structure remembers which .s were used */
typedef struct file_info_struct
{
- char *filename;
- int linenum;
- FILE *file;
struct file_info_struct *next;
+ char *filename;
+ long pos;
+ unsigned int linenum;
int at_end;
}
-
file_info_type;
/* this structure rememebrs which line from which file goes into which
frag */
-typedef struct list_info_struct
+struct list_info_struct
{
/* Frag which this line of source is nearest to */
fragS *frag;
+
/* The actual line in the source file */
unsigned int line;
/* Pointer to the file info struct for the file which this line
belongs to */
file_info_type *file;
+ /* The expanded text of any macro that may have been executing. */
+ char *line_contents;
+
/* Next in list */
struct list_info_struct *next;
-
/* Pointer to the file info struct for the high level language
source line that belongs here */
file_info_type *hll_file;
-
/* High level language source line */
- int hll_line;
-
+ unsigned int hll_line;
/* Pointer to any error message associated with this line */
char *message;
@@ -174,10 +173,13 @@ typedef struct list_info_struct
} edict;
char *edict_arg;
-}
-
-list_info_type;
+ /* Nonzero if this line is to be omitted because it contains
+ debugging information. This can become a flags field if we come
+ up with more information to store here. */
+ int debugging;
+};
+typedef struct list_info_struct list_info_type;
static struct list_info_struct *head;
struct list_info_struct *listing_tail;
@@ -189,15 +191,16 @@ static int paper_height = 60;
/* File to output listings to. */
static FILE *list_file;
-/* this static array is used to keep the text of data to be printed
- before the start of the line.
- It is stored so we can give a bit more info on the next line. To much, and large
- initialized arrays will use up lots of paper.
- */
+/* This static array is used to keep the text of data to be printed
+ before the start of the line. */
-static char data_buffer[100];
-static unsigned int data_buffer_size;
+#define MAX_BYTES \
+ (((LISTING_WORD_SIZE * 2) + 1) * listing_lhs_width \
+ + ((((LISTING_WORD_SIZE * 2) + 1) * listing_lhs_width_second) \
+ * listing_lhs_cont_lines) \
+ + 20)
+static char *data_buffer;
/* Prototypes. */
static void listing_message PARAMS ((const char *name, const char *message));
@@ -214,7 +217,7 @@ static void print_source PARAMS ((file_info_type *current_file,
list_info_type *list,
char *buffer,
unsigned int width));
-static int debugging_pseudo PARAMS ((char *line));
+static int debugging_pseudo PARAMS ((list_info_type *, const char *));
static void listing_listing PARAMS ((char *name));
@@ -248,9 +251,15 @@ listing_error (message)
}
+int listing_lhs_width = LISTING_LHS_WIDTH;
+int listing_lhs_width_second = LISTING_LHS_WIDTH_SECOND;
+int listing_lhs_cont_lines = LISTING_LHS_CONT_LINES;
+int listing_rhs_width = LISTING_RHS_WIDTH;
static file_info_type *file_info_head;
+static file_info_type *last_open_file_info;
+static FILE *last_open_file;
static file_info_type *
file_info (file_name)
@@ -273,13 +282,10 @@ file_info (file_name)
file_info_head = p;
p->filename = xmalloc ((unsigned long) strlen (file_name) + 1);
strcpy (p->filename, file_name);
+ p->pos = 0;
p->linenum = 0;
p->at_end = 0;
- p->file = fopen (p->filename, "r");
- if (p->file)
- fgetc (p->file);
-
return p;
}
@@ -301,7 +307,7 @@ listing_newline (ps)
unsigned int line;
static unsigned int last_line = 0xffff;
static char *last_file = NULL;
- list_info_type *new;
+ list_info_type *new = NULL;
if (listing == 0)
return;
@@ -309,34 +315,77 @@ listing_newline (ps)
if (now_seg == absolute_section)
return;
+#ifdef OBJ_ELF
+ /* In ELF, anything in a section beginning with .debug or .line is
+ considered to be debugging information. This includes the
+ statement which switches us into the debugging section, which we
+ can only set after we are already in the debugging section. */
+ if ((listing & LISTING_NODEBUG) != 0
+ && listing_tail != NULL
+ && ! listing_tail->debugging)
+ {
+ const char *segname;
+
+ segname = segment_name (now_seg);
+ if (strncmp (segname, ".debug", sizeof ".debug" - 1) == 0
+ || strncmp (segname, ".line", sizeof ".line" - 1) == 0)
+ listing_tail->debugging = 1;
+ }
+#endif
+
as_where (&file, &line);
- if (line != last_line || (last_file && file && strcmp(file, last_file)))
+ if (ps == NULL)
{
- last_line = line;
- last_file = file;
- new_frag ();
+ if (line == last_line && !(last_file && file && strcmp(file, last_file)))
+ return;
new = (list_info_type *) xmalloc (sizeof (list_info_type));
- new->frag = frag_now;
- new->line = line;
- new->file = file_info (file);
+ new->line_contents = NULL;
+ }
+ else
+ {
+ new = (list_info_type *) xmalloc (sizeof (list_info_type));
+ new->line_contents = ps;
+ }
- if (listing_tail)
- {
- listing_tail->next = new;
- }
- else
- {
- head = new;
- }
- listing_tail = new;
- new->next = (list_info_type *) NULL;
- new->message = (char *) NULL;
- new->edict = EDICT_NONE;
- new->hll_file = (file_info_type *) NULL;
- new->hll_line = 0;
- new_frag ();
+ last_line = line;
+ last_file = file;
+ new_frag ();
+
+ if (listing_tail)
+ {
+ listing_tail->next = new;
+ }
+ else
+ {
+ head = new;
}
+ listing_tail = new;
+
+ new->frag = frag_now;
+ new->line = line;
+ new->file = file_info (file);
+ new->next = (list_info_type *) NULL;
+ new->message = (char *) NULL;
+ new->edict = EDICT_NONE;
+ new->hll_file = (file_info_type *) NULL;
+ new->hll_line = 0;
+ new->debugging = 0;
+ new_frag ();
+
+#ifdef OBJ_ELF
+ /* In ELF, anything in a section beginning with .debug or .line is
+ considered to be debugging information. */
+ if ((listing & LISTING_NODEBUG) != 0)
+ {
+ const char *segname;
+
+ segname = segment_name (now_seg);
+ if (strncmp (segname, ".debug", sizeof ".debug" - 1) == 0
+ || strncmp (segname, ".line", sizeof ".line" - 1) == 0)
+ new->debugging = 1;
+ }
+#endif
}
/* Attach all current frags to the previous line instead of the
@@ -386,15 +435,32 @@ buffer_line (file, line, size)
char *p = line;
/* If we couldn't open the file, return an empty line */
- if (file->file == (FILE *) NULL || file->at_end)
+ if (file->at_end)
+ return "";
+
+ /* Check the cache and see if we last used this file. */
+ if (!last_open_file_info || file != last_open_file_info)
{
- return "";
- }
+ if (last_open_file)
+ {
+ last_open_file_info->pos = ftell (last_open_file);
+ fclose (last_open_file);
+ }
- if (file->linenum == 0)
- rewind (file->file);
+ last_open_file_info = file;
+ last_open_file = fopen (file->filename, "r");
+ if (last_open_file == NULL)
+ {
+ file->at_end = 1;
+ return "";
+ }
- c = fgetc (file->file);
+ /* Seek to where we were last time this file was open. */
+ if (file->pos)
+ fseek(last_open_file, file->pos, SEEK_SET);
+ }
+
+ c = fgetc (last_open_file);
size -= 1; /* leave room for null */
@@ -404,7 +470,7 @@ buffer_line (file, line, size)
*p++ = c;
count++;
- c = fgetc (file->file);
+ c = fgetc (last_open_file);
}
if (c == EOF)
@@ -435,7 +501,7 @@ listing_page (list)
{
/* Grope around, see if we can see a title or subtitle edict coming up
soon (we look down 10 lines of the page and see if it's there)*/
- if ((eject || (on_page >= paper_height)) && paper_height != 0)
+ if ((eject || (on_page >= (unsigned int) paper_height)) && paper_height != 0)
{
unsigned int c = 10;
int had_title = 0;
@@ -478,15 +544,13 @@ static unsigned int
calc_hex (list)
list_info_type * list;
{
+ int data_buffer_size;
list_info_type *first = list;
- unsigned int address = (unsigned int) ~0;
-
+ unsigned int address = ~ (unsigned int) 0;
fragS *frag;
fragS *frag_ptr;
-
unsigned int byte_in_frag;
-
/* Find first frag which says it belongs to this line */
frag = list->frag;
while (frag && frag->line != list)
@@ -501,9 +565,10 @@ calc_hex (list)
{
/* Print as many bytes from the fixed part as is sensible */
byte_in_frag = 0;
- while (byte_in_frag < frag_ptr->fr_fix && data_buffer_size < sizeof (data_buffer) - 10)
+ while ((offsetT) byte_in_frag < frag_ptr->fr_fix
+ && data_buffer_size < MAX_BYTES - 3)
{
- if (address == ~0)
+ if (address == ~ (unsigned int) 0)
{
address = frag_ptr->fr_address;
}
@@ -519,11 +584,11 @@ calc_hex (list)
unsigned int var_rep_idx = byte_in_frag;
/* Print as many bytes from the variable part as is sensible */
- while ((byte_in_frag
+ while (((offsetT) byte_in_frag
< frag_ptr->fr_fix + frag_ptr->fr_var * frag_ptr->fr_offset)
- && data_buffer_size < sizeof (data_buffer) - 10)
+ && data_buffer_size < MAX_BYTES - 3)
{
- if (address == ~0)
+ if (address == ~ (unsigned int) 0)
{
address = frag_ptr->fr_address;
}
@@ -539,14 +604,14 @@ calc_hex (list)
var_rep_idx++;
byte_in_frag++;
- if (var_rep_idx >= frag_ptr->fr_fix + frag_ptr->fr_var)
+ if ((offsetT) var_rep_idx >= frag_ptr->fr_fix + frag_ptr->fr_var)
var_rep_idx = var_rep_max;
}
}
frag_ptr = frag_ptr->fr_next;
}
- data_buffer[data_buffer_size++] = 0;
+ data_buffer[data_buffer_size] = '\0';
return address;
}
@@ -570,9 +635,9 @@ print_lines (list, lineno, string, address)
/* Print the stuff on the first line */
listing_page (list);
- nchars = (LISTING_WORD_SIZE * 2 + 1) * LISTING_LHS_WIDTH;
+ nchars = (LISTING_WORD_SIZE * 2 + 1) * listing_lhs_width;
/* Print the hex for the first line */
- if (address == ~0)
+ if (address == ~ (unsigned int) 0)
{
fprintf (list_file, "% 4d ", lineno);
for (idx = 0; idx < nchars; idx++)
@@ -625,11 +690,11 @@ print_lines (list, lineno, string, address)
}
for (lines = 0;
- lines < LISTING_LHS_CONT_LINES
- && *src;
+ lines < (unsigned int) listing_lhs_cont_lines && *src;
lines++)
{
- nchars = ((LISTING_WORD_SIZE * 2) + 1) * LISTING_LHS_WIDTH_SECOND - 1;
+ nchars = (((LISTING_WORD_SIZE * 2) + 1)
+ * listing_lhs_width_second - 1);
idx = 0;
/* Print any more lines of data, but more compactly */
fprintf (list_file, "% 4d ", lineno);
@@ -671,8 +736,14 @@ list_symbol_table ()
for (ptr = symbol_rootP; ptr != (symbolS *) NULL; ptr = symbol_next (ptr))
{
- if (ptr->sy_frag->line)
+ if (SEG_NORMAL (S_GET_SEGMENT (ptr))
+ || S_GET_SEGMENT (ptr) == absolute_section)
{
+#ifdef BFD_ASSEMBLER
+ /* Don't report section symbols. They are not interesting. */
+ if (ptr->bsym->flags & BSF_SECTION_SYM)
+ continue;
+#endif
if (S_GET_NAME (ptr))
{
char buf[30], fmt[8];
@@ -702,11 +773,20 @@ list_symbol_table ()
got_some = 1;
}
- fprintf (list_file, "%20s:%-5d %s:%s %s\n",
- ptr->sy_frag->line->file->filename,
- ptr->sy_frag->line->line,
- segment_name (S_GET_SEGMENT (ptr)),
- buf, S_GET_NAME (ptr));
+ if (ptr->sy_frag && ptr->sy_frag->line)
+ {
+ fprintf (list_file, "%20s:%-5d %s:%s %s\n",
+ ptr->sy_frag->line->file->filename,
+ ptr->sy_frag->line->line,
+ segment_name (S_GET_SEGMENT (ptr)),
+ buf, S_GET_NAME (ptr));
+ }
+ else
+ {
+ fprintf (list_file, "%33s:%s %s\n",
+ segment_name (S_GET_SEGMENT (ptr)),
+ buf, S_GET_NAME (ptr));
+ }
on_page++;
listing_page (0);
@@ -729,11 +809,7 @@ list_symbol_table ()
{
if (S_GET_NAME (ptr) && strlen (S_GET_NAME (ptr)) != 0)
{
- if (ptr->sy_frag->line == 0
-#ifdef S_IS_REGISTER
- && !S_IS_REGISTER (ptr)
-#endif
- && S_GET_SEGMENT (ptr) != reg_section)
+ if (S_GET_SEGMENT (ptr) == undefined_section)
{
if (!got_some)
{
@@ -763,13 +839,13 @@ print_source (current_file, list, buffer, width)
char *buffer;
unsigned int width;
{
- if (current_file->file)
+ if (!current_file->at_end)
{
while (current_file->linenum < list->hll_line
&& !current_file->at_end)
{
char *p = buffer_line (current_file, buffer, width);
- fprintf (list_file, "%4d:%-13s **** %s\n", current_file->linenum,
+ fprintf (list_file, "%4u:%-13s **** %s\n", current_file->linenum,
current_file->filename, p);
on_page++;
listing_page (list);
@@ -778,17 +854,48 @@ print_source (current_file, list, buffer, width)
}
/* Sometimes the user doesn't want to be bothered by the debugging
- records inserted by the compiler, see if the line is suspicious */
+ records inserted by the compiler, see if the line is suspicious. */
static int
-debugging_pseudo (line)
- char *line;
+debugging_pseudo (list, line)
+ list_info_type *list;
+ const char *line;
{
- while (isspace (*line))
+ static int in_debug;
+ int was_debug;
+
+ if (list->debugging)
+ {
+ in_debug = 1;
+ return 1;
+ }
+
+ was_debug = in_debug;
+ in_debug = 0;
+
+ while (isspace ((unsigned char) *line))
line++;
if (*line != '.')
- return 0;
+ {
+#ifdef OBJ_ELF
+ /* The ELF compiler sometimes emits blank lines after switching
+ out of a debugging section. If the next line drops us back
+ into debugging information, then don't print the blank line.
+ This is a hack for a particular compiler behaviour, not a
+ general case. */
+ if (was_debug
+ && *line == '\0'
+ && list->next != NULL
+ && list->next->debugging)
+ {
+ in_debug = 1;
+ return 1;
+ }
+#endif
+
+ return 0;
+ }
line++;
@@ -819,7 +926,6 @@ debugging_pseudo (line)
return 1;
return 0;
-
}
static void
@@ -834,7 +940,8 @@ listing_listing (name)
int show_listing = 1;
unsigned int width;
- buffer = xmalloc (LISTING_RHS_WIDTH);
+ buffer = xmalloc (listing_rhs_width);
+ data_buffer = xmalloc (MAX_BYTES);
eject = 1;
list = head;
@@ -851,8 +958,8 @@ listing_listing (name)
while (list)
{
- width = LISTING_RHS_WIDTH > paper_width ? paper_width :
- LISTING_RHS_WIDTH;
+ width = listing_rhs_width > paper_width ? paper_width :
+ listing_rhs_width;
switch (list->edict)
{
@@ -889,26 +996,38 @@ listing_listing (name)
current_hll_file = list->hll_file;
}
- if (current_hll_file && list->hll_line && listing & LISTING_HLL)
+ if (current_hll_file && list->hll_line && (listing & LISTING_HLL))
{
print_source (current_hll_file, list, buffer, width);
}
- while (list->file->file
- && list->file->linenum < list->line
- && !list->file->at_end)
+ if (list->line_contents)
{
- unsigned int address;
+ if (!((listing & LISTING_NODEBUG)
+ && debugging_pseudo (list, list->line_contents)))
+ {
+ print_lines (list, list->file->linenum,
+ list->line_contents, calc_hex (list));
+ }
+ }
+ else
+ {
+ while (list->file->linenum < list->line
+ && !list->file->at_end)
+ {
+ unsigned int address;
- p = buffer_line (list->file, buffer, width);
+ p = buffer_line (list->file, buffer, width);
- if (list->file->linenum < list->line)
- address = ~ (unsigned int) 0;
- else
- address = calc_hex (list);
+ if (list->file->linenum < list->line)
+ address = ~ (unsigned int) 0;
+ else
+ address = calc_hex (list);
- if (!((listing & LISTING_NODEBUG) && debugging_pseudo (p)))
- print_lines (list, list->file->linenum, p, address);
+ if (!((listing & LISTING_NODEBUG)
+ && debugging_pseudo (list, p)))
+ print_lines (list, list->file->linenum, p, address);
+ }
}
if (list->edict == EDICT_EJECT)
@@ -918,8 +1037,7 @@ listing_listing (name)
}
else
{
- while (list->file->file
- && list->file->linenum < list->line
+ while (list->file->linenum < list->line
&& !list->file->at_end)
p = buffer_line (list->file, buffer, width);
}
@@ -929,7 +1047,10 @@ listing_listing (name)
list = list->next;
}
+
free (buffer);
+ free (data_buffer);
+ data_buffer = NULL;
}
void
@@ -937,7 +1058,6 @@ listing_print (name)
char *name;
{
int using_stdout;
- file_info_type *fi;
title = "";
subtitle = "";
@@ -981,13 +1101,9 @@ listing_print (name)
as_perror ("error closing list file: %s", name);
}
- for (fi = file_info_head; fi != NULL; fi = fi->next)
+ if (last_open_file)
{
- if (fi->file != NULL)
- {
- fclose (fi->file);
- fi->file = NULL;
- }
+ fclose (last_open_file);
}
}
diff --git a/contrib/binutils/gas/listing.h b/contrib/binutils/gas/listing.h
index 8e36b64..6f64b09 100644
--- a/contrib/binutils/gas/listing.h
+++ b/contrib/binutils/gas/listing.h
@@ -28,11 +28,12 @@
#define LISTING_HLL 8
#define LISTING_NODEBUG 16
#define LISTING_NOCOND 32
+#define LISTING_MACEXP 64
-#define LISTING_DEFAULT (LISTING_LISTING | LISTING_HLL | LISTING_SYMBOLS)
+#define LISTING_DEFAULT (LISTING_LISTING | LISTING_HLL | LISTING_SYMBOLS)
#ifndef NO_LISTING
-#define LISTING_NEWLINE() { if (listing) listing_newline(input_line_pointer); }
+#define LISTING_NEWLINE() { if (listing) listing_newline(NULL); }
#else
#define LISTING_NEWLINE() {;}
#endif
@@ -55,6 +56,11 @@ void listing_title PARAMS ((int depth));
void listing_warning PARAMS ((const char *message));
void listing_width PARAMS ((unsigned int x));
+extern int listing_lhs_width;
+extern int listing_lhs_width_second;
+extern int listing_lhs_cont_lines;
+extern int listing_rhs_width;
+
#endif /* __listing_h__ */
/* end of listing.h */
diff --git a/contrib/binutils/gas/macro.c b/contrib/binutils/gas/macro.c
index e2f1ff9..1737414 100644
--- a/contrib/binutils/gas/macro.c
+++ b/contrib/binutils/gas/macro.c
@@ -1,5 +1,5 @@
/* macro.c - macro support for gas and gasp
- Copyright (C) 1994, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
@@ -22,6 +22,34 @@
02111-1307, USA. */
#include "config.h"
+
+/* AIX requires this to be the first thing in the file. */
+#ifdef __GNUC__
+# ifndef alloca
+# ifdef __STDC__
+extern void *alloca ();
+# else
+extern char *alloca ();
+# endif
+# endif
+#else
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+# if !defined (__STDC__) && !defined (__hpux)
+extern char *alloca ();
+# else
+extern void *alloca ();
+# endif /* __STDC__, __hpux */
+# endif /* alloca */
+# endif /* _AIX */
+# endif /* HAVE_ALLOCA_H */
+#endif
+
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
@@ -93,7 +121,8 @@ static const char *macro_expand PARAMS ((int, sb *, macro_entry *, sb *, int));
#define ISSEP(x) \
((x) == ' ' || (x) == '\t' || (x) == ',' || (x) == '"' || (x) == ';' \
- || (x) == '<' || (x) == '>' || (x) == ')' || (x) == '(')
+ || (x) == ')' || (x) == '(' \
+ || ((macro_alternate || macro_mri) && ((x) == '<' || (x) == '>')))
#define ISBASE(x) \
((x) == 'b' || (x) == 'B' \
@@ -269,49 +298,31 @@ getstring (idx, in, acc)
while (idx < in->len
&& (in->ptr[idx] == '"'
- || in->ptr[idx] == '<'
+ || (in->ptr[idx] == '<' && (macro_alternate || macro_mri))
|| (in->ptr[idx] == '\'' && macro_alternate)))
{
if (in->ptr[idx] == '<')
{
- if (macro_alternate || macro_mri)
+ int nest = 0;
+ idx++;
+ while ((in->ptr[idx] != '>' || nest)
+ && idx < in->len)
{
- int nest = 0;
- idx++;
- while ((in->ptr[idx] != '>' || nest)
- && idx < in->len)
+ if (in->ptr[idx] == '!')
{
- if (in->ptr[idx] == '!')
- {
- idx++ ;
- sb_add_char (acc, in->ptr[idx++]);
- }
- else
- {
- if (in->ptr[idx] == '>')
- nest--;
- if (in->ptr[idx] == '<')
- nest++;
- sb_add_char (acc, in->ptr[idx++]);
- }
+ idx++ ;
+ sb_add_char (acc, in->ptr[idx++]);
+ }
+ else
+ {
+ if (in->ptr[idx] == '>')
+ nest--;
+ if (in->ptr[idx] == '<')
+ nest++;
+ sb_add_char (acc, in->ptr[idx++]);
}
- idx++;
- }
- else
- {
- int code;
- idx++;
- idx = ((*macro_expr)
- ("character code in string must be absolute expression",
- idx, in, &code));
- sb_add_char (acc, code);
-
-#if 0
- if (in->ptr[idx] != '>')
- ERROR ((stderr, "Missing > for character code.\n"));
-#endif
- idx++;
}
+ idx++;
}
else if (in->ptr[idx] == '"' || in->ptr[idx] == '\'')
{
@@ -383,7 +394,7 @@ get_any_string (idx, in, out, expand, pretend_quoted)
sb_add_string (out, buf);
}
else if (in->ptr[idx] == '"'
- || in->ptr[idx] == '<'
+ || (in->ptr[idx] == '<' && (macro_alternate || macro_mri))
|| (macro_alternate && in->ptr[idx] == '\''))
{
if (macro_alternate
@@ -410,7 +421,8 @@ get_any_string (idx, in, out, expand, pretend_quoted)
|| (in->ptr[idx] != ' '
&& in->ptr[idx] != '\t'
&& in->ptr[idx] != ','
- && in->ptr[idx] != '<')))
+ && (in->ptr[idx] != '<'
+ || (! macro_alternate && ! macro_mri)))))
{
if (in->ptr[idx] == '"'
|| in->ptr[idx] == '\'')
@@ -541,7 +553,7 @@ define_macro (idx, in, label, get_line, namep)
if (label != NULL && label->len != 0)
{
sb_add_sb (&name, label);
- if (in->ptr[idx] == '(')
+ if (idx < in->len && in->ptr[idx] == '(')
{
/* It's the label: MACRO (formals,...) sort */
idx = do_formals (macro, idx + 1, in);
@@ -563,7 +575,7 @@ define_macro (idx, in, label, get_line, namep)
/* and stick it in the macro hash table */
for (idx = 0; idx < name.len; idx++)
- if (isupper (name.ptr[idx]))
+ if (isupper ((unsigned char) name.ptr[idx]))
name.ptr[idx] = tolower (name.ptr[idx]);
namestr = sb_terminate (&name);
hash_jam (macro_hash, namestr, (PTR) macro);
@@ -629,6 +641,11 @@ sub_actual (start, in, t, formal_hash, kind, out, copyifnotthere)
sb_add_sb (out, &ptr->def);
}
}
+ else if (kind == '&')
+ {
+ /* Doing this permits people to use & in macro bodies. */
+ sb_add_char (out, '&');
+ }
else if (copyifnotthere)
{
sb_add_sb (out, t);
@@ -673,8 +690,7 @@ macro_expand_body (in, out, formals, formal_hash, comment_char, locals)
}
else
{
- /* FIXME: Why do we do this? It prevents people from
- using the & operator in a macro. */
+ /* FIXME: Why do we do this? */
src = sub_actual (src + 1, in, &t, formal_hash, '&', out, 0);
}
}
@@ -705,7 +721,7 @@ macro_expand_body (in, out, formals, formal_hash, comment_char, locals)
{
/* Sub in the macro invocation number */
- char buffer[6];
+ char buffer[10];
src++;
sprintf (buffer, "%05d", macro_number);
sb_add_string (out, buffer);
@@ -945,13 +961,14 @@ macro_expand (idx, in, m, out, comment_char)
scan = idx;
while (scan < in->len
&& !ISSEP (in->ptr[scan])
+ && !(macro_mri && in->ptr[scan] == '\'')
&& (!macro_alternate && in->ptr[scan] != '='))
scan++;
if (scan < in->len && !macro_alternate && in->ptr[scan] == '=')
{
is_keyword = 1;
- if (is_positional)
- return "can't mix positional and keyword arguments";
+
+ /* It's OK to go from positional to keyword. */
/* This is a keyword arg, fetch the formal name and
then the actual stuff */
@@ -1099,11 +1116,11 @@ check_macro (line, expand, comment_char, error)
|| *s == '$')
++s;
- copy = (char *) xmalloc (s - line + 1);
+ copy = (char *) alloca (s - line + 1);
memcpy (copy, line, s - line);
copy[s - line] = '\0';
for (cs = copy; *cs != '\0'; cs++)
- if (isupper (*cs))
+ if (isupper ((unsigned char) *cs))
*cs = tolower (*cs);
macro = (macro_entry *) hash_find (macro_hash, copy);
diff --git a/contrib/binutils/gas/messages.c b/contrib/binutils/gas/messages.c
index 1e06232..7dc399d 100644
--- a/contrib/binutils/gas/messages.c
+++ b/contrib/binutils/gas/messages.c
@@ -1,5 +1,5 @@
/* messages.c - error reporter -
- Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -241,7 +241,7 @@ void
as_warn (const char *format,...)
{
va_list args;
- char buffer[200];
+ char buffer[2000];
if (!flag_no_warnings)
{
@@ -259,7 +259,7 @@ as_warn (format, va_alist)
va_dcl
{
va_list args;
- char buffer[200];
+ char buffer[2000];
if (!flag_no_warnings)
{
@@ -280,7 +280,7 @@ void
as_warn_where (char *file, unsigned int line, const char *format,...)
{
va_list args;
- char buffer[200];
+ char buffer[2000];
if (!flag_no_warnings)
{
@@ -300,7 +300,7 @@ as_warn_where (file, line, format, va_alist)
va_dcl
{
va_list args;
- char buffer[200];
+ char buffer[2000];
if (!flag_no_warnings)
{
@@ -350,7 +350,7 @@ void
as_bad (const char *format,...)
{
va_list args;
- char buffer[200];
+ char buffer[2000];
va_start (args, format);
vsprintf (buffer, format, args);
@@ -367,7 +367,7 @@ as_bad (format, va_alist)
va_dcl
{
va_list args;
- char buffer[200];
+ char buffer[2000];
va_start (args);
vsprintf (buffer, format, args);
@@ -386,7 +386,7 @@ void
as_bad_where (char *file, unsigned int line, const char *format,...)
{
va_list args;
- char buffer[200];
+ char buffer[2000];
va_start (args, format);
vsprintf (buffer, format, args);
@@ -405,7 +405,7 @@ as_bad_where (file, line, format, va_alist)
va_dcl
{
va_list args;
- char buffer[200];
+ char buffer[2000];
va_start (args);
vsprintf (buffer, format, args);
diff --git a/contrib/binutils/gas/output-file.c b/contrib/binutils/gas/output-file.c
index c53281b..552aac1 100644
--- a/contrib/binutils/gas/output-file.c
+++ b/contrib/binutils/gas/output-file.c
@@ -1,5 +1,5 @@
/* output-file.c - Deal with the output file
- Copyright (C) 1987, 90, 91, 93, 92, 94, 95, 1996
+ Copyright (C) 1987, 90, 91, 93, 92, 94, 95, 96, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -56,6 +56,8 @@ output_file_create (name)
#ifdef BFD_ASSEMBLER
bfd_set_arch_mach (stdoutput, TARGET_ARCH, TARGET_MACH);
#endif
+ if (flag_traditional_format)
+ stdoutput->flags |= BFD_TRADITIONAL_FORMAT;
}
void
diff --git a/contrib/binutils/gas/read.c b/contrib/binutils/gas/read.c
index 85d221d..cde61bb 100644
--- a/contrib/binutils/gas/read.c
+++ b/contrib/binutils/gas/read.c
@@ -1,5 +1,5 @@
/* read.c - read a source file -
- Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -63,8 +63,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
char *input_line_pointer; /*->next char of source file to parse. */
-int generate_asm_lineno = 0; /* flag to generate line stab for .s file */
-
#if BITS_PER_CHAR != 8
/* The following table is indexed by[(char)] and will break if
a char does not have exactly 256 states (hopefully 0:255!)! */
@@ -130,9 +128,9 @@ char lex_type[256] =
char is_end_of_line[256] =
{
#ifdef CR_EOL
- _, _, _, _, _, _, _, _, _, _, 99, _, _, 99, _, _, /* @abcdefghijklmno */
+ 99, _, _, _, _, _, _, _, _, _, 99, _, _, 99, _, _, /* @abcdefghijklmno */
#else
- _, _, _, _, _, _, _, _, _, _, 99, _, _, _, _, _, /* @abcdefghijklmno */
+ 99, _, _, _, _, _, _, _, _, _, 99, _, _, _, _, _, /* @abcdefghijklmno */
#endif
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, /* */
#ifdef TC_HPPA
@@ -167,12 +165,12 @@ static char *old_buffer; /* JF a hack */
static char *old_input;
static char *old_limit;
-/* Variables for handling include file directory list. */
+/* Variables for handling include file directory table. */
-char **include_dirs; /* List of pointers to directories to
+char **include_dirs; /* Table of pointers to directories to
search for .include's */
-int include_dir_count; /* How many are in the list */
-int include_dir_maxlen = 1;/* Length of longest in list */
+int include_dir_count; /* How many are in the table */
+int include_dir_maxlen = 1;/* Length of longest in table */
#ifndef WORKING_DOT_WORD
struct broken_word *broken_words;
@@ -199,6 +197,15 @@ symbolS *mri_common_symbol;
may be needed. */
static int mri_pending_align;
+#ifndef NO_LISTING
+#ifdef OBJ_ELF
+/* This variable is set to be non-zero if the next string we see might
+ be the name of the source file in DWARF debugging information. See
+ the comment in emit_expr for the format we look for. */
+static int dwarf_file_string;
+#endif
+#endif
+
static void cons_worker PARAMS ((int, int));
static int scrub_from_string PARAMS ((char **));
static void do_align PARAMS ((int, char *, int, int));
@@ -364,6 +371,7 @@ static const pseudo_typeS potable[] =
/* size */
{"space", s_space, 0},
{"skip", s_space, 0},
+ {"sleb128", s_leb128, 1},
{"spc", s_ignore, 0},
{"stabd", s_stab, 'd'},
{"stabn", s_stab, 'n'},
@@ -386,6 +394,7 @@ static const pseudo_typeS potable[] =
{"title", listing_title, 0}, /* Listing title */
{"ttl", listing_title, 0},
/* type */
+ {"uleb128", s_leb128, 0},
/* use */
/* val */
{"xcom", s_comm, 0},
@@ -487,7 +496,8 @@ read_a_source_file (name)
buffer = input_scrub_new_file (name);
listing_file (name);
- listing_newline ("");
+ listing_newline (NULL);
+ register_dependency (name);
while ((buffer_limit = input_scrub_next_buffer (&input_line_pointer)) != 0)
{ /* We have another line to parse. */
@@ -601,7 +611,39 @@ read_a_source_file (name)
c = *input_line_pointer++;
}
know (c != ' '); /* No further leading whitespace. */
- LISTING_NEWLINE ();
+
+#ifndef NO_LISTING
+ /* If listing is on, and we are expanding a macro, then give
+ the listing code the contents of the expanded line. */
+ if (listing)
+ {
+ if ((listing & LISTING_MACEXP) && macro_nest > 0)
+ {
+ char *copy;
+ int len;
+
+ /* Find the end of the current expanded macro line. */
+ for (s = input_line_pointer-1; *s ; ++s)
+ if (is_end_of_line[(unsigned char) *s])
+ break;
+
+ /* Copy it for safe keeping. Also give an indication of
+ how much macro nesting is involved at this point. */
+ len = s - (input_line_pointer-1);
+ copy = (char *) xmalloc (len + macro_nest + 2);
+ memset (copy, '>', macro_nest);
+ copy[macro_nest] = ' ';
+ memcpy (copy + macro_nest + 1, input_line_pointer-1, len);
+ copy[macro_nest+1+len] = '\0';
+
+ /* Install the line with the listing facility. */
+ listing_newline (copy);
+ }
+ else
+ listing_newline (NULL);
+ }
+#endif
+
/*
* C is the 1st significant character.
* Input_line_pointer points after that character.
@@ -670,7 +712,7 @@ read_a_source_file (name)
char *s2 = s;
while (*s2)
{
- if (isupper (*s2))
+ if (isupper ((unsigned char) *s2))
*s2 = tolower (*s2);
s2++;
}
@@ -783,20 +825,29 @@ read_a_source_file (name)
c = *input_line_pointer;
*input_line_pointer = '\0';
+ if (debug_type == DEBUG_STABS)
+ stabs_generate_asm_lineno ();
+
#ifdef OBJ_GENERATE_ASM_LINENO
- if (generate_asm_lineno == 0)
+#ifdef ECOFF_DEBUGGING
+ /* ECOFF assemblers automatically generate
+ debugging information. FIXME: This should
+ probably be handled elsewhere. */
+ if (debug_type == DEBUG_NONE)
{
- if (ecoff_no_current_file ())
- generate_asm_lineno = 1;
+ if (ecoff_no_current_file ())
+ debug_type = DEBUG_ECOFF;
}
- if (generate_asm_lineno == 1)
+
+ if (debug_type == DEBUG_ECOFF)
{
unsigned int lineno;
char *s;
as_where (&s, &lineno);
OBJ_GENERATE_ASM_LINENO (s, lineno);
- }
+ }
+#endif
#endif
if (macro_defined)
@@ -846,7 +897,7 @@ read_a_source_file (name)
continue;
if ((LOCAL_LABELS_DOLLAR || LOCAL_LABELS_FB)
- && isdigit (c))
+ && isdigit ((unsigned char) c))
{
/* local label ("4:") */
char *backup = input_line_pointer;
@@ -855,7 +906,7 @@ read_a_source_file (name)
temp = c - '0';
- while (isdigit (*input_line_pointer))
+ while (isdigit ((unsigned char) *input_line_pointer))
{
temp = (temp * 10) + *input_line_pointer - '0';
++input_line_pointer;
@@ -1110,8 +1161,21 @@ do_align (n, fill, len, max)
if (fill == NULL)
{
- /* FIXME: Fix this right for BFD! */
+ int maybe_text;
+
+#ifdef BFD_ASSEMBLER
+ if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ maybe_text = 1;
+ else
+ maybe_text = 0;
+#else
if (now_seg != data_section && now_seg != bss_section)
+ maybe_text = 1;
+ else
+ maybe_text = 0;
+#endif
+
+ if (maybe_text)
default_fill = NOP_OPCODE;
else
default_fill = 0;
@@ -1240,7 +1304,7 @@ s_align (arg, bytes_p)
{
char ab[16];
- if (fill_len > sizeof ab)
+ if ((size_t) fill_len > sizeof ab)
abort ();
md_number_to_chars (ab, fill, fill_len);
do_align (align, ab, fill_len, max);
@@ -1263,7 +1327,7 @@ s_align_bytes (arg)
s_align (arg, 1);
}
-/* Handle the .align pseud-op on machines where ".align 4" means align
+/* Handle the .align pseudo-op on machines where ".align 4" means align
to a 2**4 boundary. */
void
@@ -1496,7 +1560,8 @@ s_app_file (appfile)
/* If this is a fake .appfile, a fake newline was inserted into
the buffer. Passing -2 to new_logical_line tells it to
account for it. */
- new_logical_line (s, appfile ? -2 : -1);
+ int may_omit
+ = (! new_logical_line (s, appfile ? -2 : -1) && appfile);
/* In MRI mode, the preprocessor may have inserted an extraneous
backquote. */
@@ -1506,14 +1571,18 @@ s_app_file (appfile)
++input_line_pointer;
demand_empty_rest_of_line ();
+ if (! may_omit)
+ {
#ifdef LISTING
- if (listing)
- listing_source_file (s);
+ if (listing)
+ listing_source_file (s);
#endif
- }
+ register_dependency (s);
#ifdef obj_app_file
- obj_app_file (s);
+ obj_app_file (s);
#endif
+ }
+ }
}
/* Handle the .appline pseudo-op. This is automatically generated by
@@ -1602,61 +1671,91 @@ void
s_fill (ignore)
int ignore;
{
- long temp_repeat = 0;
- long temp_size = 1;
- register long temp_fill = 0;
+ expressionS rep_exp;
+ long size = 1;
+ register long fill = 0;
char *p;
#ifdef md_flush_pending_output
md_flush_pending_output ();
#endif
- temp_repeat = get_absolute_expression ();
+ get_known_segmented_expression (&rep_exp);
if (*input_line_pointer == ',')
{
input_line_pointer++;
- temp_size = get_absolute_expression ();
+ size = get_absolute_expression ();
if (*input_line_pointer == ',')
{
input_line_pointer++;
- temp_fill = get_absolute_expression ();
+ fill = get_absolute_expression ();
}
}
+
/* This is to be compatible with BSD 4.2 AS, not for any rational reason. */
#define BSD_FILL_SIZE_CROCK_8 (8)
- if (temp_size > BSD_FILL_SIZE_CROCK_8)
+ if (size > BSD_FILL_SIZE_CROCK_8)
{
as_warn (".fill size clamped to %d.", BSD_FILL_SIZE_CROCK_8);
- temp_size = BSD_FILL_SIZE_CROCK_8;
+ size = BSD_FILL_SIZE_CROCK_8;
}
- if (temp_size < 0)
+ if (size < 0)
{
as_warn ("Size negative: .fill ignored.");
- temp_size = 0;
+ size = 0;
}
- else if (temp_repeat <= 0)
+ else if (rep_exp.X_op == O_constant && rep_exp.X_add_number <= 0)
{
- if (temp_repeat < 0)
+ if (rep_exp.X_add_number < 0)
as_warn ("Repeat < 0, .fill ignored");
- temp_size = 0;
+ size = 0;
}
- if (temp_size && !need_pass_2)
+ if (size && !need_pass_2)
{
- p = frag_var (rs_fill, (int) temp_size, (int) temp_size,
- (relax_substateT) 0, (symbolS *) 0, (offsetT) temp_repeat,
- (char *) 0);
- memset (p, 0, (unsigned int) temp_size);
+ if (rep_exp.X_op == O_constant)
+ {
+ p = frag_var (rs_fill, (int) size, (int) size,
+ (relax_substateT) 0, (symbolS *) 0,
+ (offsetT) rep_exp.X_add_number,
+ (char *) 0);
+ }
+ else
+ {
+ /* We don't have a constant repeat count, so we can't use
+ rs_fill. We can get the same results out of rs_space,
+ but its argument is in bytes, so we must multiply the
+ repeat count by size. */
+
+ symbolS *rep_sym;
+ rep_sym = make_expr_symbol (&rep_exp);
+ if (size != 1)
+ {
+ expressionS size_exp;
+ size_exp.X_op = O_constant;
+ size_exp.X_add_number = size;
+
+ rep_exp.X_op = O_multiply;
+ rep_exp.X_add_symbol = rep_sym;
+ rep_exp.X_op_symbol = make_expr_symbol (&size_exp);
+ rep_exp.X_add_number = 0;
+ rep_sym = make_expr_symbol (&rep_exp);
+ }
+
+ p = frag_var (rs_space, (int) size, (int) size,
+ (relax_substateT) 0, rep_sym, (offsetT) 0, (char *) 0);
+ }
+ memset (p, 0, (unsigned int) size);
/* The magic number BSD_FILL_SIZE_CROCK_4 is from BSD 4.2 VAX
* flavoured AS. The following bizzare behaviour is to be
* compatible with above. I guess they tried to take up to 8
* bytes from a 4-byte expression and they forgot to sign
* extend. Un*x Sux. */
#define BSD_FILL_SIZE_CROCK_4 (4)
- md_number_to_chars (p, (valueT) temp_fill,
- (temp_size > BSD_FILL_SIZE_CROCK_4
+ md_number_to_chars (p, (valueT) fill,
+ (size > BSD_FILL_SIZE_CROCK_4
? BSD_FILL_SIZE_CROCK_4
- : (int) temp_size));
+ : (int) size));
/* Note: .fill (),0 emits no frag (since we are asked to .fill 0 bytes)
* but emits no error message because it seems a legal thing to do.
* It is a degenerate case of .fill but could be emitted by a compiler.
@@ -1810,11 +1909,14 @@ s_linkonce (ignore)
demand_empty_rest_of_line ();
}
-void
-s_lcomm (needs_align)
+static void
+s_lcomm_internal (needs_align, bytes_p)
/* 1 if this was a ".bss" directive, which may require a 3rd argument
(alignment); 0 if it was an ".lcomm" (2 args only) */
int needs_align;
+ /* 1 if the alignment value should be interpreted as the byte boundary,
+ rather than the power of 2. */
+ int bytes_p;
{
register char *name;
register char c;
@@ -1909,6 +2011,20 @@ s_lcomm (needs_align)
return;
}
align = get_absolute_expression ();
+ if (bytes_p)
+ {
+ /* Convert to a power of 2. */
+ if (align != 0)
+ {
+ unsigned int i;
+
+ for (i = 0; (align & 1) == 0; align >>= 1, ++i)
+ ;
+ if (align != 1)
+ as_bad ("Alignment not a power of 2");
+ align = i;
+ }
+ }
if (align > max_alignment)
{
align = max_alignment;
@@ -1984,7 +2100,20 @@ s_lcomm (needs_align)
subseg_set (current_seg, current_subseg);
demand_empty_rest_of_line ();
-} /* s_lcomm() */
+} /* s_lcomm_internal() */
+
+void
+s_lcomm (needs_align)
+ int needs_align;
+{
+ s_lcomm_internal (needs_align, 0);
+}
+
+void s_lcomm_bytes (needs_align)
+ int needs_align;
+{
+ s_lcomm_internal (needs_align, 1);
+}
void
s_lsym (ignore)
@@ -2095,7 +2224,8 @@ get_line_sb (line)
}
sb_add_char (line, *input_line_pointer++);
}
- while (input_line_pointer < buffer_limit && *input_line_pointer == '\n')
+ while (input_line_pointer < buffer_limit
+ && is_end_of_line[(unsigned char) *input_line_pointer])
{
if (input_line_pointer[-1] == '\n')
bump_line_counters ();
@@ -2572,7 +2702,24 @@ s_set (equiv)
if ((symbolP = symbol_find (name)) == NULL
&& (symbolP = md_undefined_symbol (name)) == NULL)
{
- symbolP = symbol_new (name, undefined_section, 0, &zero_address_frag);
+#ifndef NO_LISTING
+ /* When doing symbol listings, play games with dummy fragments living
+ outside the normal fragment chain to record the file and line info
+ for this symbol. */
+ if (listing & LISTING_SYMBOLS)
+ {
+ extern struct list_info_struct *listing_tail;
+ fragS *dummy_frag = (fragS *) xmalloc (sizeof(fragS));
+ memset (dummy_frag, 0, sizeof(fragS));
+ dummy_frag->fr_type = rs_fill;
+ dummy_frag->line = listing_tail;
+ symbolP = symbol_new (name, undefined_section, 0, dummy_frag);
+ dummy_frag->fr_symbol = symbolP;
+ }
+ else
+#endif
+ symbolP = symbol_new (name, undefined_section, 0, &zero_address_frag);
+
#ifdef OBJ_COFF
/* "set" symbols are local unless otherwise specified. */
SF_SET_LOCAL (symbolP);
@@ -2791,7 +2938,8 @@ s_float_space (float_type)
/* Skip any 0{letter} that may be present. Don't even check if the
* letter is legal. */
- if (input_line_pointer[0] == '0' && isalpha (input_line_pointer[1]))
+ if (input_line_pointer[0] == '0'
+ && isalpha ((unsigned char) input_line_pointer[1]))
input_line_pointer += 2;
/* Accept :xxxx, where the x's are hex digits, for a floating point
@@ -2891,7 +3039,7 @@ ignore_rest_of_line () /* For suspect lines: gives warning. */
{
if (!is_end_of_line[(unsigned char) *input_line_pointer])
{
- if (isprint (*input_line_pointer))
+ if (isprint ((unsigned char) *input_line_pointer))
as_bad ("Rest of line ignored. First ignored character is `%c'.",
*input_line_pointer);
else
@@ -2967,7 +3115,8 @@ pseudo_set (symbolP)
S_CLEAR_EXTERNAL (symbolP);
#endif /* OBJ_AOUT or OBJ_BOUT */
S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
- symbolP->sy_frag = &zero_address_frag;
+ if (exp.X_op != O_constant)
+ symbolP->sy_frag = &zero_address_frag;
break;
case O_register:
@@ -3133,7 +3282,6 @@ s_rva (size)
cons_worker (size, 1);
}
-
/* Put the contents of expression EXP into the object file using
NBYTES bytes. If need_pass_2 is 1, this does nothing. */
@@ -3150,6 +3298,73 @@ emit_expr (exp, nbytes)
if (need_pass_2)
return;
+#ifndef NO_LISTING
+#ifdef OBJ_ELF
+ /* When gcc emits DWARF 1 debugging pseudo-ops, a line number will
+ appear as a four byte positive constant in the .line section,
+ followed by a 2 byte 0xffff. Look for that case here. */
+ {
+ static int dwarf_line = -1;
+
+ if (strcmp (segment_name (now_seg), ".line") != 0)
+ dwarf_line = -1;
+ else if (dwarf_line >= 0
+ && nbytes == 2
+ && exp->X_op == O_constant
+ && (exp->X_add_number == -1 || exp->X_add_number == 0xffff))
+ listing_source_line ((unsigned int) dwarf_line);
+ else if (nbytes == 4
+ && exp->X_op == O_constant
+ && exp->X_add_number >= 0)
+ dwarf_line = exp->X_add_number;
+ else
+ dwarf_line = -1;
+ }
+
+ /* When gcc emits DWARF 1 debugging pseudo-ops, a file name will
+ appear as a 2 byte TAG_compile_unit (0x11) followed by a 2 byte
+ AT_sibling (0x12) followed by a four byte address of the sibling
+ followed by a 2 byte AT_name (0x38) followed by the name of the
+ file. We look for that case here. */
+ {
+ static int dwarf_file = 0;
+
+ if (strcmp (segment_name (now_seg), ".debug") != 0)
+ dwarf_file = 0;
+ else if (dwarf_file == 0
+ && nbytes == 2
+ && exp->X_op == O_constant
+ && exp->X_add_number == 0x11)
+ dwarf_file = 1;
+ else if (dwarf_file == 1
+ && nbytes == 2
+ && exp->X_op == O_constant
+ && exp->X_add_number == 0x12)
+ dwarf_file = 2;
+ else if (dwarf_file == 2
+ && nbytes == 4)
+ dwarf_file = 3;
+ else if (dwarf_file == 3
+ && nbytes == 2
+ && exp->X_op == O_constant
+ && exp->X_add_number == 0x38)
+ dwarf_file = 4;
+ else
+ dwarf_file = 0;
+
+ /* The variable dwarf_file_string tells stringer that the string
+ may be the name of the source file. */
+ if (dwarf_file == 4)
+ dwarf_file_string = 1;
+ else
+ dwarf_file_string = 0;
+ }
+#endif
+#endif
+
+ if (check_eh_frame (exp, &nbytes))
+ return;
+
op = exp->X_op;
/* Allow `.word 0' in the absolute section. */
@@ -3302,7 +3517,7 @@ emit_expr (exp, nbytes)
}
else if (op == O_big)
{
- int size;
+ unsigned int size;
LITTLENUM_TYPE *nums;
know (nbytes % CHARS_PER_LITTLENUM == 0);
@@ -3555,7 +3770,7 @@ parse_mri_cons (exp, nbytes)
TC_PARSE_CONS_EXPRESSION (exp, nbytes);
else
{
- int scan = 0;
+ unsigned int scan;
unsigned int result = 0;
/* An MRI style string. Cut into as many bytes as will fit into
@@ -3788,7 +4003,8 @@ float_cons (float_type)
* has no use for such information. Lusers beware: you get
* diagnostics if your input is ill-conditioned.
*/
- if (input_line_pointer[0] == '0' && isalpha (input_line_pointer[1]))
+ if (input_line_pointer[0] == '0'
+ && isalpha ((unsigned char) input_line_pointer[1]))
input_line_pointer += 2;
/* Accept :xxxx, where the x's are hex digits, for a floating
@@ -3853,6 +4069,306 @@ float_cons (float_type)
demand_empty_rest_of_line ();
} /* float_cons() */
+/* Return the size of a LEB128 value */
+
+static inline int
+sizeof_sleb128 (value)
+ offsetT value;
+{
+ register int size = 0;
+ register unsigned byte;
+
+ do
+ {
+ byte = (value & 0x7f);
+ /* Sadly, we cannot rely on typical arithmetic right shift behaviour.
+ Fortunately, we can structure things so that the extra work reduces
+ to a noop on systems that do things "properly". */
+ value = (value >> 7) | ~(-(offsetT)1 >> 7);
+ size += 1;
+ }
+ while (!(((value == 0) && ((byte & 0x40) == 0))
+ || ((value == -1) && ((byte & 0x40) != 0))));
+
+ return size;
+}
+
+static inline int
+sizeof_uleb128 (value)
+ valueT value;
+{
+ register int size = 0;
+ register unsigned byte;
+
+ do
+ {
+ byte = (value & 0x7f);
+ value >>= 7;
+ size += 1;
+ }
+ while (value != 0);
+
+ return size;
+}
+
+inline int
+sizeof_leb128 (value, sign)
+ valueT value;
+ int sign;
+{
+ if (sign)
+ return sizeof_sleb128 ((offsetT) value);
+ else
+ return sizeof_uleb128 (value);
+}
+
+/* Output a LEB128 value. */
+
+static inline int
+output_sleb128 (p, value)
+ char *p;
+ offsetT value;
+{
+ register char *orig = p;
+ register int more;
+
+ do
+ {
+ unsigned byte = (value & 0x7f);
+
+ /* Sadly, we cannot rely on typical arithmetic right shift behaviour.
+ Fortunately, we can structure things so that the extra work reduces
+ to a noop on systems that do things "properly". */
+ value = (value >> 7) | ~(-(offsetT)1 >> 7);
+
+ more = !((((value == 0) && ((byte & 0x40) == 0))
+ || ((value == -1) && ((byte & 0x40) != 0))));
+ if (more)
+ byte |= 0x80;
+
+ *p++ = byte;
+ }
+ while (more);
+
+ return p - orig;
+}
+
+static inline int
+output_uleb128 (p, value)
+ char *p;
+ valueT value;
+{
+ char *orig = p;
+
+ do
+ {
+ unsigned byte = (value & 0x7f);
+ value >>= 7;
+ if (value != 0)
+ /* More bytes to follow. */
+ byte |= 0x80;
+
+ *p++ = byte;
+ }
+ while (value != 0);
+
+ return p - orig;
+}
+
+inline int
+output_leb128 (p, value, sign)
+ char *p;
+ valueT value;
+ int sign;
+{
+ if (sign)
+ return output_sleb128 (p, (offsetT) value);
+ else
+ return output_uleb128 (p, value);
+}
+
+/* Do the same for bignums. We combine sizeof with output here in that
+ we don't output for NULL values of P. It isn't really as critical as
+ for "normal" values that this be streamlined. */
+
+static int
+output_big_sleb128 (p, bignum, size)
+ char *p;
+ LITTLENUM_TYPE *bignum;
+ int size;
+{
+ char *orig = p;
+ valueT val = 0;
+ int loaded = 0;
+ unsigned byte;
+
+ /* Strip leading sign extensions off the bignum. */
+ while (size > 0 && bignum[size-1] == (LITTLENUM_TYPE)-1)
+ size--;
+
+ do
+ {
+ if (loaded < 7 && size > 0)
+ {
+ val |= (*bignum << loaded);
+ loaded += 8 * CHARS_PER_LITTLENUM;
+ size--;
+ bignum++;
+ }
+
+ byte = val & 0x7f;
+ loaded -= 7;
+ val >>= 7;
+
+ if (size == 0)
+ {
+ if ((val == 0 && (byte & 0x40) == 0)
+ || (~(val | ~(((valueT)1 << loaded) - 1)) == 0
+ && (byte & 0x40) != 0))
+ byte |= 0x80;
+ }
+
+ if (orig)
+ *p = byte;
+ p++;
+ }
+ while (byte & 0x80);
+
+ return p - orig;
+}
+
+static int
+output_big_uleb128 (p, bignum, size)
+ char *p;
+ LITTLENUM_TYPE *bignum;
+ int size;
+{
+ char *orig = p;
+ valueT val = 0;
+ int loaded = 0;
+ unsigned byte;
+
+ /* Strip leading zeros off the bignum. */
+ /* XXX: Is this needed? */
+ while (size > 0 && bignum[size-1] == 0)
+ size--;
+
+ do
+ {
+ if (loaded < 7 && size > 0)
+ {
+ val |= (*bignum << loaded);
+ loaded += 8 * CHARS_PER_LITTLENUM;
+ size--;
+ bignum++;
+ }
+
+ byte = val & 0x7f;
+ loaded -= 7;
+ val >>= 7;
+
+ if (size > 0 || val)
+ byte |= 0x80;
+
+ if (orig)
+ *p = byte;
+ p++;
+ }
+ while (byte & 0x80);
+
+ return p - orig;
+}
+
+static inline int
+output_big_leb128 (p, bignum, size, sign)
+ char *p;
+ LITTLENUM_TYPE *bignum;
+ int size, sign;
+{
+ if (sign)
+ return output_big_sleb128 (p, bignum, size);
+ else
+ return output_big_uleb128 (p, bignum, size);
+}
+
+/* Generate the appropriate fragments for a given expression to emit a
+ leb128 value. */
+
+void
+emit_leb128_expr(exp, sign)
+ expressionS *exp;
+ int sign;
+{
+ operatorT op = exp->X_op;
+
+ if (op == O_absent || op == O_illegal)
+ {
+ as_warn ("zero assumed for missing expression");
+ exp->X_add_number = 0;
+ op = O_constant;
+ }
+ else if (op == O_big && exp->X_add_number <= 0)
+ {
+ as_bad ("floating point number invalid; zero assumed");
+ exp->X_add_number = 0;
+ op = O_constant;
+ }
+ else if (op == O_register)
+ {
+ as_warn ("register value used as expression");
+ op = O_constant;
+ }
+
+ if (op == O_constant)
+ {
+ /* If we've got a constant, emit the thing directly right now. */
+
+ valueT value = exp->X_add_number;
+ int size;
+ char *p;
+
+ size = sizeof_leb128 (value, sign);
+ p = frag_more (size);
+ output_leb128 (p, value, sign);
+ }
+ else if (op == O_big)
+ {
+ /* O_big is a different sort of constant. */
+
+ int size;
+ char *p;
+
+ size = output_big_leb128 (NULL, generic_bignum, exp->X_add_number, sign);
+ p = frag_more (size);
+ output_big_leb128 (p, generic_bignum, exp->X_add_number, sign);
+ }
+ else
+ {
+ /* Otherwise, we have to create a variable sized fragment and
+ resolve things later. */
+
+ frag_var (rs_leb128, sizeof_uleb128 (~(valueT)0), 0, sign,
+ make_expr_symbol (exp), 0, (char *) NULL);
+ }
+}
+
+/* Parse the .sleb128 and .uleb128 pseudos. */
+
+void
+s_leb128 (sign)
+ int sign;
+{
+ expressionS exp;
+
+ do {
+ expression (&exp);
+ emit_leb128_expr (&exp, sign);
+ } while (*input_line_pointer++ == ',');
+
+ input_line_pointer--;
+ demand_empty_rest_of_line ();
+}
+
/*
* stringer()
*
@@ -3868,6 +4384,7 @@ stringer (append_zero) /* Worker to do .ascii etc statements. */
register int append_zero; /* 0: don't append '\0', else 1 */
{
register unsigned int c;
+ char *start;
#ifdef md_flush_pending_output
md_flush_pending_output ();
@@ -3897,6 +4414,7 @@ stringer (append_zero) /* Worker to do .ascii etc statements. */
{
case '\"':
++input_line_pointer; /*->1st char of string. */
+ start = input_line_pointer;
while (is_a_char (c = next_char_of_string ()))
{
FRAG_APPEND_1_CHAR (c);
@@ -3906,6 +4424,27 @@ stringer (append_zero) /* Worker to do .ascii etc statements. */
FRAG_APPEND_1_CHAR (0);
}
know (input_line_pointer[-1] == '\"');
+
+#ifndef NO_LISTING
+#ifdef OBJ_ELF
+ /* In ELF, when gcc is emitting DWARF 1 debugging output, it
+ will emit .string with a filename in the .debug section
+ after a sequence of constants. See the comment in
+ emit_expr for the sequence. emit_expr will set
+ dwarf_file_string to non-zero if this string might be a
+ source file name. */
+ if (strcmp (segment_name (now_seg), ".debug") != 0)
+ dwarf_file_string = 0;
+ else if (dwarf_file_string)
+ {
+ c = input_line_pointer[-1];
+ input_line_pointer[-1] = '\0';
+ listing_source_file (start);
+ input_line_pointer[-1] = c;
+ }
+#endif
+#endif
+
break;
case '<':
input_line_pointer++;
@@ -4211,7 +4750,7 @@ equals (sym_name, reassign)
int reassign;
{
register symbolS *symbolP; /* symbol we are working with */
- char *stop;
+ char *stop = NULL;
char stopc;
input_line_pointer++;
@@ -4263,7 +4802,15 @@ s_include (arg)
char *path;
if (! flag_m68k_mri)
- filename = demand_copy_string (&i);
+ {
+ filename = demand_copy_string (&i);
+ if (filename == NULL)
+ {
+ /* demand_copy_string has already printed an error and
+ called ignore_rest_of_line. */
+ return;
+ }
+ }
else
{
SKIP_WHITESPACE ();
@@ -4298,6 +4845,7 @@ s_include (arg)
path = filename;
gotit:
/* malloc Storage leak when file is found on path. FIXME-SOMEDAY. */
+ register_dependency (path);
newbuf = input_scrub_include_file (path, input_line_pointer);
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
} /* s_include() */
diff --git a/contrib/binutils/gas/read.h b/contrib/binutils/gas/read.h
index bd0aa78..4e1e226 100644
--- a/contrib/binutils/gas/read.h
+++ b/contrib/binutils/gas/read.h
@@ -1,5 +1,6 @@
/* read.h - of read.c
- Copyright (C) 1986, 90, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1986, 90, 92, 93, 94, 95, 96, 1997
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -58,8 +59,10 @@ extern const char comment_chars[];
extern const char line_comment_chars[];
extern const char line_separator_chars[];
-/* This flag whether to generate line info for asm file */
-extern int generate_asm_lineno;
+/* Table of -I directories. */
+extern char **include_dirs;
+extern int include_dir_count;
+extern int include_dir_maxlen;
/* The offset in the absolute section. */
extern addressT abs_section_offset;
@@ -95,12 +98,18 @@ extern void add_include_dir PARAMS ((char *path));
extern void cons PARAMS ((int nbytes));
extern void demand_empty_rest_of_line PARAMS ((void));
extern void emit_expr PARAMS ((expressionS *exp, unsigned int nbytes));
+extern void emit_leb128_expr PARAMS ((expressionS *, int));
extern void equals PARAMS ((char *sym_name, int reassign));
extern void float_cons PARAMS ((int float_type));
extern void ignore_rest_of_line PARAMS ((void));
+extern int output_leb128 PARAMS ((char *, valueT, int sign));
extern void pseudo_set PARAMS ((symbolS * symbolP));
extern void read_a_source_file PARAMS ((char *name));
extern void read_begin PARAMS ((void));
+extern void read_print_statistics PARAMS ((FILE *));
+extern int sizeof_leb128 PARAMS ((valueT, int sign));
+extern void stabs_generate_asm_lineno PARAMS ((void));
+
extern void s_abort PARAMS ((int));
extern void s_align_bytes PARAMS ((int arg));
extern void s_align_ptwo PARAMS ((int));
@@ -125,6 +134,8 @@ extern void s_ignore PARAMS ((int arg));
extern void s_include PARAMS ((int arg));
extern void s_irp PARAMS ((int arg));
extern void s_lcomm PARAMS ((int needs_align));
+extern void s_lcomm_bytes PARAMS ((int needs_align));
+extern void s_leb128 PARAMS ((int sign));
extern void s_linkonce PARAMS ((int));
extern void s_lsym PARAMS ((int));
extern void s_macro PARAMS ((int));
@@ -143,6 +154,5 @@ extern void s_text PARAMS ((int));
extern void stringer PARAMS ((int append_zero));
extern void s_xstab PARAMS ((int what));
extern void s_rva PARAMS ((int));
-extern void read_print_statistics PARAMS ((FILE *));
/* end of read.h */
diff --git a/contrib/binutils/gas/stabs.c b/contrib/binutils/gas/stabs.c
index def437b..e58e6ff 100644
--- a/contrib/binutils/gas/stabs.c
+++ b/contrib/binutils/gas/stabs.c
@@ -1,5 +1,5 @@
/* Generic stabs parsing for gas.
- Copyright (C) 1989, 90, 91, 93, 94, 95, 96, 1997
+ Copyright (C) 1989, 90, 91, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -71,46 +71,47 @@ get_stab_string_offset (string, stabstr_secname)
{
unsigned int length;
unsigned int retval;
+ segT save_seg;
+ subsegT save_subseg;
+ segT seg;
+ char *p;
if (! SEPARATE_STAB_SECTIONS)
abort ();
- retval = 0;
length = strlen (string);
- if (length > 0)
- { /* Ordinary case. */
- segT save_seg;
- subsegT save_subseg;
- segT seg;
- char *p;
- save_seg = now_seg;
- save_subseg = now_subseg;
+ save_seg = now_seg;
+ save_subseg = now_subseg;
- /* Create the stab string section. */
- seg = subseg_new (stabstr_secname, 0);
+ /* Create the stab string section. */
+ seg = subseg_new (stabstr_secname, 0);
- retval = seg_info (seg)->stabu.stab_string_size;
- if (retval <= 0)
- {
- /* Make sure the first string is empty. */
- p = frag_more (1);
- *p = 0;
- retval = seg_info (seg)->stabu.stab_string_size = 1;
+ retval = seg_info (seg)->stabu.stab_string_size;
+ if (retval <= 0)
+ {
+ /* Make sure the first string is empty. */
+ p = frag_more (1);
+ *p = 0;
+ retval = seg_info (seg)->stabu.stab_string_size = 1;
#ifdef BFD_ASSEMBLER
- bfd_set_section_flags (stdoutput, seg, SEC_READONLY | SEC_DEBUGGING);
- if (seg->name == stabstr_secname)
- seg->name = xstrdup (stabstr_secname);
+ bfd_set_section_flags (stdoutput, seg, SEC_READONLY | SEC_DEBUGGING);
+ if (seg->name == stabstr_secname)
+ seg->name = xstrdup (stabstr_secname);
#endif
- }
+ }
+ if (length > 0)
+ { /* Ordinary case. */
p = frag_more (length + 1);
strcpy (p, string);
seg_info (seg)->stabu.stab_string_size += length + 1;
-
- subseg_set (save_seg, save_subseg);
}
+ else
+ retval = 0;
+
+ subseg_set (save_seg, save_subseg);
return retval;
}
@@ -459,3 +460,55 @@ s_desc (ignore)
} /* s_desc() */
#endif /* defined (S_SET_DESC) */
+
+/* Generate stabs debugging information for the current line. This is
+ used to produce debugging information for an assembler file. */
+
+void
+stabs_generate_asm_lineno ()
+{
+ static char *last_file;
+ static int lineno_count;
+ char *hold;
+ char *file;
+ unsigned int lineno;
+ char buf[100];
+ char sym[30];
+
+ /* Rather than try to do this in some efficient fashion, we just
+ generate a string and then parse it again. That lets us use the
+ existing stabs hook, which expect to see a string, rather than
+ inventing new ones. */
+
+ hold = input_line_pointer;
+
+ as_where (&file, &lineno);
+
+ if (last_file == NULL
+ || strcmp (last_file, file) != 0)
+ {
+ sprintf (sym, "%sF%d", FAKE_LABEL_NAME, lineno_count);
+ ++lineno_count;
+
+ sprintf (buf, "\"%s\",%d,0,0,%s\n", file,
+ last_file == NULL ? N_SO : N_SOL,
+ sym);
+ input_line_pointer = buf;
+ s_stab ('s');
+ colon (sym);
+
+ if (last_file != NULL)
+ free (last_file);
+ last_file = xstrdup (file);
+ }
+
+ sprintf (sym, "%sL%d", FAKE_LABEL_NAME, lineno_count);
+ ++lineno_count;
+
+ sprintf (buf, "%d,0,%d,%s\n", N_SLINE, lineno, sym);
+ input_line_pointer = buf;
+ s_stab ('n');
+ colon (sym);
+
+ input_line_pointer = hold;
+}
diff --git a/contrib/binutils/gas/stamp-h.in b/contrib/binutils/gas/stamp-h.in
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/contrib/binutils/gas/stamp-h.in
@@ -0,0 +1 @@
+timestamp
diff --git a/contrib/binutils/gas/subsegs.c b/contrib/binutils/gas/subsegs.c
index 2d5b1f7..28986d6 100644
--- a/contrib/binutils/gas/subsegs.c
+++ b/contrib/binutils/gas/subsegs.c
@@ -287,7 +287,7 @@ subseg_set_rest (seg, subseg)
newP->fix_root = NULL;
newP->fix_tail = NULL;
#endif
- obstack_begin (&newP->frch_obstack, 5000);
+ obstack_begin (&newP->frch_obstack, chunksize);
#if __GNUC__ >= 2
obstack_alignment_mask (&newP->frch_obstack) = __alignof__ (fragS) - 1;
#endif
diff --git a/contrib/binutils/gas/symbols.c b/contrib/binutils/gas/symbols.c
index e1c30d6..8bb601f 100644
--- a/contrib/binutils/gas/symbols.c
+++ b/contrib/binutils/gas/symbols.c
@@ -1,5 +1,5 @@
/* symbols.c -symbol table-
- Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -636,87 +636,81 @@ verify_symbol_chain_2 (sym)
pass over the symbol table to resolve any symbols with complex
values. */
-void
-resolve_symbol_value (symp)
+valueT
+resolve_symbol_value (symp, finalize)
symbolS *symp;
+ int finalize;
{
int resolved;
+ valueT final_val;
+ segT final_seg;
if (symp->sy_resolved)
- return;
+ {
+ if (symp->sy_value.X_op == O_constant)
+ return (valueT) symp->sy_value.X_add_number;
+ else
+ return 0;
+ }
resolved = 0;
+ final_seg = S_GET_SEGMENT (symp);
if (symp->sy_resolving)
{
- as_bad ("Symbol definition loop encountered at %s",
- S_GET_NAME (symp));
- S_SET_VALUE (symp, (valueT) 0);
+ if (finalize)
+ as_bad ("Symbol definition loop encountered at %s", S_GET_NAME (symp));
+ final_val = 0;
resolved = 1;
}
else
{
- offsetT left, right, val;
+ symbolS *add_symbol, *op_symbol;
+ offsetT left, right;
segT seg_left, seg_right;
+ operatorT op;
symp->sy_resolving = 1;
- /* Simplify addition or subtraction of a constant by folding the
- constant into X_add_number. */
- if (symp->sy_value.X_op == O_add
- || symp->sy_value.X_op == O_subtract)
- {
- resolve_symbol_value (symp->sy_value.X_add_symbol);
- resolve_symbol_value (symp->sy_value.X_op_symbol);
- if (S_GET_SEGMENT (symp->sy_value.X_op_symbol) == absolute_section)
- {
- right = S_GET_VALUE (symp->sy_value.X_op_symbol);
- if (symp->sy_value.X_op == O_add)
- symp->sy_value.X_add_number += right;
- else
- symp->sy_value.X_add_number -= right;
- symp->sy_value.X_op = O_symbol;
- symp->sy_value.X_op_symbol = NULL;
- }
- else if ((S_GET_SEGMENT (symp->sy_value.X_add_symbol)
- == absolute_section)
- && symp->sy_value.X_op == O_add)
- {
- left = S_GET_VALUE (symp->sy_value.X_add_symbol);
- symp->sy_value.X_add_symbol = symp->sy_value.X_op_symbol;
- symp->sy_value.X_add_number += left;
- symp->sy_value.X_op = O_symbol;
- symp->sy_value.X_op_symbol = NULL;
- }
- }
+ /* Help out with CSE. */
+ add_symbol = symp->sy_value.X_add_symbol;
+ op_symbol = symp->sy_value.X_op_symbol;
+ final_val = symp->sy_value.X_add_number;
+ op = symp->sy_value.X_op;
- switch (symp->sy_value.X_op)
+ switch (op)
{
+ default:
+ BAD_CASE (op);
+ break;
+
case O_absent:
- S_SET_VALUE (symp, 0);
+ final_val = 0;
/* Fall through. */
+
case O_constant:
- S_SET_VALUE (symp, S_GET_VALUE (symp) + symp->sy_frag->fr_address);
- if (S_GET_SEGMENT (symp) == expr_section)
- S_SET_SEGMENT (symp, absolute_section);
+ final_val += symp->sy_frag->fr_address;
+ if (final_seg == expr_section)
+ final_seg = absolute_section;
resolved = 1;
break;
case O_symbol:
- resolve_symbol_value (symp->sy_value.X_add_symbol);
+ case O_symbol_rva:
+ left = resolve_symbol_value (add_symbol, finalize);
+ do_symbol:
if (symp->sy_mri_common)
{
/* This is a symbol inside an MRI common section. The
relocation routines are going to handle it specially.
Don't change the value. */
- S_SET_VALUE (symp, symp->sy_value.X_add_number);
- resolved = symp->sy_value.X_add_symbol->sy_resolved;
+ resolved = add_symbol->sy_resolved;
break;
}
- if (symp->sy_value.X_add_number == 0)
- copy_symbol_attributes (symp, symp->sy_value.X_add_symbol);
+ if (finalize && final_val == 0)
+ copy_symbol_attributes (symp, add_symbol);
/* If we have equated this symbol to an undefined symbol, we
keep X_op set to O_symbol, and we don't change
@@ -724,46 +718,45 @@ resolve_symbol_value (symp)
relocation to detect this case, and convert the
relocation to be against the symbol to which this symbol
is equated. */
- if (! S_IS_DEFINED (symp->sy_value.X_add_symbol)
- || S_IS_COMMON (symp->sy_value.X_add_symbol))
+ if (! S_IS_DEFINED (add_symbol) || S_IS_COMMON (add_symbol))
{
- symp->sy_value.X_op = O_symbol;
- S_SET_SEGMENT (symp,
- S_GET_SEGMENT (symp->sy_value.X_add_symbol));
+ if (finalize)
+ {
+ symp->sy_value.X_op = O_symbol;
+ S_SET_SEGMENT (symp, S_GET_SEGMENT (add_symbol));
+ symp->sy_value.X_add_number = final_val;
+ }
+ final_val = 0;
+ resolved = add_symbol->sy_resolved;
+ goto exit_dont_set_value;
}
else
{
- S_SET_VALUE (symp,
- (symp->sy_value.X_add_number
- + symp->sy_frag->fr_address
- + S_GET_VALUE (symp->sy_value.X_add_symbol)));
- if (S_GET_SEGMENT (symp) == expr_section
- || S_GET_SEGMENT (symp) == undefined_section)
- S_SET_SEGMENT (symp,
- S_GET_SEGMENT (symp->sy_value.X_add_symbol));
+ final_val += symp->sy_frag->fr_address + left;
+ if (final_seg == expr_section || final_seg == undefined_section)
+ final_seg = S_GET_SEGMENT (add_symbol);
}
- resolved = symp->sy_value.X_add_symbol->sy_resolved;
+ resolved = add_symbol->sy_resolved;
break;
case O_uminus:
case O_bit_not:
case O_logical_not:
- resolve_symbol_value (symp->sy_value.X_add_symbol);
- if (symp->sy_value.X_op == O_uminus)
- val = - S_GET_VALUE (symp->sy_value.X_add_symbol);
- else if (symp->sy_value.X_op == O_logical_not)
- val = ! S_GET_VALUE (symp->sy_value.X_add_symbol);
+ left = resolve_symbol_value (add_symbol, finalize);
+
+ if (op == O_uminus)
+ left = -left;
+ else if (op == O_logical_not)
+ left = !left;
else
- val = ~ S_GET_VALUE (symp->sy_value.X_add_symbol);
- S_SET_VALUE (symp,
- (val
- + symp->sy_value.X_add_number
- + symp->sy_frag->fr_address));
- if (S_GET_SEGMENT (symp) == expr_section
- || S_GET_SEGMENT (symp) == undefined_section)
- S_SET_SEGMENT (symp, absolute_section);
- resolved = symp->sy_value.X_add_symbol->sy_resolved;
+ left = ~left;
+
+ final_val += left + symp->sy_frag->fr_address;
+ if (final_seg == expr_section || final_seg == undefined_section)
+ final_seg = absolute_section;
+
+ resolved = add_symbol->sy_resolved;
break;
case O_multiply:
@@ -785,12 +778,35 @@ resolve_symbol_value (symp)
case O_gt:
case O_logical_and:
case O_logical_or:
- resolve_symbol_value (symp->sy_value.X_add_symbol);
- resolve_symbol_value (symp->sy_value.X_op_symbol);
- seg_left = S_GET_SEGMENT (symp->sy_value.X_add_symbol);
- seg_right = S_GET_SEGMENT (symp->sy_value.X_op_symbol);
- left = S_GET_VALUE (symp->sy_value.X_add_symbol);
- right = S_GET_VALUE (symp->sy_value.X_op_symbol);
+ left = resolve_symbol_value (add_symbol, finalize);
+ right = resolve_symbol_value (op_symbol, finalize);
+ seg_left = S_GET_SEGMENT (add_symbol);
+ seg_right = S_GET_SEGMENT (op_symbol);
+
+ /* Simplify addition or subtraction of a constant by folding the
+ constant into X_add_number. */
+ if (op == O_add || op == O_subtract)
+ {
+ if (seg_right == absolute_section)
+ {
+ if (op == O_add)
+ final_val += right;
+ else
+ final_val -= right;
+ op = O_symbol;
+ op_symbol = NULL;
+ goto do_symbol;
+ }
+ else if (seg_left == absolute_section && op == O_add)
+ {
+ op = O_symbol;
+ final_val += left;
+ add_symbol = op_symbol;
+ left = right;
+ op_symbol = NULL;
+ goto do_symbol;
+ }
+ }
/* Subtraction is permitted if both operands are in the same
section. Otherwise, both operands must be absolute. We
@@ -798,10 +814,11 @@ resolve_symbol_value (symp)
constant above. This will probably need to be changed
for an object file format which supports arbitrary
expressions, such as IEEE-695. */
- if ((seg_left != absolute_section
- || seg_right != absolute_section)
- && (symp->sy_value.X_op != O_subtract
- || seg_left != seg_right))
+ /* Don't emit messages unless we're finalizing the symbol value,
+ otherwise we may get the same message multiple times. */
+ if ((seg_left != absolute_section || seg_right != absolute_section)
+ && (op != O_subtract || seg_left != seg_right)
+ && finalize)
{
char *file;
unsigned int line;
@@ -837,38 +854,54 @@ resolve_symbol_value (symp)
}
}
+ /* Check for division by zero. */
+ if ((op == O_divide || op == O_modulus) && right == 0)
+ {
+ /* If seg_right is not absolute_section, then we've
+ already issued a warning about using a bad symbol. */
+ if (seg_right == absolute_section && finalize)
+ {
+ char *file;
+ unsigned int line;
+
+ if (expr_symbol_where (symp, &file, &line))
+ as_bad_where (file, line, "division by zero");
+ else
+ as_bad ("division by zero when setting %s",
+ S_GET_NAME (symp));
+ }
+
+ right = 1;
+ }
+
switch (symp->sy_value.X_op)
{
- case O_multiply: val = left * right; break;
- case O_divide: val = left / right; break;
- case O_modulus: val = left % right; break;
- case O_left_shift: val = left << right; break;
- case O_right_shift: val = left >> right; break;
- case O_bit_inclusive_or: val = left | right; break;
- case O_bit_or_not: val = left |~ right; break;
- case O_bit_exclusive_or: val = left ^ right; break;
- case O_bit_and: val = left & right; break;
- case O_add: val = left + right; break;
- case O_subtract: val = left - right; break;
- case O_eq: val = left == right ? ~ (offsetT) 0 : 0;
- case O_ne: val = left != right ? ~ (offsetT) 0 : 0;
- case O_lt: val = left < right ? ~ (offsetT) 0 : 0;
- case O_le: val = left <= right ? ~ (offsetT) 0 : 0;
- case O_ge: val = left >= right ? ~ (offsetT) 0 : 0;
- case O_gt: val = left > right ? ~ (offsetT) 0 : 0;
- case O_logical_and: val = left && right; break;
- case O_logical_or: val = left || right; break;
- default: abort ();
+ case O_multiply: left *= right; break;
+ case O_divide: left /= right; break;
+ case O_modulus: left %= right; break;
+ case O_left_shift: left <<= right; break;
+ case O_right_shift: left >>= right; break;
+ case O_bit_inclusive_or: left |= right; break;
+ case O_bit_or_not: left |= ~right; break;
+ case O_bit_exclusive_or: left ^= right; break;
+ case O_bit_and: left &= right; break;
+ case O_add: left += right; break;
+ case O_subtract: left -= right; break;
+ case O_eq: left = left == right ? ~ (offsetT) 0 : 0; break;
+ case O_ne: left = left != right ? ~ (offsetT) 0 : 0; break;
+ case O_lt: left = left < right ? ~ (offsetT) 0 : 0; break;
+ case O_le: left = left <= right ? ~ (offsetT) 0 : 0; break;
+ case O_ge: left = left >= right ? ~ (offsetT) 0 : 0; break;
+ case O_gt: left = left > right ? ~ (offsetT) 0 : 0; break;
+ case O_logical_and: left = left && right; break;
+ case O_logical_or: left = left || right; break;
+ default: abort ();
}
- S_SET_VALUE (symp,
- (symp->sy_value.X_add_number
- + symp->sy_frag->fr_address
- + val));
- if (S_GET_SEGMENT (symp) == expr_section
- || S_GET_SEGMENT (symp) == undefined_section)
- S_SET_SEGMENT (symp, absolute_section);
- resolved = (symp->sy_value.X_add_symbol->sy_resolved
- && symp->sy_value.X_op_symbol->sy_resolved);
+
+ final_val += symp->sy_frag->fr_address + left;
+ if (final_seg == expr_section || final_seg == undefined_section)
+ final_seg = absolute_section;
+ resolved = (add_symbol->sy_resolved && op_symbol->sy_resolved);
break;
case O_register:
@@ -881,16 +914,36 @@ resolve_symbol_value (symp)
anything. */
break;
}
+
+ symp->sy_resolving = 0;
+ }
+
+ if (finalize)
+ {
+ S_SET_VALUE (symp, final_val);
+
+#if defined (OBJ_AOUT) && ! defined (BFD_ASSEMBLER)
+ /* The old a.out backend does not handle S_SET_SEGMENT correctly
+ for a stab symbol, so we use this bad hack. */
+ if (final_seg != S_GET_SEGMENT (symp))
+#endif
+ S_SET_SEGMENT (symp, final_seg);
}
+exit_dont_set_value:
/* Don't worry if we can't resolve an expr_section symbol. */
- if (resolved)
- symp->sy_resolved = 1;
- else if (S_GET_SEGMENT (symp) != expr_section)
+ if (finalize)
{
- as_bad ("can't resolve value for symbol \"%s\"", S_GET_NAME (symp));
- symp->sy_resolved = 1;
+ if (resolved)
+ symp->sy_resolved = 1;
+ else if (S_GET_SEGMENT (symp) != expr_section)
+ {
+ as_bad ("can't resolve value for symbol \"%s\"", S_GET_NAME (symp));
+ symp->sy_resolved = 1;
+ }
}
+
+ return final_val;
}
/* Dollar labels look like a number followed by a dollar sign. Eg, "42$".
@@ -903,7 +956,7 @@ resolve_symbol_value (symp)
static long *dollar_labels;
static long *dollar_label_instances;
static char *dollar_label_defines;
-static long dollar_label_count;
+static unsigned long dollar_label_count;
static unsigned long dollar_label_max;
int
@@ -1233,7 +1286,7 @@ decode_local_label_name (s)
if (s[0] != 'L')
return s;
- for (label_number = 0, p = s + 1; isdigit (*p); ++p)
+ for (label_number = 0, p = s + 1; isdigit ((unsigned char) *p); ++p)
label_number = (10 * label_number) + *p - '0';
if (*p == 1)
@@ -1243,7 +1296,7 @@ decode_local_label_name (s)
else
return s;
- for (instance_number = 0, p++; isdigit (*p); ++p)
+ for (instance_number = 0, p++; isdigit ((unsigned char) *p); ++p)
instance_number = (10 * instance_number) + *p - '0';
symbol_decode = obstack_alloc (&notes, strlen (message_format) + 30);
@@ -1258,8 +1311,8 @@ valueT
S_GET_VALUE (s)
symbolS *s;
{
- if (!s->sy_resolved && !s->sy_resolving && s->sy_value.X_op != O_constant)
- resolve_symbol_value (s);
+ if (!s->sy_resolved && s->sy_value.X_op != O_constant)
+ resolve_symbol_value (s, 1);
if (s->sy_value.X_op != O_constant)
{
static symbolS *recur;
@@ -1299,7 +1352,7 @@ copy_symbol_attributes (dest, src)
#ifdef BFD_ASSEMBLER
/* In an expression, transfer the settings of these flags.
The user can override later, of course. */
-#define COPIED_SYMFLAGS (BSF_FUNCTION)
+#define COPIED_SYMFLAGS (BSF_FUNCTION | BSF_OBJECT)
dest->bsym->flags |= src->bsym->flags & COPIED_SYMFLAGS;
#endif
@@ -1317,7 +1370,7 @@ S_IS_EXTERNAL (s)
flagword flags = s->bsym->flags;
/* sanity check */
- if (flags & BSF_LOCAL && flags & BSF_GLOBAL)
+ if ((flags & BSF_LOCAL) && (flags & BSF_GLOBAL))
abort ();
return (flags & BSF_GLOBAL) != 0;
@@ -1361,12 +1414,17 @@ S_IS_LOCAL (s)
const char *name;
/* sanity check */
- if (flags & BSF_LOCAL && flags & BSF_GLOBAL)
+ if ((flags & BSF_LOCAL) && (flags & BSF_GLOBAL))
abort ();
if (bfd_get_section (s->bsym) == reg_section)
return 1;
+ if (flag_strip_local_absolute
+ && (flags & BSF_GLOBAL) == 0
+ && bfd_get_section (s->bsym) == absolute_section)
+ return 1;
+
name = S_GET_NAME (s);
return (name != NULL
&& ! S_IS_DEBUG (s)
@@ -1412,7 +1470,17 @@ S_SET_SEGMENT (s, seg)
symbolS *s;
segT seg;
{
- s->bsym->section = seg;
+ /* Don't reassign section symbols. The direct reason is to prevent seg
+ faults assigning back to const global symbols such as *ABS*, but it
+ shouldn't happen anyway. */
+
+ if (s->bsym->flags & BSF_SECTION_SYM)
+ {
+ if (s->bsym->section != seg)
+ abort();
+ }
+ else
+ s->bsym->section = seg;
}
void
diff --git a/contrib/binutils/gas/symbols.h b/contrib/binutils/gas/symbols.h
index e643881..c6efbdb 100644
--- a/contrib/binutils/gas/symbols.h
+++ b/contrib/binutils/gas/symbols.h
@@ -48,7 +48,7 @@ void local_colon PARAMS ((int n));
void symbol_begin PARAMS ((void));
void symbol_print_statistics PARAMS ((FILE *));
void symbol_table_insert PARAMS ((symbolS * symbolP));
-void resolve_symbol_value PARAMS ((symbolS *));
+valueT resolve_symbol_value PARAMS ((symbolS *, int));
void print_symbol_value PARAMS ((symbolS *));
void print_expr PARAMS ((expressionS *));
diff --git a/contrib/binutils/gas/write.c b/contrib/binutils/gas/write.c
index 549dab7..e59ddb7 100644
--- a/contrib/binutils/gas/write.c
+++ b/contrib/binutils/gas/write.c
@@ -1,5 +1,5 @@
/* write.c - emit .o file
- Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -363,7 +363,7 @@ record_alignment (seg, align)
if (seg == absolute_section)
return;
#ifdef BFD_ASSEMBLER
- if (align > bfd_get_section_alignment (stdoutput, seg))
+ if ((unsigned int) align > bfd_get_section_alignment (stdoutput, seg))
bfd_set_section_alignment (stdoutput, seg, align);
#else
if (align > section_alignment[(int) seg])
@@ -502,6 +502,26 @@ cvt_frag_to_fill (headersP, sec, fragP)
case rs_fill:
break;
+ case rs_leb128:
+ {
+ valueT value = S_GET_VALUE (fragP->fr_symbol);
+ int size;
+
+ size = output_leb128 (fragP->fr_literal + fragP->fr_fix, value,
+ fragP->fr_subtype);
+
+ fragP->fr_fix += size;
+ fragP->fr_type = rs_fill;
+ fragP->fr_var = 0;
+ fragP->fr_offset = 0;
+ fragP->fr_symbol = NULL;
+ }
+ break;
+
+ case rs_cfa:
+ eh_frame_convert_frag (fragP);
+ break;
+
case rs_machine_dependent:
#ifdef BFD_ASSEMBLER
md_convert_frag (stdoutput, sec, fragP);
@@ -509,7 +529,9 @@ cvt_frag_to_fill (headersP, sec, fragP)
md_convert_frag (headersP, sec, fragP);
#endif
- assert (fragP->fr_next == NULL || (fragP->fr_next->fr_address - fragP->fr_address == fragP->fr_fix));
+ assert (fragP->fr_next == NULL
+ || ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address)
+ == fragP->fr_fix));
/*
* After md_convert_frag, we make the frag into a ".space 0".
@@ -681,8 +703,6 @@ adjust_reloc_syms (abfd, sec, xxx)
symbolS *sym;
asection *symsec;
- reduce_fixup:
-
#ifdef DEBUG5
fprintf (stderr, "\n\nadjusting fixup:\n");
print_fixup (fixp);
@@ -695,9 +715,9 @@ adjust_reloc_syms (abfd, sec, xxx)
symbols, though, since they are not in the regular symbol
table. */
if (sym != NULL && ! sym->sy_resolved)
- resolve_symbol_value (sym);
+ resolve_symbol_value (sym, 1);
if (fixp->fx_subsy != NULL && ! fixp->fx_subsy->sy_resolved)
- resolve_symbol_value (fixp->fx_subsy);
+ resolve_symbol_value (fixp->fx_subsy, 1);
/* If this symbol is equated to an undefined symbol, convert
the fixup to being against that symbol. */
@@ -1301,10 +1321,47 @@ set_symtab ()
}
#endif
+/* Finish the subsegments. After every sub-segment, we fake an
+ ".align ...". This conforms to BSD4.2 brane-damage. We then fake
+ ".fill 0" because that is the kind of frag that requires least
+ thought. ".align" frags like to have a following frag since that
+ makes calculating their intended length trivial. */
+
+#ifndef SUB_SEGMENT_ALIGN
+#ifdef BFD_ASSEMBLER
+#define SUB_SEGMENT_ALIGN(SEG) (0)
+#else
+#define SUB_SEGMENT_ALIGN(SEG) (2)
+#endif
+#endif
+
+void
+subsegs_finish ()
+{
+ struct frchain *frchainP;
+
+ for (frchainP = frchain_root; frchainP; frchainP = frchainP->frch_next)
+ {
+ subseg_set (frchainP->frch_seg, frchainP->frch_subseg);
+ frag_align (SUB_SEGMENT_ALIGN (now_seg), NOP_OPCODE, 0);
+
+ /* frag_align will have left a new frag.
+ Use this last frag for an empty ".fill".
+
+ For this segment ...
+ Create a last frag. Do not leave a "being filled in frag". */
+
+ frag_wane (frag_now);
+ frag_now->fr_fix = 0;
+ know (frag_now->fr_next == NULL);
+ }
+}
+
+/* Write the object file. */
+
void
write_object_file ()
{
- struct frchain *frchainP; /* Track along all frchains. */
#if ! defined (BFD_ASSEMBLER) || ! defined (WORKING_DOT_WORD)
fragS *fragP; /* Track along all frags. */
#endif
@@ -1339,34 +1396,6 @@ write_object_file ()
vms_check_for_main ();
#endif /* OBJ_VMS */
- /* After every sub-segment, we fake an ".align ...". This conforms to
- BSD4.2 brane-damage. We then fake ".fill 0" because that is the kind of
- frag that requires least thought. ".align" frags like to have a
- following frag since that makes calculating their intended length
- trivial.
-
- @@ Is this really necessary?? */
-#ifndef SUB_SEGMENT_ALIGN
-#ifdef BFD_ASSEMBLER
-#define SUB_SEGMENT_ALIGN(SEG) (0)
-#else
-#define SUB_SEGMENT_ALIGN(SEG) (2)
-#endif
-#endif
- for (frchainP = frchain_root; frchainP; frchainP = frchainP->frch_next)
- {
- subseg_set (frchainP->frch_seg, frchainP->frch_subseg);
- frag_align (SUB_SEGMENT_ALIGN (now_seg), NOP_OPCODE, 0);
- /* frag_align will have left a new frag.
- Use this last frag for an empty ".fill".
-
- For this segment ...
- Create a last frag. Do not leave a "being filled in frag". */
- frag_wane (frag_now);
- frag_now->fr_fix = 0;
- know (frag_now->fr_next == NULL);
- }
-
/* From now on, we don't care about sub-segments. Build one frag chain
for each segment. Linked thru fr_next. */
@@ -1460,6 +1489,13 @@ write_object_file ()
for (fragP = text_frag_root; fragP; fragP = fragP->fr_next)
{
+ /* At this point we have linked all the frags into a single
+ chain. However, cvt_frag_to_fill may call md_convert_frag
+ which may call fix_new. We need to ensure that fix_new adds
+ the fixup to the right section. */
+ if (fragP == data_frag_root)
+ subseg_change (SEG_DATA, 0);
+
cvt_frag_to_fill (&headers, SEG_TEXT, fragP);
/* Some assert macros don't work with # directives mixed in. */
@@ -1704,7 +1740,7 @@ write_object_file ()
for (symp = symbol_rootP; symp; symp = symbol_next (symp))
if (!symp->sy_resolved)
- resolve_symbol_value (symp);
+ resolve_symbol_value (symp, 1);
}
PROGRESS (1);
@@ -1761,7 +1797,7 @@ write_object_file ()
symp->sy_resolved = 1;
}
else
- resolve_symbol_value (symp);
+ resolve_symbol_value (symp, 1);
}
/* Skip symbols which were equated to undefined or common
@@ -2087,6 +2123,16 @@ relax_segment (segment_frag_root, segment)
break;
#endif
+ case rs_leb128:
+ /* Initial guess is always 1; doing otherwise can result in
+ stable solutions that are larger than the minimum. */
+ address += fragP->fr_offset = 1;
+ break;
+
+ case rs_cfa:
+ address += eh_frame_estimate_size_before_relax (fragP);
+ break;
+
default:
BAD_CASE (fragP->fr_type);
break;
@@ -2276,6 +2322,22 @@ relax_segment (segment_frag_root, segment)
#endif
break;
+ case rs_leb128:
+ {
+ valueT value;
+ int size;
+
+ value = resolve_symbol_value (fragP->fr_symbol, 0);
+ size = sizeof_leb128 (value, fragP->fr_subtype);
+ growth = size - fragP->fr_offset;
+ fragP->fr_offset = size;
+ }
+ break;
+
+ case rs_cfa:
+ growth = eh_frame_relax_frag (fragP);
+ break;
+
default:
BAD_CASE (fragP->fr_type);
break;
@@ -2383,7 +2445,7 @@ fixup_segment (fixP, this_segment_type)
if (sub_symbolP)
{
- resolve_symbol_value (sub_symbolP);
+ resolve_symbol_value (sub_symbolP, 1);
if (add_symbolP == NULL || add_symbol_segment == absolute_section)
{
if (add_symbolP != NULL)
@@ -2581,11 +2643,13 @@ fixup_segment (fixP, this_segment_type)
else
{
seg_reloc_count++;
+#if !(defined (TC_V850) && defined (OBJ_ELF))
#if !(defined (TC_M68K) && defined (OBJ_ELF))
-#if !defined (TC_I386) || !(defined (OBJ_ELF) || defined (OBJ_COFF))
+#if !defined (TC_I386) || !(defined (OBJ_ELF) || defined (OBJ_COFF)) || defined (TE_PE)
add_number += S_GET_VALUE (add_symbolP);
#endif
#endif
+#endif
}
}
}
@@ -2607,7 +2671,7 @@ fixup_segment (fixP, this_segment_type)
if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && size > 0)
{
- if (size < sizeof (valueT))
+ if ((size_t) size < sizeof (valueT))
{
valueT mask, hibit;
@@ -2694,7 +2758,7 @@ number_to_chars_bigendian (buf, val, n)
valueT val;
int n;
{
- if (n > sizeof (val)|| n <= 0)
+ if ((size_t) n > sizeof (val) || n <= 0)
abort ();
while (n--)
{
@@ -2709,7 +2773,7 @@ number_to_chars_littleendian (buf, val, n)
valueT val;
int n;
{
- if (n > sizeof (val) || n <= 0)
+ if ((size_t) n > sizeof (val) || n <= 0)
abort ();
while (n--)
{
@@ -2774,6 +2838,9 @@ print_fixup (fixp)
fprintf (stderr, ">");
}
fprintf (stderr, "\n");
+#ifdef TC_FIX_DATA_PRINT
+ TC_FIX_DATA_PRINT (stderr, fixp);
+#endif
}
/* end of write.c */
diff --git a/contrib/binutils/gas/write.h b/contrib/binutils/gas/write.h
index 67372e4..8fd1411 100644
--- a/contrib/binutils/gas/write.h
+++ b/contrib/binutils/gas/write.h
@@ -49,7 +49,7 @@ struct fix
/* These small fields are grouped together for compactness of
this structure, and efficiency of access on some architectures. */
- /* pc-relative offset adjust */
+ /* pc-relative offset adjust (only used by m68k) */
char fx_pcrel_adjust;
/* How many bytes are involved? */
@@ -165,6 +165,7 @@ extern bit_fixS *bit_fix_new
long max, long add));
extern void append PARAMS ((char **charPP, char *fromP, unsigned long length));
extern void record_alignment PARAMS ((segT seg, int align));
+extern void subsegs_finish PARAMS ((void));
extern void write_object_file PARAMS ((void));
extern long relax_frag PARAMS ((fragS *, long));
extern void relax_segment
diff --git a/contrib/binutils/include/ChangeLog b/contrib/binutils/include/ChangeLog
index c4657ee..985d9f1 100644
--- a/contrib/binutils/include/ChangeLog
+++ b/contrib/binutils/include/ChangeLog
@@ -1,3 +1,212 @@
+Tue Feb 24 13:05:02 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * dis-asm.h (disassemble_info): Member `symbol' renamed to `symbols'
+ and made an "asymbol **". New member num_symbols.
+ (INIT_DISASSEMBLE_INFO_NO_ARCH): Update.
+
+Tue Feb 17 12:32:18 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_fetch_register, sim_store_register): Add
+ register length parameter. Functions return actual length of
+ register.
+
+Thu Feb 12 16:29:01 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * getopt.h: Update to latest FSF version.
+
+Wed Feb 11 16:56:06 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * symcat.h: New file.
+
+Mon Feb 2 17:13:31 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
+
+ * dis-asm.h (print_insn_tic30): Declare.
+
+Thu Jan 22 16:23:59 1998 Fred Fish <fnf@cygnus.com>
+
+ * dis-asm.h: Add flag INSN_HAS_RELOC to tell disassembly
+ function there is a reloc on this line.
+
+Mon Dec 8 11:22:23 1997 Nick Clifton <nickc@cygnus.com>
+
+ * dis-asm.h: Remove prototype of disasm_symaddr() as this function
+ no longer exists.
+
+Tue Dec 2 10:20:53 1997 Nick Clifton <nickc@cygnus.com>
+
+ * dis-asm.h (disasm_symaddr): New prototype.
+
+Mon Dec 1 20:24:18 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * coff/sh.h (R_SH_SWITCH8): New.
+
+Mon Dec 1 11:29:35 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * callback.h (CB_SYSCALL): Comment out arg names in prototypes.
+
+Wed Nov 26 16:47:58 1997 Michael Meissner <meissner@cygnus.com>
+
+ * callback.h (CB_SYSCALL): Consistantly use names for prototype
+ arguments.
+
+Wed Nov 26 11:39:30 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * callback.h (CB_SYSCALL): Change byte count arguments to
+ {read,write}_mem to `int'. New member `magic'.
+ (CB_SYSCALL_MAGIC,CB_SYSCALL_INIT): New macros.
+
+Tue Nov 25 01:35:52 1997 Doug Evans <devans@seba.cygnus.com>
+
+ * callback.h (struct stat): Move forward decl up.
+ (host_callback): Pass stat struct pointer to stat,fstat.
+ (CB_SYS_nnn): Reorganize.
+ (CB_SYSCALL): New members p1,p2.
+ (cb_host_to_target_stat): Delete fourth arg.
+
+Sat Nov 22 23:34:15 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_stop_reason): Clarify sim_signalled SIGRC
+ argument.
+
+Mon Nov 17 14:00:51 1997 Doug Evans <devans@seba.cygnus.com>
+
+ * callback.h (CB_TARGET_DEFS_MAP): Renamed from target_defs_map.
+ (host_callback): Add stat, fstat, syscall_map, errno_map, open_map,
+ signal_map, stat_map.
+ (errn_map,open_map): Renamed to cb_init_foo_map.
+ (cb_host_to_target_errno,cb_target_to_host_open): Renamed from
+ host_to_target_errno,target_to_host_open.
+ (cb_read_target_syscall_maps): Add prototype.
+ (cb_target_to_host_syscall): Likewise.
+ (cb_host_to_target_stat): Likewise.
+ (cb_syscall): Likewise.
+ (CB_SYS_{exit,open,close,read,write,lseek,unlink,getpid,kill,fstat,
+ argvlen,argv,chdir,stat,chmod,utime,time}): Define.
+ (CB_SYSCALL): New type.
+ (CB_RC): New enum.
+
+Fri Nov 7 10:34:09 1997 Rob Savoye <rob@darkstar.cygnus.com>
+
+ * libiberty.h: Add extern "C" { so it can be used with C++
+ programs.
+ * remote-sim.h: Add extern "C" { so it can be used with C++
+ programs.
+
+Tue Oct 14 16:07:51 1997 Nick Clifton <nickc@cygnus.com>
+
+ * dis-asm.h (struct disassemble_info): New field
+ 'symbol_at_address_func'.
+ (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialise new field with
+ generic_symbol_at_address.
+
+Mon Oct 13 10:17:15 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h: Clarify sim_read, sim_write MEM argument.
+
+Wed Sep 24 18:03:10 1997 Stu Grossman <grossman@babylon-5.cygnus.com>
+
+ * remote-sim.h (SIM_RC): Add a bunch of new return codes for
+ breakpoint stuff.
+ * Add functions to tell the simulator to set/clear/enable/disable
+ intrinsic breakpoints.
+
+Thu Aug 28 19:41:42 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * libiberty.h (dupargv): Add prototype.
+
+Tue Aug 26 12:25:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_create_inferior): Add ABFD arg. Document.
+
+Mon Aug 25 10:50:51 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_open): Add ABFD arg. Document.
+
+Fri Aug 8 16:43:56 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * dis-asm.h (arc_get_disassembler): Declare.
+
+Wed Jul 30 11:39:50 1997 Per Bothner <bothner@deneb.cygnus.com>
+
+ * demangle.h (DMGL_JAVA): New option to request Java demangling.
+
+Tue Jul 22 17:59:54 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * libiberty.h (PEXECUTE_*): Define.
+ (pexecute, pwait): Declare.
+
+Fri Jun 6 13:02:33 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_kill): Mark as depreciated.
+
+Fri May 23 13:43:41 1997 Fred Fish <fnf@cygnus.com>
+
+ * bfdlink.h (struct bfd_link_info): Add task_link member.
+
+Thu May 22 11:32:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h: Review documentation. Clarify restrictions on
+ when functions can be called.
+
+Wed May 21 16:47:53 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_set_profile_size): Add prototype, document as
+ depreciated.
+
+Tue May 20 09:32:22 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_open): Add callback struct.
+ (sim_set_callbacks): Drop SIM_DESC argument. Document.
+ (sim_size): Remove recently added SIM_DESC argument. Document.
+
+Mon May 19 19:14:44 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h: Pass SD into sim_size.
+
+Thu May 15 01:24:16 1997 Mark Alexander <marka@cygnus.com>
+
+ * obstack.h (obstack_specify_allocation_with_arg, obstack_chunkfun,
+ obstack_freefun): Eliminate compile warnings in gdb.
+
+Tue May 13 10:21:14 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff/arm.h (constants): Added new flag bits F_APCS_26 and
+ F_APCS_SET for the f_flags field of the filehdr structure. Added new
+ flags: F_APCS26, F_ARM_2, F_ARM_3, F_ARM_7, F_ARM_7T to store
+ information in the flags field of the internal_f structure used by BFD
+ routines.
+
+Tue Apr 22 10:24:34 1997 Fred Fish <fnf@cygnus.com>
+
+ * floatformat.h (floatformat_byteorders): Add comments for previous
+ formats and add floatformat_littlebyte_bigword, primarily for ARM.
+ Add declaration for floatformat_ieee_double_littlebyte_bigword.
+
+Fri Apr 18 13:04:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote-sim.h (sim_stop): New interface - asynchronous
+ notification of a request to stop / suspend the running
+ simulation.
+
+ * remote-sim.h (enum sim_stop): Add sim_running and sim_polling as
+ states for use internal to simulators.
+
+ * callback.h (struct host_callback_strut): Put a magic number at
+ the end of the struct to allow basic checking.
+ (struct host_callback_struct ): Add poll_quit - so
+ that the console etc can be polled at regular intervals.
+
+Thu Apr 17 02:17:12 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * remote-sim.h (struct _bfd): Declare.
+ (sim_load): Return SIM_RC. New arg `abfd'.
+ (sim_create_inferior): Return SIM_RC. Delete arg `start_address'.
+
+Wed Apr 2 17:09:12 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * remote-sim.h (sim_trace, sim_size): Make these global. They
+ will go away shortly.
+
Wed Apr 2 15:23:49 1997 Doug Evans <dje@canuck.cygnus.com>
* remote-sim.h (SIM_OPEN_KIND, SIM_RC): New enums.
@@ -121,6 +330,10 @@ Mon Sep 30 13:56:11 1996 Fred Fish <fnf@cygnus.com>
* libiberty.h: Remove #ifndef PRIVATE_XMALLOC.
+Sat Aug 31 13:27:06 1996 Jeffrey A Law (law@cygnus.com)
+
+ * dis-asm.h (print_insn_v850): Declare.
+
Tue Aug 13 16:10:30 1996 Stu Grossman (grossman@critters.cygnus.com)
* obstack.h: Change bcopy to memcpy. Works better on Posix
@@ -319,13 +532,11 @@ Thu May 4 14:36:42 1995 Jason Merrill <jason@phydeaux.cygnus.com>
* demangle.h: Don't include ansidecl.h if IN_GCC.
-
Tue Feb 21 00:37:28 1995 Jeff Law (law@snake.cs.utah.edu)
* hp-symtab.h: Don't use bitfield enumerations, the HP C compiler
does not handle them correctly.
-
Thu Feb 9 14:20:27 1995 Ian Lance Taylor <ian@cygnus.com>
* libiberty.h (basename): Don't declare parameter type; some
@@ -368,7 +579,6 @@ Wed Dec 14 13:08:43 1994 Stan Shebs <shebs@andros.cygnus.com>
* progress.h: New file, empty definitions for progress macros.
-
Fri Nov 25 00:14:05 1994 Jeff Law (law@snake.cs.utah.edu)
* hp-symtab.h: New file describing the debug symbols emitted
diff --git a/contrib/binutils/include/bfdlink.h b/contrib/binutils/include/bfdlink.h
index 6bc4d47..f4acf2f 100644
--- a/contrib/binutils/include/bfdlink.h
+++ b/contrib/binutils/include/bfdlink.h
@@ -179,6 +179,9 @@ struct bfd_link_info
const struct bfd_link_callbacks *callbacks;
/* true if BFD should generate a relocateable object file. */
boolean relocateable;
+ /* true if BFD should generate a "task linked" object file,
+ similar to relocatable but also with globals converted to statics. */
+ boolean task_link;
/* true if BFD should generate a shared object. */
boolean shared;
/* true if BFD should pre-bind symbols in a shared object. */
diff --git a/contrib/binutils/include/callback.h b/contrib/binutils/include/callback.h
index b2a7fe2..3075284 100644
--- a/contrib/binutils/include/callback.h
+++ b/contrib/binutils/include/callback.h
@@ -1,5 +1,6 @@
/* Remote target system call callback support.
Copyright 1997 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions.
This file is part of GDB.
@@ -17,9 +18,36 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+/* This interface isn't intended to be specific to any particular kind
+ of remote (hardware, simulator, whatever). As such, support for it
+ (e.g. sim/common/callback.c) should *not* live in the simulator source
+ tree, nor should it live in the gdb source tree. */
+
+/* There are various ways to handle system calls:
+
+ 1) Have a simulator intercept the appropriate trap instruction and
+ directly perform the system call on behalf of the target program.
+ This is the typical way of handling system calls for embedded targets.
+ [Handling system calls for embedded targets isn't that much of an
+ oxymoron as running compiler testsuites make use of the capability.]
+
+ This method of system call handling is done when STATE_ENVIRONMENT
+ is ENVIRONMENT_USER.
+
+ 2) Have a simulator emulate the hardware as much as possible.
+ If the program running on the real hardware communicates with some sort
+ of target manager, one would want to be able to run this program on the
+ simulator as well.
+
+ This method of system call handling is done when STATE_ENVIRONMENT
+ is ENVIRONMENT_OPERATING.
+*/
+
#ifndef CALLBACK_H
#define CALLBACK_H
+/* ??? The reason why we check for va_start here should be documented. */
+
#ifndef va_start
#include <ansidecl.h>
#ifdef ANSI_PROTOTYPES
@@ -28,11 +56,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <varargs.h>
#endif
#endif
+
+/* Mapping of host/target values. */
+/* ??? For debugging purposes, one might want to add a string of the
+ name of the symbol. */
-typedef struct host_callback_struct host_callback;
+typedef struct {
+ int host_val;
+ int target_val;
+} CB_TARGET_DEFS_MAP;
#define MAX_CALLBACK_FDS 10
+/* Forward decl for stat/fstat. */
+struct stat;
+
+typedef struct host_callback_struct host_callback;
+
struct host_callback_struct
{
int (*close) PARAMS ((host_callback *,int));
@@ -51,6 +91,13 @@ struct host_callback_struct
void (*flush_stdout) PARAMS ((host_callback *));
int (*write_stderr) PARAMS ((host_callback *, const char *, int));
void (*flush_stderr) PARAMS ((host_callback *));
+ int (*stat) PARAMS ((host_callback *, const char *, struct stat *));
+ int (*fstat) PARAMS ((host_callback *, int, struct stat *));
+
+ /* When present, call to the client to give it the oportunity to
+ poll any io devices for a request to quit (indicated by a nonzero
+ return value). */
+ int (*poll_quit) PARAMS ((host_callback *));
/* Used when the target has gone away, so we can close open
handles and free memory etc etc. */
@@ -60,8 +107,7 @@ struct host_callback_struct
/* depreciated, use vprintf_filtered - Talk to the user on a console. */
void (*printf_filtered) PARAMS ((host_callback *, const char *, ...));
- /* Talk to the user on a console.
- The `void *' is actually `va_list *'. */
+ /* Talk to the user on a console. */
void (*vprintf_filtered) PARAMS ((host_callback *, const char *, va_list));
/* Same as vprintf_filtered but to stderr. */
@@ -77,23 +123,148 @@ struct host_callback_struct
int fdmap[MAX_CALLBACK_FDS];
char fdopen[MAX_CALLBACK_FDS];
char alwaysopen[MAX_CALLBACK_FDS];
+
+ /* System call numbers. */
+ CB_TARGET_DEFS_MAP *syscall_map;
+ /* Errno values. */
+ CB_TARGET_DEFS_MAP *errno_map;
+ /* Flags to the open system call. */
+ CB_TARGET_DEFS_MAP *open_map;
+ /* Signal numbers. */
+ CB_TARGET_DEFS_MAP *signal_map;
+ /* Layout of `stat' struct.
+ The format is a series of "name,length" pairs separated by colons.
+ Empty space is indicated with a `name' of "space".
+ All padding must be explicitly mentioned.
+ Lengths are in bytes. If this needs to be extended to bits,
+ use "name.bits".
+ Example: "st_dev,4:st_ino,4:st_mode,4:..." */
+ const char *stat_map;
+
+ /* Marker for those wanting to do sanity checks.
+ This should remain the last member of this struct to help catch
+ miscompilation errors. */
+#define HOST_CALLBACK_MAGIC 4705 /* teds constant */
+ int magic;
};
extern host_callback default_callback;
+
+/* Canonical versions of system call numbers.
+ It's not intended to willy-nilly throw every system call ever heard
+ of in here. Only include those that have an important use.
+ ??? One can certainly start a discussion over the ones that are currently
+ here, but that will always be true. */
-/* Mapping of host/target values. */
-/* ??? For debugging purposes, one might want to add a string of the
- name of the symbol. */
+/* These are used by the ANSI C support of libc. */
+#define CB_SYS_exit 1
+#define CB_SYS_open 2
+#define CB_SYS_close 3
+#define CB_SYS_read 4
+#define CB_SYS_write 5
+#define CB_SYS_lseek 6
+#define CB_SYS_unlink 7
+#define CB_SYS_getpid 8
+#define CB_SYS_kill 9
+#define CB_SYS_fstat 10
+/*#define CB_SYS_sbrk 11 - not currently a system call, but reserved. */
-typedef struct {
- int host_val;
- int target_val;
-} target_defs_map;
+/* ARGV support. */
+#define CB_SYS_argvlen 12
+#define CB_SYS_argv 13
+
+/* These are extras added for one reason or another. */
+#define CB_SYS_chdir 14
+#define CB_SYS_stat 15
+#define CB_SYS_chmod 16
+#define CB_SYS_utime 17
+#define CB_SYS_time 18
+
+/* Struct use to pass and return information necessary to perform a
+ system call. */
+/* FIXME: Need to consider target word size. */
+
+typedef struct cb_syscall {
+ /* The target's value of what system call to perform. */
+ int func;
+ /* The arguments to the syscall. */
+ long arg1, arg2, arg3, arg4;
+
+ /* The result. */
+ long result;
+ /* Some system calls have two results. */
+ long result2;
+ /* The target's errno value, or 0 if success.
+ This is converted to the target's value with host_to_target_errno. */
+ int errcode;
+
+ /* Working space to be used by memory read/write callbacks. */
+ PTR p1;
+ PTR p2;
+ long x1,x2;
+
+ /* Callbacks for reading/writing memory (e.g. for read/write syscalls).
+ ??? long or unsigned long might be better to use for the `count'
+ argument here. We mimic sim_{read,write} for now. Be careful to
+ test any changes with -Wall -Werror, mixed signed comparisons
+ will get you. */
+ int (*read_mem) PARAMS ((host_callback * /*cb*/, struct cb_syscall * /*sc*/,
+ unsigned long /*taddr*/, char * /*buf*/,
+ int /*bytes*/));
+ int (*write_mem) PARAMS ((host_callback * /*cb*/, struct cb_syscall * /*sc*/,
+ unsigned long /*taddr*/, const char * /*buf*/,
+ int /*bytes*/));
+
+ /* For sanity checking, should be last entry. */
+ int magic;
+} CB_SYSCALL;
+
+/* Magic number sanity checker. */
+#define CB_SYSCALL_MAGIC 0x12344321
+
+/* Macro to initialize CB_SYSCALL. Called first, before filling in
+ any fields. */
+#define CB_SYSCALL_INIT(sc) \
+do { \
+ memset ((sc), 0, sizeof (*(sc))); \
+ (sc)->magic = CB_SYSCALL_MAGIC; \
+} while (0)
+
+/* Return codes for various interface routines. */
+
+typedef enum {
+ CB_RC_OK = 0,
+ /* generic error */
+ CB_RC_ERR,
+ /* either file not found or no read access */
+ CB_RC_ACCESS,
+ CB_RC_NO_MEM
+} CB_RC;
+
+/* Read in target values for system call numbers, errno values, signals. */
+CB_RC cb_read_target_syscall_maps PARAMS ((host_callback *, const char *));
+
+/* Translate target to host syscall function numbers. */
+int cb_target_to_host_syscall PARAMS ((host_callback *, int));
+
+/* Translate host to target errno value. */
+int cb_host_to_target_errno PARAMS ((host_callback *, int));
+
+/* Translate target to host open flags. */
+int cb_target_to_host_open PARAMS ((host_callback *, int));
+
+/* Translate target signal number to host. */
+int cb_target_to_host_signal PARAMS ((host_callback *, int));
+
+/* Translate host signal number to target. */
+int cb_host_to_target_signal PARAMS ((host_callback *, int));
-extern target_defs_map errno_map[];
-extern target_defs_map open_map[];
+/* Translate host stat struct to target.
+ If stat struct ptr is NULL, just compute target stat struct size.
+ Result is size of target stat struct or 0 if error. */
+int cb_host_to_target_stat PARAMS ((host_callback *, const struct stat *, PTR));
-extern int host_to_target_errno PARAMS ((int));
-extern int target_to_host_open PARAMS ((int));
+/* Perform a system call. */
+CB_RC cb_syscall PARAMS ((host_callback *, CB_SYSCALL *));
#endif
diff --git a/contrib/binutils/include/coff/ChangeLog b/contrib/binutils/include/coff/ChangeLog
index 07b8217..21ef0bc 100644
--- a/contrib/binutils/include/coff/ChangeLog
+++ b/contrib/binutils/include/coff/ChangeLog
@@ -1,3 +1,31 @@
+Fri Mar 27 17:16:57 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * internal.h (ISPTR, ISFCN, ISARY): Add casts to unsigned long.
+
+Mon Feb 2 17:10:38 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
+
+ * tic30.h: New file.
+
+Tue Dec 2 10:21:40 1997 Nick Clifton <nickc@cygnus.com>
+
+ * arm.h (COFFARM): New define.
+
+Sat Nov 22 15:10:14 1997 Nick Clifton <nickc@cygnus.com>
+
+ * internal.h (C_THUMBEXTFUNC, C_THUMBSTATFUNC): Constants to
+ define static and external functions.
+
+ * arm.h: Add bits to support PIC and APCS-FLOAT type binaries,
+ when implemented.
+
+Tue Jul 22 18:18:58 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * go32exe.h: New file.
+
+Tue Jun 3 16:44:18 1997 Nick Clifton <nickc@cygnus.com>
+
+ * internal.h: Add storage classes for Thumb symbols
+
Fri Apr 18 11:52:55 1997 Niklas Hallqvist <niklas@appli.se>
* alpha.h (ALPHA_ECOFF_BADMAG): Recognize *BSD/alpha magic too.
diff --git a/contrib/binutils/include/coff/internal.h b/contrib/binutils/include/coff/internal.h
index d37f7ca..d873f28 100644
--- a/contrib/binutils/include/coff/internal.h
+++ b/contrib/binutils/include/coff/internal.h
@@ -215,6 +215,7 @@ struct internal_aouthdr
#define C_ALIAS 105 /* duplicate tag */
#define C_HIDDEN 106 /* ext symbol in dmert public lib */
+
/* New storage classes for WINDOWS_NT */
#define C_SECTION 104 /* section name */
#define C_NT_WEAK 105 /* weak external */
@@ -258,6 +259,13 @@ struct internal_aouthdr
#define C_BSTAT (0x8f)
#define C_ESTAT (0x90)
+/* Storage classes for Thumb symbols */
+#define C_THUMBEXT (128 + C_EXT)
+#define C_THUMBSTAT (128 + C_STAT)
+#define C_THUMBLABEL (128 + C_LABEL)
+#define C_THUMBEXTFUNC (C_THUMBEXT + 20)
+#define C_THUMBSTATFUNC (C_THUMBSTAT + 20)
+
/********************** SECTION HEADER **********************/
#define SCNNMLEN (8)
@@ -402,12 +410,16 @@ struct internal_syment
#define BTYPE(x) ((x) & N_BTMASK)
-#define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
-#define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
-#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
-#define ISTAG(x) ((x)==C_STRTAG||(x)==C_UNTAG||(x)==C_ENTAG)
-#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
-
+#define ISPTR(x) \
+ (((unsigned long) (x) & N_TMASK) == ((unsigned long) DT_PTR << N_BTSHFT))
+#define ISFCN(x) \
+ (((unsigned long) (x) & N_TMASK) == ((unsigned long) DT_FCN << N_BTSHFT))
+#define ISARY(x) \
+ (((unsigned long) (x) & N_TMASK) == ((unsigned long) DT_ARY << N_BTSHFT))
+#define ISTAG(x) \
+ ((x) == C_STRTAG || (x) == C_UNTAG || (x) == C_ENTAG)
+#define DECREF(x) \
+ ((((x) >> N_TSHIFT) & ~ N_BTMASK) | ((x) & N_BTMASK))
union internal_auxent
{
diff --git a/contrib/binutils/include/coff/sh.h b/contrib/binutils/include/coff/sh.h
index 65ed478..41957df 100644
--- a/contrib/binutils/include/coff/sh.h
+++ b/contrib/binutils/include/coff/sh.h
@@ -227,6 +227,7 @@ struct external_reloc {
.word L1 - L2
The r_offset field holds the difference between the reloc address
and L2. */
+#define R_SH_SWITCH8 33 /* 8 bit switch table entry */
#define R_SH_SWITCH16 25 /* 16 bit switch table entry */
#define R_SH_SWITCH32 26 /* 32 bit switch table entry */
@@ -264,3 +265,5 @@ struct external_reloc {
label within a block of instructions. This permits the linker to
avoid swapping instructions which are the targets of branches. */
#define R_SH_LABEL 32 /* label */
+
+/* NB: R_SH_SWITCH8 is 33 */
diff --git a/contrib/binutils/include/coff/tic30.h b/contrib/binutils/include/coff/tic30.h
new file mode 100644
index 0000000..10b026c
--- /dev/null
+++ b/contrib/binutils/include/coff/tic30.h
@@ -0,0 +1,203 @@
+/*** coff information for Texas Instruments TMS320C3X */
+
+/********************** FILE HEADER **********************/
+
+struct external_filehdr {
+ char f_magic[2]; /* magic number */
+ char f_nscns[2]; /* number of sections */
+ char f_timdat[4]; /* time & date stamp */
+ char f_symptr[4]; /* file pointer to symtab */
+ char f_nsyms[4]; /* number of symtab entries */
+ char f_opthdr[2]; /* sizeof(optional hdr) */
+ char f_flags[2]; /* flags */
+};
+
+
+#define TIC30MAGIC 0xC000
+
+#define TIC30BADMAG(x) (((x).f_magic!=TIC30MAGIC))
+
+#define FILHDR struct external_filehdr
+#define FILHSZ 20
+
+
+/********************** AOUT "OPTIONAL HEADER" **********************/
+
+
+typedef struct
+{
+ char magic[2]; /* type of file */
+ char vstamp[2]; /* version stamp */
+ char tsize[4]; /* text size in bytes, padded to FW bdry*/
+ char dsize[4]; /* initialized data " " */
+ char bsize[4]; /* uninitialized data " " */
+ char entry[4]; /* entry pt. */
+ char text_start[4]; /* base of text used for this file */
+ char data_start[4]; /* base of data used for this file */
+}
+AOUTHDR;
+
+
+#define AOUTHDRSZ 28
+#define AOUTSZ 28
+
+
+
+
+/********************** SECTION HEADER **********************/
+
+
+struct external_scnhdr {
+ char s_name[8]; /* section name */
+ char s_paddr[4]; /* physical address, aliased s_nlib */
+ char s_vaddr[4]; /* virtual address */
+ char s_size[4]; /* section size */
+ char s_scnptr[4]; /* file ptr to raw data for section */
+ char s_relptr[4]; /* file ptr to relocation */
+ char s_lnnoptr[4]; /* file ptr to line numbers */
+ char s_nreloc[2]; /* number of relocation entries */
+ char s_nlnno[2]; /* number of line number entries*/
+ char s_flags[4]; /* flags */
+};
+
+/*
+ * names of "special" sections
+ */
+#define _TEXT ".text"
+#define _DATA ".data"
+#define _BSS ".bss"
+
+
+#define SCNHDR struct external_scnhdr
+#define SCNHSZ 40
+
+
+/********************** LINE NUMBERS **********************/
+
+/* 1 line number entry for every "breakpointable" source line in a section.
+ * Line numbers are grouped on a per function basis; first entry in a function
+ * grouping will have l_lnno = 0 and in place of physical address will be the
+ * symbol table index of the function name.
+ */
+struct external_lineno {
+ union {
+ char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
+ char l_paddr[4]; /* (physical) address of line number */
+ } l_addr;
+ char l_lnno[4]; /* line number */
+};
+
+#define GET_LINENO_LNNO(abfd, ext) bfd_h_get_32(abfd, (bfd_byte *) (ext->l_lnno));
+#define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_32(abfd,val, (bfd_byte *) (ext->l_lnno));
+
+#define LINENO struct external_lineno
+#define LINESZ 8
+
+
+/********************** SYMBOLS **********************/
+
+#define E_SYMNMLEN 8 /* # characters in a symbol name */
+#define E_FILNMLEN 14 /* # characters in a file name */
+#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
+
+struct external_syment
+{
+ union {
+ char e_name[E_SYMNMLEN];
+ struct {
+ char e_zeroes[4];
+ char e_offset[4];
+ } e;
+ } e;
+ char e_value[4];
+ char e_scnum[2];
+ char e_type[2];
+ char e_sclass[1];
+ char e_numaux[1];
+};
+
+
+
+#define N_BTMASK (017)
+#define N_TMASK (060)
+#define N_BTSHFT (4)
+#define N_TSHIFT (2)
+
+
+union external_auxent {
+ struct {
+ char x_tagndx[4]; /* str, un, or enum tag indx */
+ union {
+ struct {
+ char x_lnno[2]; /* declaration line number */
+ char x_size[2]; /* str/union/array size */
+ } x_lnsz;
+ char x_fsize[4]; /* size of function */
+ } x_misc;
+ union {
+ struct { /* if ISFCN, tag, or .bb */
+ char x_lnnoptr[4]; /* ptr to fcn line # */
+ char x_endndx[4]; /* entry ndx past block end */
+ } x_fcn;
+ struct { /* if ISARY, up to 4 dimen. */
+ char x_dimen[E_DIMNUM][2];
+ } x_ary;
+ } x_fcnary;
+ char x_tvndx[2]; /* tv index */
+ } x_sym;
+
+ union {
+ char x_fname[E_FILNMLEN];
+ struct {
+ char x_zeroes[4];
+ char x_offset[4];
+ } x_n;
+ } x_file;
+
+ struct {
+ char x_scnlen[4]; /* section length */
+ char x_nreloc[2]; /* # relocation entries */
+ char x_nlinno[2]; /* # line numbers */
+ } x_scn;
+
+ struct {
+ char x_tvfill[4]; /* tv fill value */
+ char x_tvlen[2]; /* length of .tv */
+ char x_tvran[2][2]; /* tv range */
+ } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
+
+
+};
+
+#define SYMENT struct external_syment
+#define SYMESZ 18
+#define AUXENT union external_auxent
+#define AUXESZ 18
+
+
+
+/********************** RELOCATION DIRECTIVES **********************/
+
+/* The external reloc has an offset field, because some of the reloc
+ types on the z8k don't have room in the instruction for the entire
+ offset - eg with segments */
+
+struct external_reloc {
+ char r_vaddr[4];
+ char r_symndx[4];
+ char r_offset[4];
+ char r_type[2];
+ char r_stuff[2];
+};
+
+
+#define RELOC struct external_reloc
+#define RELSZ 16
+
+/* TMS320C30 relocation types. */
+
+#define R_TIC30_ABS16 0x100 /* 16 bit absolute. */
+#define R_TIC30_ABS24 0x101 /* 24 bit absolute. */
+#define R_TIC30_ABS32 0x102 /* 32 bit absolute. */
+#define R_TIC30_LDP 0x103 /* LDP bits 23-16 to 7-0. */
+#define R_TIC30_PC16 0x104 /* 16 bit pc relative. */
diff --git a/contrib/binutils/include/demangle.h b/contrib/binutils/include/demangle.h
index b0254af..00f6a0c 100644
--- a/contrib/binutils/include/demangle.h
+++ b/contrib/binutils/include/demangle.h
@@ -32,6 +32,7 @@
#define DMGL_NO_OPTS 0 /* For readability... */
#define DMGL_PARAMS (1 << 0) /* Include function args */
#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
+#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
#define DMGL_AUTO (1 << 8)
#define DMGL_GNU (1 << 9)
diff --git a/contrib/binutils/include/dis-asm.h b/contrib/binutils/include/dis-asm.h
index 80739ac..bd7e478 100644
--- a/contrib/binutils/include/dis-asm.h
+++ b/contrib/binutils/include/dis-asm.h
@@ -51,14 +51,21 @@ typedef struct disassemble_info {
unsigned long mach;
/* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */
enum bfd_endian endian;
- /* The symbol at the start of the function being disassembled. This
- is not set reliably, but if it is not NULL, it is correct. */
- asymbol *symbol;
+
+ /* An array of pointers to symbols either at the location being disassembled
+ or at the start of the function being disassembled. The array is sorted
+ so that the first symbol is intended to be the one used. The others are
+ present for any misc. purposes. This is not set reliably, but if it is
+ not NULL, it is correct. */
+ asymbol **symbols;
+ /* Number of symbols in array. */
+ int num_symbols;
/* For use by the disassembler.
The top 16 bits are reserved for public use (and are documented here).
The bottom 16 bits are for the internal use of the disassembler. */
unsigned long flags;
+#define INSN_HAS_RELOC 0x80000000
PTR private_data;
/* Function used to get bytes to disassemble. MEMADDR is the
@@ -81,6 +88,16 @@ typedef struct disassemble_info {
void (*print_address_func)
PARAMS ((bfd_vma addr, struct disassemble_info *info));
+ /* Function called to determine if there is a symbol at the given ADDR.
+ If there is, the function returns 1, otherwise it returns 0.
+ This is used by ports which support an overlay manager where
+ the overlay number is held in the top part of an address. In
+ some circumstances we want to include the overlay number in the
+ address, (normally because there is a symbol associated with
+ that address), but sometimes we want to mask out the overlay bits. */
+ int (* symbol_at_address_func)
+ PARAMS ((bfd_vma addr, struct disassemble_info * info));
+
/* These are for buffer_read_memory. */
bfd_byte *buffer;
bfd_vma buffer_vma;
@@ -135,6 +152,7 @@ extern int print_insn_h8300h PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_h8300s PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_h8500 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_alpha PARAMS ((bfd_vma, disassemble_info*));
+extern disassembler_ftype arc_get_disassembler PARAMS ((int, int));
extern int print_insn_big_arm PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_little_arm PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_sparc PARAMS ((bfd_vma, disassemble_info*));
@@ -154,6 +172,8 @@ extern int print_insn_little_powerpc PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_rs6000 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_w65 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_d10v PARAMS ((bfd_vma, disassemble_info*));
+extern int print_insn_v850 PARAMS ((bfd_vma, disassemble_info*));
+extern int print_insn_tic30 PARAMS ((bfd_vma, disassemble_info*));
/* Fetch the disassembler for a given BFD, if that support is available. */
extern disassembler_ftype disassembler PARAMS ((bfd *));
@@ -178,6 +198,10 @@ extern void perror_memory PARAMS ((int, bfd_vma, struct disassemble_info *));
extern void generic_print_address
PARAMS ((bfd_vma, struct disassemble_info *));
+/* Always true. */
+extern int generic_symbol_at_address
+ PARAMS ((bfd_vma, struct disassemble_info *));
+
/* Macro to initialize a disassemble_info struct. This should be called
by all applications creating such a struct. */
#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
@@ -195,13 +219,15 @@ extern void generic_print_address
#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
(INFO).fprintf_func = (FPRINTF_FUNC), \
(INFO).stream = (STREAM), \
- (INFO).symbol = NULL, \
+ (INFO).symbols = NULL, \
+ (INFO).num_symbols = 0, \
(INFO).buffer = NULL, \
(INFO).buffer_vma = 0, \
(INFO).buffer_length = 0, \
(INFO).read_memory_func = buffer_read_memory, \
(INFO).memory_error_func = perror_memory, \
(INFO).print_address_func = generic_print_address, \
+ (INFO).symbol_at_address_func = generic_symbol_at_address, \
(INFO).flags = 0, \
(INFO).bytes_per_line = 0, \
(INFO).bytes_per_chunk = 0, \
diff --git a/contrib/binutils/include/elf/ChangeLog b/contrib/binutils/include/elf/ChangeLog
index ac5e824..aed10aa 100644
--- a/contrib/binutils/include/elf/ChangeLog
+++ b/contrib/binutils/include/elf/ChangeLog
@@ -1,3 +1,78 @@
+Sat Feb 28 17:04:41 1998 Richard Henderson <rth@cygnus.com>
+
+ * alpha.h (EF_ALPHA_32BIT, EF_ALPHA_CANRELAX): New.
+
+Mon Dec 15 15:07:49 1997 Nick Clifton <nickc@cygnus.com>
+
+ * m32r.h (EF_M32R_ARCH, E_M32R_ARCH): New flags to
+ specify machine architecture.
+
+Fri Dec 5 11:20:08 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850.h: New constants: SHN_V850_SCOMMON, SHN_V850_TCOMMON,
+ SHN_V850_ZCOMMON, SHT_V850_SCOMMON, SHT_V850_TCOMMON,
+ SHT_V850_ZCOMMON to handle v850 common sections.
+ enum reloc_type renamed to v850_reloc_type to avoid name
+ conflict.
+
+Thu Oct 23 13:55:24 1997 Richard Henderson <rth@cygnus.com>
+
+ * sparc.h (enum elf_sparc_reloc_type): Add UA64 & UA16.
+
+Thu Oct 23 00:42:04 1997 Richard Henderson <rth@dot.cygnus.com>
+
+ * sparc.h (DT_SPARC_REGISTER): New macro.
+ (DT_SPARC_PLTFMT): In support of old sparc64-linux .plts; will
+ go away soon.
+
+Tue Sep 30 13:26:58 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * sparc.h (EF_SPARC_HAL_R1, EF_SPARC_EXT_MASK): New macros.
+ (EF_SPARCV9_{MM,TSO,PSO,RMO}): New macros.
+ (SHN_BEFORE,SHN_AFTER): New macros.
+ (SHF_EXCLUDE,SHF_ORDERED): New macros.
+ (STT_REGISTER): New macro.
+ (R_SPARC_GLOB_JMP): Deleted, but slot reserved.
+ (R_SPARC_{DISP64,PLT64,HIX22,LOX10}): New relocations.
+ (R_SPARC_{H44,M44,L44,REGISTER}): New relocations.
+ (ELF64_R_TYPE_{DATA,ID,INFO}): New macros.
+
+Tue Sep 16 14:16:17 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850.h (reloc_type): Add R_V850_TDA_16_16_OFFSET.
+
+Wed Sep 3 15:11:14 1997 Richard Henderson <rth@cygnus.com>
+
+ * mips.h: Correct typo in comment.
+
+Wed Sep 3 11:25:57 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850.h (reloc_type): Remove R_V850_16_PCREL.
+
+Tue Sep 2 17:41:05 1997 Nick Clifton <nickc@cygnus.com>
+
+
+ * v850.h: Add new flags for e_flags field in elf header.
+
+
+Mon Aug 18 11:05:23 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850.h (reloc_type): Add 16 bit PC relative relocation.
+
+Fri Aug 15 05:10:09 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * arc.h (enum reloc): Move here from elf32-arc.c.
+
+Fri Aug 8 17:05:29 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * arc.h: New file.
+ * common.h (EM_CYGNUS_ARC): Define.
+
+Mon Jun 16 14:46:12 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * internal.h (Elf_Internal_Ehdr): Change e_phoff and e_shoff from
+ bfd_signed_vma to bfd_size_type, as they are not signed.
+
Wed Mar 5 15:35:26 1997 Doug Evans <dje@seba.cygnus.com>
* m32r.h (SHF_M32R_CAN_RELAX): Define.
@@ -24,6 +99,19 @@ Mon Jan 27 11:54:44 1997 Doug Evans <dje@seba.cygnus.com>
* m32r.h (enum reloc_type): Add R_M32R_HI16_[SU]LO,R_M32R_LO16.
+Fri Jan 3 11:32:51 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * v850.h (V850_OTHER_{TDA_BYTE,ERROR}): New bits for the st_other
+ field.
+ (SHN_V850_*): Remove v850 specific section indexes, which are not
+ needed.
+ (enum reloc_type): Move the v850 relocations here from
+ elf32-v850.c
+
+Thu Jan 2 19:30:23 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * v850.h: New file, provide V850 specific definitions.
+
Tue Dec 31 14:44:32 1996 Ian Lance Taylor <ian@cygnus.com>
* common.h (DT_AUXILIARY): Define.
@@ -61,6 +149,10 @@ Fri Aug 30 17:06:21 1996 Ian Lance Taylor <ian@cygnus.com>
* common.h (EM_SH): Define.
+Tue Aug 20 14:47:54 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * common.h (EM_CYGNUS_V850): Define.
+
Mon Aug 19 10:59:10 1996 Doug Evans <dje@canuck.cygnus.com>
* common.h (EM_CYGNUS_M32R): Define.
@@ -165,7 +257,6 @@ Tue Feb 14 13:59:13 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* common.h (EM_PPC): Use offical value of 20, not 17.
(EM_PPC_OLD): Define this to be the old value of EM_PPC.
-
Tue Jan 24 09:40:59 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* common.h (EM_PPC): New macro, PowerPC machine id.
@@ -174,7 +265,6 @@ Tue Jan 17 10:51:38 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
* mips.h (SHT_MIPS_MSYM, SHT_MIPS_DWARF, SHT_MIPS_EVENTS): Define.
-
Mon Oct 17 13:43:59 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
* internal.h (Elf_Internal_Shdr): Remove rawdata and size fields.
diff --git a/contrib/binutils/include/elf/alpha.h b/contrib/binutils/include/elf/alpha.h
index 8e12dd9..28b9fe3 100644
--- a/contrib/binutils/include/elf/alpha.h
+++ b/contrib/binutils/include/elf/alpha.h
@@ -26,6 +26,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _ELF_ALPHA_H
#define _ELF_ALPHA_H
+/* Processor specific flags for the ELF header e_flags field. */
+
+/* All addresses must be below 2GB. */
+#define EF_ALPHA_32BIT 0x00000001
+
+/* All relocations needed for relaxation with code movement are present. */
+#define EF_ALPHA_CANRELAX 0x00000002
+
/* Processor specific section flags. */
/* This section must be in the global data area. */
diff --git a/contrib/binutils/include/elf/arc.h b/contrib/binutils/include/elf/arc.h
new file mode 100644
index 0000000..25ba97a
--- /dev/null
+++ b/contrib/binutils/include/elf/arc.h
@@ -0,0 +1,52 @@
+/* ARC ELF support for BFD.
+ Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ Contributed by Doug Evans, (dje@cygnus.com)
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This file holds definitions specific to the ARC ELF ABI. */
+
+#ifndef _ELF_ARC_H
+#define _ELF_ARC_H
+
+enum reloc_type
+{
+ R_ARC_NONE = 0,
+ R_ARC_32,
+ R_ARC_B26,
+ R_ARC_B22_PCREL,
+ R_ARC_max
+};
+
+/* Processor specific flags for the ELF header e_flags field. */
+
+/* Four bit ARC machine type field. */
+#define EF_ARC_MACH 0x0000000f
+
+/* Various CPU types. */
+#define E_ARC_MACH_BASE 0x00000000
+#define E_ARC_MACH_UNUSED1 0x00000001
+#define E_ARC_MACH_UNUSED2 0x00000002
+#define E_ARC_MACH_UNUSED4 0x00000003
+
+/* Leave bits 0xf0 alone in case we ever have more than 16 cpu types.
+ Highly unlikely, but what the heck. */
+
+/* File contains position independent code. */
+#define EF_ARC_PIC 0x00000100
+
+#endif /* _ELF_ARC_H */
diff --git a/contrib/binutils/include/elf/common.h b/contrib/binutils/include/elf/common.h
index d555c59..dd0d4d5 100644
--- a/contrib/binutils/include/elf/common.h
+++ b/contrib/binutils/include/elf/common.h
@@ -106,6 +106,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Old version of PowerPC, this should be removed shortly. */
#define EM_PPC_OLD 17
+/* Cygnus ARC ELF backend. Written in the absence of an ABI. */
+#define EM_CYGNUS_ARC 0x9040
/* Cygnus M32R ELF backend. Written in the absence of an ABI. */
#define EM_CYGNUS_M32R 0x9041
@@ -117,6 +119,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define EM_CYGNUS_D10V 0x7650
+/* V850 backend magic number. Written in the absense of an ABI. */
+#define EM_CYGNUS_V850 0x9080
/* mn10200 and mn10300 backend magic numbers.
Written in the absense of an ABI. */
diff --git a/contrib/binutils/include/elf/internal.h b/contrib/binutils/include/elf/internal.h
index bb849d6..6540310 100644
--- a/contrib/binutils/include/elf/internal.h
+++ b/contrib/binutils/include/elf/internal.h
@@ -43,8 +43,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
typedef struct elf_internal_ehdr {
unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */
bfd_vma e_entry; /* Entry point virtual address */
- bfd_signed_vma e_phoff; /* Program header table file offset */
- bfd_signed_vma e_shoff; /* Section header table file offset */
+ bfd_size_type e_phoff; /* Program header table file offset */
+ bfd_size_type e_shoff; /* Section header table file offset */
unsigned long e_version; /* Identifies object file version */
unsigned long e_flags; /* Processor-specific flags */
unsigned short e_type; /* Identifies object file type */
diff --git a/contrib/binutils/include/elf/v850.h b/contrib/binutils/include/elf/v850.h
new file mode 100644
index 0000000..cc815c5
--- /dev/null
+++ b/contrib/binutils/include/elf/v850.h
@@ -0,0 +1,94 @@
+/* V850 ELF support for BFD.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ Created by Michael Meissner, Cygnus Support <meissner@cygnus.com>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This file holds definitions specific to the MIPS ELF ABI. Note
+ that most of this is not actually implemented by BFD. */
+
+#ifndef _ELF_V850_H
+#define _ELF_V850_H
+
+/* Processor specific flags for the ELF header e_flags field. */
+
+/* Four bit V850 architecture field. */
+#define EF_V850_ARCH 0xf0000000
+
+/* v850 code. */
+#define E_V850_ARCH 0x00000000
+
+
+
+/* Flags for the st_other field */
+#define V850_OTHER_SDA 0x01 /* symbol had SDA relocations */
+#define V850_OTHER_ZDA 0x02 /* symbol had ZDA relocations */
+#define V850_OTHER_TDA 0x04 /* symbol had TDA relocations */
+#define V850_OTHER_TDA_BYTE 0x08 /* symbol had TDA byte relocations */
+#define V850_OTHER_ERROR 0x80 /* symbol had an error reported */
+
+/* V850 relocations */
+enum v850_reloc_type
+{
+ R_V850_NONE = 0,
+ R_V850_9_PCREL,
+ R_V850_22_PCREL,
+ R_V850_HI16_S,
+ R_V850_HI16,
+ R_V850_LO16,
+ R_V850_32,
+ R_V850_16,
+ R_V850_8,
+ R_V850_SDA_16_16_OFFSET, /* For ld.b, st.b, set1, clr1, not1, tst1, movea, movhi */
+ R_V850_SDA_15_16_OFFSET, /* For ld.w, ld.h, ld.hu, st.w, st.h */
+ R_V850_ZDA_16_16_OFFSET, /* For ld.b, st.b, set1, clr1, not1, tst1, movea, movhi */
+ R_V850_ZDA_15_16_OFFSET, /* For ld.w, ld.h, ld.hu, st.w, st.h */
+ R_V850_TDA_6_8_OFFSET, /* For sst.w, sld.w */
+ R_V850_TDA_7_8_OFFSET, /* For sst.h, sld.h */
+ R_V850_TDA_7_7_OFFSET, /* For sst.b, sld.b */
+ R_V850_TDA_16_16_OFFSET, /* For set1, clr1, not1, tst1, movea, movhi */
+ R_V850_max
+};
+
+
+/* Processor specific section indices. These sections do not actually
+ exist. Symbols with a st_shndx field corresponding to one of these
+ values have a special meaning. */
+
+/* Small data area common symbol. */
+#define SHN_V850_SCOMMON 0xff00
+
+/* Tiny data area common symbol. */
+#define SHN_V850_TCOMMON 0xff01
+
+/* Zero data area common symbol. */
+#define SHN_V850_ZCOMMON 0xff02
+
+
+/* Processor specific section types. */
+
+/* Section contains the .scommon data. */
+#define SHT_V850_SCOMMON 0x70000000
+
+/* Section contains the .scommon data. */
+#define SHT_V850_TCOMMON 0x70000001
+
+/* Section contains the .scommon data. */
+#define SHT_V850_ZCOMMON 0x70000002
+
+
+#endif /* _ELF_V850_H */
diff --git a/contrib/binutils/include/floatformat.h b/contrib/binutils/include/floatformat.h
index 01e3dcb..90daca2 100644
--- a/contrib/binutils/include/floatformat.h
+++ b/contrib/binutils/include/floatformat.h
@@ -28,7 +28,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
(i.e. BITS_BIG_ENDIAN type numbering), and specify which bits each field
contains with the *_start and *_len fields. */
-enum floatformat_byteorders { floatformat_little, floatformat_big };
+/* What is the order of the bytes. */
+
+enum floatformat_byteorders {
+
+ /* Standard little endian byte order.
+ EX: 1.2345678e10 => 00 00 80 c5 e0 fe 06 42 */
+
+ floatformat_little,
+
+ /* Standard big endian byte order.
+ EX: 1.2345678e10 => 42 06 fe e0 c5 80 00 00 */
+
+ floatformat_big,
+
+ /* Little endian byte order but big endian word order.
+ EX: 1.2345678e10 => e0 fe 06 42 00 00 80 c5 */
+
+ floatformat_littlebyte_bigword
+
+};
enum floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no };
@@ -63,6 +82,10 @@ extern const struct floatformat floatformat_ieee_single_little;
extern const struct floatformat floatformat_ieee_double_big;
extern const struct floatformat floatformat_ieee_double_little;
+/* floatformat for ARM IEEE double, little endian bytes and big endian words */
+
+extern const struct floatformat floatformat_ieee_double_littlebyte_bigword;
+
/* floatformats for various extendeds. */
extern const struct floatformat floatformat_i387_ext;
diff --git a/contrib/binutils/include/getopt.h b/contrib/binutils/include/getopt.h
index abf9153..c4adc30 100644
--- a/contrib/binutils/include/getopt.h
+++ b/contrib/binutils/include/getopt.h
@@ -1,19 +1,23 @@
/* Declarations for getopt.
- Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License
- as published by the Free Software Foundation; either version 2, or
- (at your option) any later version.
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Library General Public License for more details.
+ GNU General Public License for more details.
- You should have received a copy of the GNU Library General Public License
+ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifndef _GETOPT_H
#define _GETOPT_H 1
@@ -36,7 +40,7 @@ extern char *optarg;
On entry to `getopt', zero means this is the first call; initialize.
- When `getopt' returns EOF, this is the index of the first of the
+ When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
@@ -76,7 +80,7 @@ extern int optopt;
struct option
{
-#if __STDC__
+#if defined (__STDC__) && __STDC__
const char *name;
#else
char *name;
@@ -94,15 +98,15 @@ struct option
#define required_argument 1
#define optional_argument 2
-#if __STDC__
-#if defined(__GNU_LIBRARY__)
+#if defined (__STDC__) && __STDC__
+#ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
extern int getopt ();
-#endif /* not __GNU_LIBRARY__ */
+#endif /* __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
@@ -120,10 +124,10 @@ extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
-#endif /* not __STDC__ */
+#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
-#endif /* _GETOPT_H */
+#endif /* getopt.h */
diff --git a/contrib/binutils/include/libiberty.h b/contrib/binutils/include/libiberty.h
index d15a98d..951e156 100644
--- a/contrib/binutils/include/libiberty.h
+++ b/contrib/binutils/include/libiberty.h
@@ -10,6 +10,10 @@
#ifndef LIBIBERTY_H
#define LIBIBERTY_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "ansidecl.h"
/* Build an argument vector from a string. Allocates memory using
@@ -21,6 +25,12 @@ extern char **buildargv PARAMS ((char *));
extern void freeargv PARAMS ((char **));
+/* Duplicate an argument vector. Allocates memory using malloc. Use
+ freeargv to free the vector. */
+
+extern char **dupargv PARAMS ((char **));
+
+
/* Return the last component of a path name. Note that we can't use a
prototype here because the parameter is declared inconsistently
across different systems, sometimes as "char *" and sometimes as
@@ -141,4 +151,26 @@ extern void hex_init PARAMS ((void));
the argument being performed exactly once. */
#define hex_value(c) (_hex_value[(unsigned char) (c)])
+/* Definitions used by the pexecute routine. */
+
+#define PEXECUTE_FIRST 1
+#define PEXECUTE_LAST 2
+#define PEXECUTE_ONE (PEXECUTE_FIRST + PEXECUTE_LAST)
+#define PEXECUTE_SEARCH 4
+#define PEXECUTE_VERBOSE 8
+
+/* Execute a program. */
+
+extern int pexecute PARAMS ((const char *, char * const *, const char *,
+ const char *, char **, char **, int));
+
+/* Wait for pexecute to finish. */
+
+extern int pwait PARAMS ((int, int *, int));
+
+#ifdef __cplusplus
+}
+#endif
+
+
#endif /* ! defined (LIBIBERTY_H) */
diff --git a/contrib/binutils/include/obstack.h b/contrib/binutils/include/obstack.h
index 807259c..ffc6b9e 100644
--- a/contrib/binutils/include/obstack.h
+++ b/contrib/binutils/include/obstack.h
@@ -279,13 +279,14 @@ int obstack_memory_used (struct obstack *obstack);
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
_obstack_begin_1 ((h), (size), (alignment), \
- (void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun), (arg))
+ (void *(*) (void *, long)) (chunkfun), \
+ (void (*) (void *, void *)) (freefun), (arg))
#define obstack_chunkfun(h, newchunkfun) \
- ((h) -> chunkfun = (struct _obstack_chunk *(*)(long)) (newchunkfun))
+ ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
#define obstack_freefun(h, newfreefun) \
- ((h) -> freefun = (void (*)(void *)) (newfreefun))
+ ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
#else
diff --git a/contrib/binutils/include/opcode/ChangeLog b/contrib/binutils/include/opcode/ChangeLog
index 8a1b7d7..40ea655 100644
--- a/contrib/binutils/include/opcode/ChangeLog
+++ b/contrib/binutils/include/opcode/ChangeLog
@@ -1,3 +1,218 @@
+Mon Mar 30 21:31:56 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * i386.h: Revert March 24 patch; no more LinearAddress.
+
+Mon Mar 30 10:25:54 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386.h (i386_optab): Remove fwait (9b) from all floating point
+ instructions, and instead add FWait opcode modifier. Add short
+ form of fldenv and fstenv.
+ (FWAIT_OPCODE): Define.
+
+ * i386.h (i386_optab): Change second operand constraint of `mov
+ sreg,reg|mem' instruction from Reg16|Mem to WordReg|WordMem to
+ allow legal instructions such as `movl %gs,%esi'
+
+Fri Mar 27 18:30:52 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * h8300.h: Various changes to fully bracket initializers.
+
+Tue Mar 24 18:32:47 1998 H.J. Lu <hjl@gnu.org>
+
+ * i386.h: Set LinearAddress for lidt and lgdt.
+
+Mon Mar 2 10:44:07 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen.h (CGEN_BOOL_ATTR): New macro.
+
+Mon Feb 23 10:38:21 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen.h (CGEN_CAT3): Delete. Use CONCAT3 now.
+ (cgen_insn): Record syntax and format entries here, rather than
+ separately.
+
+Tue Feb 17 21:42:56 1998 Nick Clifton <nickc@cygnus.com>
+
+ * cgen.h (CGEN_SYNTAX_MAKE_FIELD): New macro.
+
+Tue Feb 17 16:00:56 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen.h (cgen_insert_fn): Change type of result to const char *.
+ (cgen_parse_{signed,unsigned}_integer): Delete min,max arguments.
+ (CGEN_{INSN,KEYWORD,OPERAND}_NBOOL_ATTRS): Renamed from ..._MAX_ATTRS.
+
+Thu Feb 12 18:30:41 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * cgen.h (lookup_insn): New argument alias_p.
+
+Thu Feb 12 03:41:00 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+Fix rac to accept only a0:
+ * d10v.h (OPERAND_ACC): Split into:
+ (OPERAND_ACC0, OPERAND_ACC1) .
+ (OPERAND_GPR): Define.
+
+Wed Feb 11 17:31:53 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen.h (CGEN_FIELDS): Define here.
+ (CGEN_HW_ENTRY): New member `type'.
+ (hw_list): Delete decl.
+ (enum cgen_mode): Declare.
+ (CGEN_OPERAND): New member `hw'.
+ (enum cgen_operand_instance_type): Declare.
+ (CGEN_OPERAND_INSTANCE): New type.
+ (CGEN_INSN): New member `operands'.
+ (CGEN_OPCODE_DATA): Make hw_list const.
+ (get_insn_operands,lookup_insn): Add prototypes for.
+
+Tue Feb 3 17:11:23 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen.h (CGEN_INSN_MAX_ATTRS): Renamed from CGEN_MAX_INSN_ATTRS.
+ (CGEN_HW_ENTRY): Move `next' entry to end of struct.
+ (CGEN_KEYWORD_MAX_ATTRS): Renamed from CGEN_MAX_KEYWORD_ATTRS.
+ (CGEN_OPERAND_MAX_ATTRS): Renamed from CGEN_MAX_OPERAND_ATTRS.
+
+Mon Feb 2 19:19:15 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * cgen.h: Correct typo in comment end marker.
+
+Mon Feb 2 17:10:38 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
+
+ * tic30.h: New file.
+
+Thu Jan 22 17:54:56 1998 Nick Clifton <nickc@cygnus.com>
+
+ * cgen.h: Add prototypes for cgen_save_fixups(),
+ cgen_restore_fixups(), and cgen_swap_fixups(). Change prototype
+ of cgen_asm_finish_insn() to return a char *.
+
+Wed Jan 14 17:21:43 1998 Nick Clifton <nickc@cygnus.com>
+
+ * cgen.h: Formatting changes to improve readability.
+
+Mon Jan 12 11:37:36 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen.h (*): Clean up pass over `struct foo' usage.
+ (CGEN_ATTR): Make unsigned char.
+ (CGEN_ATTR_TYPE): Update.
+ (CGEN_ATTR_{ENTRY,TABLE}): New types.
+ (cgen_base): Move member `attrs' to cgen_insn.
+ (CGEN_KEYWORD): New member `null_entry'.
+ (CGEN_{SYNTAX,FORMAT}): New types.
+ (cgen_insn): Format and syntax separated from each other.
+
+Mon Dec 1 12:24:44 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * m68k.h: Fix comment describing operand types.
+
+Tue Nov 18 18:45:14 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * d10v.h (OPERAND_FLAG): Split into:
+ (OPERAND_FFLAG, OPERAND_CFLAG) .
+
+Thu Nov 13 11:04:24 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips.h (struct mips_opcode): Changed comments to reflect new
+ field usage.
+
+Fri Oct 24 22:36:20 1997 Ken Raeburn <raeburn@cygnus.com>
+
+ * mips.h: Added to comments a quick-ref list of all assigned
+ operand type characters.
+ (OP_{MASK,SH}_PERFREG): New macros.
+
+Wed Oct 22 17:28:33 1997 Richard Henderson <rth@cygnus.com>
+
+ * sparc.h: Add '_' and '/' for v9a asr's.
+ Patch from David Miller <davem@vger.rutgers.edu>
+
+Tue Oct 14 13:22:29 1997 Jeffrey A Law (law@cygnus.com)
+
+ * h8300.h: Bit ops with absolute addresses not in the 8 bit
+ area are not available in the base model (H8/300).
+
+Thu Sep 25 13:03:41 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * m68k.h: Remove documentation of ` operand specifier.
+
+Wed Sep 24 19:00:34 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * m68k.h: Document q and v operand specifiers.
+
+Mon Sep 15 18:28:37 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850.h (struct v850_opcode): Add processors field.
+ (PROCESSOR_V850, PROCESSOR_ALL): New bit constants.
+
+Mon Sep 8 14:05:45 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * cgen.h: Move assembler interface section
+ up so cgen_parse_operand_result is defined for cgen_parse_address.
+ (cgen_parse_address): Update prototype.
+
+Tue Sep 2 15:32:32 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850.h (V850_OPREAND_ADJUST_SHORT_MEMORY): Removed.
+
+Tue Aug 26 12:21:52 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * i386.h (two_byte_segment_defaults): Correct base register 5 in
+ modes 1 and 2 to be ss rather than ds. From Gabriel Paubert
+ <paubert@iram.es>.
+
+ * i386.h: Set ud2 to 0x0f0b. From Gabriel Paubert
+ <paubert@iram.es>.
+
+ * i386.h: Comment fixes for ficom[p]?{s,l} from Gabriel Paubert
+ <paubert@iram.es>.
+
+ * i386.h (JUMP_ON_CX_ZERO): Uncomment (define again).
+ (JUMP_ON_ECX_ZERO): Remove commented out macro.
+
+Fri Aug 22 10:38:29 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850.h (V850_NOT_R0): New flag.
+
+Mon Aug 18 11:05:58 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850.h (struct v850_opcode): Remove flags field.
+
+Wed Aug 13 18:45:48 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850.h (struct v850_opcode): Add flags field.
+ (struct v850_operand): Extend meaning of 'bits' and 'shift'
+ fields.
+
+
+Fri Aug 8 16:58:42 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * arc.h: New file.
+
+Thu Jul 24 21:16:58 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * sparc.h (sparc_opcodes): Declare as const.
+
+Thu Jul 10 12:53:25 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mips.h (FP_S, FP_D): Define. Bitmasks indicating if an insn
+ uses single or double precision floating point resources.
+ (INSN_NO_ISA, INSN_ISA1): Define.
+ (cpu specific INSN macros): Tweak into bitmasks outside the range
+ of INSN_ISA field.
+
+Mon Jun 16 14:10:00 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * i386.h: Fix pand opcode.
+
+Mon Jun 2 11:35:09 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips.h: Widen INSN_ISA and move it to a more convenient
+ bit position. Add INSN_3900.
+
+Tue May 20 11:25:29 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips.h (struct mips_opcode): added new field membership.
+
Mon May 12 16:26:50 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
* i386.h (movd): only Reg32 is allowed.
@@ -42,6 +257,10 @@ Fri Apr 4 14:02:32 1997 Ian Lance Taylor <ian@cygnus.com>
* i386.h: Correct opcode values for fsubp, fsubrp, fdivp, and
fdivrp.
+Tue Mar 25 22:57:26 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * v850.h (extract): Make unsigned.
+
Mon Mar 24 14:38:15 1997 Ian Lance Taylor <ian@cygnus.com>
* i386.h: Add iclr.
@@ -81,6 +300,11 @@ Wed Jan 29 09:37:25 1997 Jeffrey A Law (law@cygnus.com)
* mn10200.h (MN10200_OPERAND_RELAX): Define.
+Tue Dec 31 15:05:41 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * v850.h (V850_OPERAND_ADJUST_SHORT_MEMORY): New flag to adjust
+ type IV instruction offsets.
+
Wed Dec 18 10:06:31 1996 Jeffrey A Law (law@cygnus.com)
* mn10200.h (MN10200_OPERAND_NOCHECK): Define.
@@ -89,6 +313,7 @@ Sat Dec 14 10:48:31 1996 Fred Fish <fnf@ninemoons.com>
* mn10200.h: Fix comment, mn10200_operand not powerpc_operand.
* mn10300.h: Fix comment, mn10300_operand not powerpc_operand.
+ * v850.h: Fix comment, v850_operand not powerpc_operand.
Mon Dec 9 16:45:39 1996 Jeffrey A Law (law@cygnus.com)
@@ -132,6 +357,10 @@ Fri Nov 1 10:31:02 1996 Richard Henderson <rth@tamu.edu>
implementation.
(struct alpha_operand): Move flags slot for better packing.
+Tue Oct 29 12:19:10 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850.h (V850_OPERAND_RELAX): New operand flag.
+
Thu Oct 10 14:29:11 1996 Jeffrey A Law (law@cygnus.com)
* mn10300.h (FMT_*): Move operand format definitions
@@ -155,10 +384,42 @@ Wed Oct 2 21:31:26 1996 Jeffrey A Law (law@cygnus.com)
* mn10x00.h: New file.
+Fri Sep 27 18:26:46 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * v850.h: Add new flag to indicate this instruction uses a PC
+ displacement.
+
Fri Sep 13 14:58:13 1996 Jeffrey A Law (law@cygnus.com)
* h8300.h (stmac): Add missing instruction.
+Sat Aug 31 16:02:03 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850.h (v850_opcode): Remove "size" field. Add "memop"
+ field.
+
+Fri Aug 23 10:39:08 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850.h (V850_OPERAND_EP): Define.
+
+ * v850.h (v850_opcode): Add size field.
+
+Thu Aug 22 16:51:25 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * v850.h (v850_operands): Add insert and extract fields, pointers
+ to functions used to handle unusual operand encoding.
+ (V850_OPERAND_REG, V850_OPERAND_SRG, V850_OPERAND_CC,
+ V850_OPERAND_SIGNED): Defined.
+
+Wed Aug 21 17:45:10 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * v850.h (v850_operands): Add flags field.
+ (OPERAND_REG, OPERAND_NUM): Defined.
+
+Tue Aug 20 14:52:02 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * v850.h: New file.
+
Fri Aug 16 14:44:15 1996 James G. Smith <jsmith@cygnus.co.uk>
* mips.h (OP_SH_LOCC, OP_SH_HICC, OP_MASK_CC, OP_SH_COP1NORM,
@@ -419,14 +680,12 @@ Wed Jun 21 18:49:51 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
[!NO_DEFAULT_SIZES]: An omitted size defaults to `w'.
(m68k_opcode_aliases): Add more aliases.
-
Fri Apr 14 22:15:34 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
* m68k.h: Added explcitly short-sized conditional branches, and a
bunch of aliases (fmov*, ftest*, tdivul) to support gcc's
svr4-based configurations.
-
Mon Mar 13 21:30:01 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
Mon Feb 27 08:36:39 1995 Bryan Ford <baford@cs.utah.edu>
@@ -455,7 +714,6 @@ Wed Mar 8 03:13:23 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
[DONT_DEFINE_TABLE]: Declare numopcodes, numaliases, and
m68k_opcode_aliases; update declaration of m68k_opcodes.
-
Mon Mar 6 10:02:00 1995 Jeff Law (law@snake.cs.utah.edu)
* hppa.h (delay_type): Delete unused enumeration.
@@ -479,7 +737,6 @@ Wed Feb 15 12:19:52 1995 Ian Lance Taylor <ian@cygnus.com>
* mips.h (M_ULD, M_ULD_A, M_USD, M_USD_A): Define.
-
Mon Feb 6 10:35:23 1995 J.T. Conklin <jtc@rtl.cygnus.com>
* i386.h: added cpuid instruction , and dr[0-7] aliases for the
@@ -510,8 +767,6 @@ Tue Jan 17 10:55:30 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
* mips.h (INSN_ISA, INSN_4650): Define.
-
-
Wed Oct 19 13:34:17 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
* a29k.h: Add operand type 'I' for `inv' and `iretinv'. On
diff --git a/contrib/binutils/include/opcode/arc.h b/contrib/binutils/include/opcode/arc.h
new file mode 100644
index 0000000..a1e0ca1
--- /dev/null
+++ b/contrib/binutils/include/opcode/arc.h
@@ -0,0 +1,274 @@
+/* Opcode table for the ARC.
+ Copyright 1994, 1995, 1997 Free Software Foundation, Inc.
+ Contributed by Doug Evans (dje@cygnus.com).
+
+This file is part of GAS, the GNU Assembler, GDB, the GNU debugger, and
+the GNU Binutils.
+
+GAS/GDB is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GAS/GDB 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 GAS or GDB; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* List of the various cpu types.
+ The tables currently use bit masks to say whether the instruction or
+ whatever is supported by a particular cpu. This lets us have one entry
+ apply to several cpus.
+
+ This duplicates bfd_mach_arc_xxx. For now I wish to isolate this from bfd
+ and bfd from this. Also note that these numbers are bit values as we want
+ to allow for things available on more than one ARC (but not necessarily all
+ ARCs). */
+
+/* The `base' cpu must be 0 (table entries are omitted for the base cpu).
+ The cpu type is treated independently of endianness.
+ The complete `mach' number includes endianness.
+ These values are internal to opcodes/bfd/binutils/gas. */
+#define ARC_MACH_BASE 0
+#define ARC_MACH_UNUSED1 1
+#define ARC_MACH_UNUSED2 2
+#define ARC_MACH_UNUSED4 4
+/* Additional cpu values can be inserted here and ARC_MACH_BIG moved down. */
+#define ARC_MACH_BIG 8
+
+/* Mask of number of bits necessary to record cpu type. */
+#define ARC_MACH_CPU_MASK 7
+/* Mask of number of bits necessary to record cpu type + endianness. */
+#define ARC_MACH_MASK 15
+
+/* Type to denote an ARC instruction (at least a 32 bit unsigned int). */
+typedef unsigned int arc_insn;
+
+struct arc_opcode {
+ char *syntax; /* syntax of insn */
+ unsigned long mask, value; /* recognize insn if (op&mask)==value */
+ int flags; /* various flag bits */
+
+/* Values for `flags'. */
+
+/* Return CPU number, given flag bits. */
+#define ARC_OPCODE_CPU(bits) ((bits) & ARC_MACH_CPU_MASK)
+/* Return MACH number, given flag bits. */
+#define ARC_OPCODE_MACH(bits) ((bits) & ARC_MACH_MASK)
+/* First opcode flag bit available after machine mask. */
+#define ARC_OPCODE_FLAG_START ((ARC_MACH_MASK + 1) << 0)
+/* This insn is a conditional branch. */
+#define ARC_OPCODE_COND_BRANCH (ARC_OPCODE_FLAG_START)
+
+ /* These values are used to optimize assembly and disassembly. Each insn is
+ on a list of related insns (same first letter for assembly, same insn code
+ for disassembly). */
+ struct arc_opcode *next_asm; /* Next instruction to try during assembly. */
+ struct arc_opcode *next_dis; /* Next instruction to try during disassembly. */
+
+ /* Macros to create the hash values for the lists. */
+#define ARC_HASH_OPCODE(string) \
+ ((string)[0] >= 'a' && (string)[0] <= 'z' ? (string)[0] - 'a' : 26)
+#define ARC_HASH_ICODE(insn) \
+ ((unsigned int) (insn) >> 27)
+
+ /* Macros to access `next_asm', `next_dis' so users needn't care about the
+ underlying mechanism. */
+#define ARC_OPCODE_NEXT_ASM(op) ((op)->next_asm)
+#define ARC_OPCODE_NEXT_DIS(op) ((op)->next_dis)
+};
+
+struct arc_operand_value {
+ char *name; /* eg: "eq" */
+ short value; /* eg: 1 */
+ unsigned char type; /* index into `arc_operands' */
+ unsigned char flags; /* various flag bits */
+
+/* Values for `flags'. */
+
+/* Return CPU number, given flag bits. */
+#define ARC_OPVAL_CPU(bits) ((bits) & ARC_MACH_CPU_MASK)
+/* Return MACH number, given flag bits. */
+#define ARC_OPVAL_MACH(bits) ((bits) & ARC_MACH_MASK)
+};
+
+struct arc_operand {
+ /* One of the insn format chars. */
+ unsigned char fmt;
+
+ /* The number of bits in the operand (may be unused for a modifier). */
+ unsigned char bits;
+
+ /* How far the operand is left shifted in the instruction, or
+ the modifier's flag bit (may be unused for a modifier. */
+ unsigned char shift;
+
+ /* Various flag bits. */
+ int flags;
+
+/* Values for `flags'. */
+
+/* This operand is a suffix to the opcode. */
+#define ARC_OPERAND_SUFFIX 1
+
+/* This operand is a relative branch displacement. The disassembler
+ prints these symbolically if possible. */
+#define ARC_OPERAND_RELATIVE_BRANCH 2
+
+/* This operand is an absolute branch address. The disassembler
+ prints these symbolically if possible. */
+#define ARC_OPERAND_ABSOLUTE_BRANCH 4
+
+/* This operand is an address. The disassembler
+ prints these symbolically if possible. */
+#define ARC_OPERAND_ADDRESS 8
+
+/* This operand is a long immediate value. */
+#define ARC_OPERAND_LIMM 0x10
+
+/* This operand takes signed values. */
+#define ARC_OPERAND_SIGNED 0x20
+
+/* This operand takes signed values, but also accepts a full positive
+ range of values. That is, if bits is 16, it takes any value from
+ -0x8000 to 0xffff. */
+#define ARC_OPERAND_SIGNOPT 0x40
+
+/* This operand should be regarded as a negative number for the
+ purposes of overflow checking (i.e., the normal most negative
+ number is disallowed and one more than the normal most positive
+ number is allowed). This flag will only be set for a signed
+ operand. */
+#define ARC_OPERAND_NEGATIVE 0x80
+
+/* This operand doesn't really exist. The program uses these operands
+ in special ways. */
+#define ARC_OPERAND_FAKE 0x100
+
+/* Modifier values. */
+/* A dot is required before a suffix. Eg: .le */
+#define ARC_MOD_DOT 0x1000
+
+/* A normal register is allowed (not used, but here for completeness). */
+#define ARC_MOD_REG 0x2000
+
+/* An auxiliary register name is expected. */
+#define ARC_MOD_AUXREG 0x4000
+
+/* Sum of all ARC_MOD_XXX bits. */
+#define ARC_MOD_BITS 0x7000
+
+/* Non-zero if the operand type is really a modifier. */
+#define ARC_MOD_P(X) ((X) & ARC_MOD_BITS)
+
+ /* Insertion function. This is used by the assembler. To insert an
+ operand value into an instruction, check this field.
+
+ If it is NULL, execute
+ i |= (p & ((1 << o->bits) - 1)) << o->shift;
+ (I is the instruction which we are filling in, O is a pointer to
+ this structure, and OP is the opcode value; this assumes twos
+ complement arithmetic).
+
+ If this field is not NULL, then simply call it with the
+ instruction and the operand value. It will return the new value
+ of the instruction. If the ERRMSG argument is not NULL, then if
+ the operand value is illegal, *ERRMSG will be set to a warning
+ string (the operand will be inserted in any case). If the
+ operand value is legal, *ERRMSG will be unchanged.
+
+ REG is non-NULL when inserting a register value. */
+
+ arc_insn (*insert) PARAMS ((arc_insn insn,
+ const struct arc_operand *operand, int mods,
+ const struct arc_operand_value *reg, long value,
+ const char **errmsg));
+
+ /* Extraction function. This is used by the disassembler. To
+ extract this operand type from an instruction, check this field.
+
+ If it is NULL, compute
+ op = ((i) >> o->shift) & ((1 << o->bits) - 1);
+ if ((o->flags & ARC_OPERAND_SIGNED) != 0
+ && (op & (1 << (o->bits - 1))) != 0)
+ op -= 1 << o->bits;
+ (I is the instruction, O is a pointer to this structure, and OP
+ is the result; this assumes twos complement arithmetic).
+
+ If this field is not NULL, then simply call it with the
+ instruction value. It will return the value of the operand. If
+ the INVALID argument is not NULL, *INVALID will be set to
+ non-zero if this operand type can not actually be extracted from
+ this operand (i.e., the instruction does not match). If the
+ operand is valid, *INVALID will not be changed.
+
+ INSN is a pointer to an array of two `arc_insn's. The first element is
+ the insn, the second is the limm if present.
+
+ Operands that have a printable form like registers and suffixes have
+ their struct arc_operand_value pointer stored in OPVAL. */
+
+ long (*extract) PARAMS ((arc_insn *insn,
+ const struct arc_operand *operand,
+ int mods, const struct arc_operand_value **opval,
+ int *invalid));
+};
+
+/* Bits that say what version of cpu we have.
+ These should be passed to arc_init_opcode_tables.
+ At present, all there is is the cpu type. */
+
+/* CPU number, given value passed to `arc_init_opcode_tables'. */
+#define ARC_HAVE_CPU(bits) ((bits) & ARC_MACH_CPU_MASK)
+/* MACH number, given value passed to `arc_init_opcode_tables'. */
+#define ARC_HAVE_MACH(bits) ((bits) & ARC_MACH_MASK)
+
+/* Special register values: */
+#define ARC_REG_SHIMM_UPDATE 61
+#define ARC_REG_SHIMM 63
+#define ARC_REG_LIMM 62
+
+/* Non-zero if REG is a constant marker. */
+#define ARC_REG_CONSTANT_P(REG) ((REG) >= 61)
+
+/* Positions and masks of various fields: */
+#define ARC_SHIFT_REGA 21
+#define ARC_SHIFT_REGB 15
+#define ARC_SHIFT_REGC 9
+#define ARC_MASK_REG 63
+
+/* Delay slot types. */
+#define ARC_DELAY_NONE 0 /* no delay slot */
+#define ARC_DELAY_NORMAL 1 /* delay slot in both cases */
+#define ARC_DELAY_JUMP 2 /* delay slot only if branch taken */
+
+/* Non-zero if X will fit in a signed 9 bit field. */
+#define ARC_SHIMM_CONST_P(x) ((long) (x) >= -256 && (long) (x) <= 255)
+
+extern const struct arc_operand arc_operands[];
+extern const int arc_operand_count;
+extern /*const*/ struct arc_opcode arc_opcodes[];
+extern const int arc_opcodes_count;
+extern const struct arc_operand_value arc_suffixes[];
+extern const int arc_suffixes_count;
+extern const struct arc_operand_value arc_reg_names[];
+extern const int arc_reg_names_count;
+extern unsigned char arc_operand_map[];
+
+/* Utility fns in arc-opc.c. */
+int arc_get_opcode_mach PARAMS ((int, int));
+/* `arc_opcode_init_tables' must be called before `arc_xxx_supported'. */
+void arc_opcode_init_tables PARAMS ((int));
+void arc_opcode_init_insert PARAMS ((void));
+void arc_opcode_init_extract PARAMS ((void));
+const struct arc_opcode *arc_opcode_lookup_asm PARAMS ((const char *));
+const struct arc_opcode *arc_opcode_lookup_dis PARAMS ((unsigned int));
+int arc_opcode_limm_p PARAMS ((long *));
+const struct arc_operand_value *arc_opcode_lookup_suffix PARAMS ((const struct arc_operand *type, int value));
+int arc_opcode_supported PARAMS ((const struct arc_opcode *));
+int arc_opval_supported PARAMS ((const struct arc_operand_value *));
diff --git a/contrib/binutils/include/opcode/cgen.h b/contrib/binutils/include/opcode/cgen.h
index cda3373..ab59f24 100644
--- a/contrib/binutils/include/opcode/cgen.h
+++ b/contrib/binutils/include/opcode/cgen.h
@@ -1,6 +1,6 @@
/* Header file for targets using CGEN: Cpu tools GENerator.
-Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of GDB, the GNU debugger, and the GNU Binutils.
@@ -14,22 +14,13 @@ 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. */
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef CGEN_H
#define CGEN_H
-#ifndef CGEN_CAT3
-#if defined(__STDC__) || defined(ALMOST_STDC)
-#define CGEN_XCAT3(a,b,c) a ## b ## c
-#define CGEN_CAT3(a,b,c) CGEN_XCAT3 (a, b, c)
-#else
-#define CGEN_CAT3(a,b,c) a/**/b/**/c
-#endif
-#endif
-
/* Prepend the cpu name, defined in cpu-opc.h, and _cgen_ to symbol S.
The lack of spaces in the arg list is important for non-stdc systems.
This file is included by <cpu>-opc.h.
@@ -37,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
dependent portions will be declared as "unknown_cgen_foo". */
#ifndef CGEN_SYM
-#define CGEN_SYM(s) CGEN_CAT3 (unknown,_cgen_,s)
+#define CGEN_SYM(s) CONCAT3 (unknown,_cgen_,s)
#endif
/* This file contains the static (unchanging) pieces and as much other stuff
@@ -60,7 +51,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef CGEN_INT_INSN
typedef unsigned int cgen_insn_t;
#else
-typedef char *cgen_insn_t;
+typedef char * cgen_insn_t;
#endif
#ifdef __GNUC__
@@ -71,7 +62,8 @@ typedef char *cgen_insn_t;
/* Perhaps we should just use bfd.h, but it's not clear
one would want to require that yet. */
-enum cgen_endian {
+enum cgen_endian
+{
CGEN_ENDIAN_UNKNOWN,
CGEN_ENDIAN_LITTLE,
CGEN_ENDIAN_BIG
@@ -81,8 +73,9 @@ enum cgen_endian {
Attributes are used to describe various random things. */
/* Struct to record attribute information. */
-typedef struct {
- unsigned int num_nonbools;
+typedef struct
+{
+ unsigned char num_nonbools;
unsigned int bool;
unsigned int nonbool[1];
} CGEN_ATTR;
@@ -94,13 +87,17 @@ typedef struct {
nonbool: values of non-boolean attributes
There is a maximum of 32 attributes total. */
#define CGEN_ATTR_TYPE(n) \
-const struct { unsigned int num_nonbools; \
+const struct { unsigned char num_nonbools; \
unsigned int bool; \
unsigned int nonbool[(n) ? (n) : 1]; }
/* Given an attribute number, return its mask. */
#define CGEN_ATTR_MASK(attr) (1 << (attr))
+/* Return the value of boolean attribute ATTR in ATTRS. */
+#define CGEN_BOOL_ATTR(attrs, attr) \
+((CGEN_ATTR_MASK (attr) & (attrs)) != 0)
+
/* Return value of attribute ATTR in ATTR_TABLE for OBJ.
OBJ is a pointer to the entity that has the attributes.
It's not used at present but is reserved for future purposes. */
@@ -108,6 +105,24 @@ const struct { unsigned int num_nonbools; \
((unsigned int) (attr) < (attr_table)->num_nonbools \
? ((attr_table)->nonbool[attr]) \
: (((attr_table)->bool & (1 << (attr))) != 0))
+
+/* Attribute name/value tables.
+ These are used to assist parsing of descriptions at runtime. */
+
+typedef struct
+{
+ const char * name;
+ int value;
+} CGEN_ATTR_ENTRY;
+
+/* For each domain (fld,operand,insn), list of attributes. */
+
+typedef struct
+{
+ const char * name;
+ /* NULL for boolean attributes. */
+ const CGEN_ATTR_ENTRY * vals;
+} CGEN_ATTR_TABLE;
/* Parse result (also extraction result).
@@ -125,7 +140,7 @@ const struct { unsigned int num_nonbools; \
where it varies.
*/
-struct cgen_fields;
+typedef struct cgen_fields CGEN_FIELDS;
/* Total length of the insn, as recorded in the `fields' struct. */
/* ??? The field insert handler has lots of opportunities for optimization
@@ -151,7 +166,7 @@ typedef struct cgen_insn CGEN_INSN;
The result is NULL if success or an error message. */
typedef const char * (cgen_parse_fn) PARAMS ((const struct cgen_insn *,
const char **,
- struct cgen_fields *));
+ CGEN_FIELDS *));
/* Print handler.
The first argument is a pointer to the disassembly info.
@@ -165,7 +180,7 @@ typedef const char * (cgen_parse_fn) PARAMS ((const struct cgen_insn *,
/* Don't require bfd.h unnecessarily. */
#ifdef BFD_VERSION
typedef void (cgen_print_fn) PARAMS ((PTR, const struct cgen_insn *,
- struct cgen_fields *, bfd_vma, int));
+ CGEN_FIELDS *, bfd_vma, int));
#else
typedef void (cgen_print_fn) ();
#endif
@@ -175,9 +190,10 @@ typedef void (cgen_print_fn) ();
parsed.
The second argument is a pointer to a cgen_fields struct
from which the values are fetched.
- The third argument is a pointer to a buffer in which to place the insn. */
-typedef void (cgen_insert_fn) PARAMS ((const struct cgen_insn *,
- struct cgen_fields *, cgen_insn_t *));
+ The third argument is a pointer to a buffer in which to place the insn.
+ The result is an error message or NULL if success. */
+typedef const char * (cgen_insert_fn) PARAMS ((const struct cgen_insn *,
+ CGEN_FIELDS *, cgen_insn_t *));
/* Extract handler.
The first argument is a pointer to a struct describing the insn being
@@ -190,7 +206,7 @@ typedef void (cgen_insert_fn) PARAMS ((const struct cgen_insn *,
The result is the length of the insn or zero if not recognized. */
typedef int (cgen_extract_fn) PARAMS ((const struct cgen_insn *,
void *, cgen_insn_t,
- struct cgen_fields *));
+ CGEN_FIELDS *));
/* The `parse' and `insert' fields are indices into these tables.
The elements are pointer to specialized handler functions.
@@ -207,127 +223,155 @@ extern cgen_print_fn * CGEN_SYM (print_handlers) [];
#define CGEN_PRINT_FN(x) (CGEN_SYM (print_handlers)[(x)->base.print])
/* Base class of parser/printer.
- (Don't read too much into the use of the phrase "base class").
+ (Don't read too much into the use of the phrase "base class".
+ It's a name I'm using to organize my thoughts.)
Instructions and expressions all share this data in common.
- It's a collection of the common elements needed to parse and print
- each of them. */
+ It's a collection of the common elements needed to parse, insert, extract,
+ and print each of them. */
-#ifndef CGEN_MAX_INSN_ATTRS
-#define CGEN_MAX_INSN_ATTRS 1
-#endif
-
-struct cgen_base {
+struct cgen_base
+{
/* Indices into the handler tables.
We could use pointers here instead, but in the case of the insn table,
90% of them would be identical and that's a lot of redundant data.
0 means use the default (what the default is is up to the code). */
unsigned char parse, insert, extract, print;
-
- /* Attributes. */
- CGEN_ATTR_TYPE (CGEN_MAX_INSN_ATTRS) attrs;
};
-/* Syntax table.
+/* Assembler interface.
- Each insn and subexpression has one of these.
+ The interface to the assembler is intended to be clean in the sense that
+ libopcodes.a is a standalone entity and could be used with any assembler.
+ Not that one would necessarily want to do that but rather that it helps
+ keep a clean interface. The interface will obviously be slanted towards
+ GAS, but at least it's a start.
- The syntax "string" consists of characters (n > 0 && n < 128), and operand
- values (n >= 128), and is terminated by 0. Operand values are 128 + index
- into the operand table. The operand table doesn't exist in C, per se, as
- the data is recorded in the parse/insert/extract/print switch statements.
+ Parsing is controlled by the assembler which calls
+ CGEN_SYM (assemble_insn). If it can parse and build the entire insn
+ it doesn't call back to the assembler. If it needs/wants to call back
+ to the assembler, (*cgen_parse_operand_fn) is called which can either
- ??? Whether we want to use yacc instead is unclear, but we do make an
- effort to not make doing that difficult. At least that's the intent.
-*/
+ - return a number to be inserted in the insn
+ - return a "register" value to be inserted
+ (the register might not be a register per pe)
+ - queue the argument and return a marker saying the expression has been
+ queued (eg: a fix-up)
+ - return an error message indicating the expression wasn't recognizable
-struct cgen_syntax {
- /* Original syntax string, for debugging purposes. */
- char *orig;
+ The result is an error message or NULL for success.
+ The parsed value is stored in the bfd_vma *. */
- /* Name of entry (that distinguishes it from all other entries).
- This is used, for example, in simulator profiling results. */
- char *name;
+/* Values for indicating what the caller wants. */
+enum cgen_parse_operand_type
+{
+ CGEN_PARSE_OPERAND_INIT,
+ CGEN_PARSE_OPERAND_INTEGER,
+ CGEN_PARSE_OPERAND_ADDRESS
+};
+
+/* Values for indicating what was parsed.
+ ??? Not too useful at present but in time. */
+enum cgen_parse_operand_result
+{
+ CGEN_PARSE_OPERAND_RESULT_NUMBER,
+ CGEN_PARSE_OPERAND_RESULT_REGISTER,
+ CGEN_PARSE_OPERAND_RESULT_QUEUED,
+ CGEN_PARSE_OPERAND_RESULT_ERROR
+};
-#if 0 /* not needed yet */
- /* Format of this insn.
- This doesn't closely follow the notion of instruction formats for more
- complex instruction sets. This is the value computed at runtime. */
- enum cgen_fmt_type fmt;
+/* Don't require bfd.h unnecessarily. */
+#ifdef BFD_VERSION
+extern const char * (*cgen_parse_operand_fn)
+ PARAMS ((enum cgen_parse_operand_type, const char **, int, int,
+ enum cgen_parse_operand_result *, bfd_vma *));
#endif
- /* Mnemonic (or name if expression). */
- char *mnemonic;
+/* Called before trying to match a table entry with the insn. */
+void cgen_init_parse_operand PARAMS ((void));
- /* Syntax string. */
- /* FIXME: If each insn's mnemonic is constant, do we want to record just
- the arguments here? */
-#ifndef CGEN_MAX_SYNTAX_BYTES
-#define CGEN_MAX_SYNTAX_BYTES 16
-#endif
- unsigned char syntax[CGEN_MAX_SYNTAX_BYTES];
+/* Called from <cpu>-asm.c to initialize operand parsing. */
-#define CGEN_SYNTAX_CHAR_P(c) ((c) < 128)
-#define CGEN_SYNTAX_CHAR(c) (c)
-#define CGEN_SYNTAX_FIELD(c) ((c) - 128)
+/* These are GAS specific. They're not here as part of the interface,
+ but rather that we need to put them somewhere. */
- /* recognize insn if (op & mask) == value
- For architectures with variable length insns, this is just a preliminary
- test. */
- /* FIXME: Might want a selectable type (rather than always
- unsigned long). */
- unsigned long mask, value;
+/* Call this from md_assemble to initialize the assembler callback. */
+void cgen_asm_init_parse PARAMS ((void));
- /* length, in bits
- This is the size that `mask' and `value' have been calculated to.
- Normally it is CGEN_BASE_INSN_BITSIZE. On vliw architectures where
- the base insn size may be larger than the size of an insn, this field is
- less than CGEN_BASE_INSN_BITSIZE.
- On architectures like the 386 and m68k the real size of the insn may
- be computed while parsing. */
- /* FIXME: wip, of course */
- int length;
-};
+/* Don't require bfd.h unnecessarily. */
+#ifdef BFD_VERSION
+/* The result is an error message or NULL for success.
+ The parsed value is stored in the bfd_vma *. */
+const char * cgen_parse_operand PARAMS ((enum cgen_parse_operand_type,
+ const char **, int, int,
+ enum cgen_parse_operand_result *,
+ bfd_vma *));
+#endif
+
+void cgen_save_fixups PARAMS ((void));
+void cgen_restore_fixups PARAMS ((void));
+void cgen_swap_fixups PARAMS ((void));
+
+/* Add a register to the assembler's hash table.
+ This makes lets GAS parse registers for us.
+ ??? This isn't currently used, but it could be in the future. */
+void cgen_asm_record_register PARAMS ((char *, int));
+
+/* After CGEN_SYM (assemble_insn) is done, this is called to
+ output the insn and record any fixups. The address of the
+ assembled instruction is returned in case it is needed by
+ the caller. */
+char * cgen_asm_finish_insn PARAMS ((const struct cgen_insn *, cgen_insn_t *,
+ unsigned int));
/* Operand values (keywords, integers, symbols, etc.) */
/* Types of assembler elements. */
-enum cgen_asm_type {
+enum cgen_asm_type
+{
CGEN_ASM_KEYWORD, CGEN_ASM_MAX
};
/* List of hardware elements. */
-typedef struct cgen_hw_entry {
- struct cgen_hw_entry *next;
- char *name;
- enum cgen_asm_type asm_type;
- PTR asm_data;
+typedef struct cgen_hw_entry
+{
+ /* The type of this entry, one of `enum hw_type'.
+ This is an int and not the enum as the latter may not be declared yet. */
+ int type;
+ const struct cgen_hw_entry * next;
+ char * name;
+ enum cgen_asm_type asm_type;
+ PTR asm_data;
} CGEN_HW_ENTRY;
-extern CGEN_HW_ENTRY *CGEN_SYM (hw_list);
-
-CGEN_HW_ENTRY *cgen_hw_lookup PARAMS ((const char *));
-
-#ifndef CGEN_MAX_KEYWORD_ATTRS
-#define CGEN_MAX_KEYWORD_ATTRS 1
-#endif
+const CGEN_HW_ENTRY * cgen_hw_lookup PARAMS ((const char *));
/* This struct is used to describe things like register names, etc. */
-typedef struct cgen_keyword_entry {
+typedef struct cgen_keyword_entry
+{
/* Name (as in register name). */
- char *name;
+ char * name;
/* Value (as in register number).
The value cannot be -1 as that is used to indicate "not found".
IDEA: Have "FUNCTION" attribute? [function is called to fetch value]. */
int value;
- /* Attributes. */
+ /* Attributes.
+ This should, but technically needn't, appear last. It is a variable sized
+ array in that one architecture may have 1 nonbool attribute and another
+ may have more. Having this last means the non-architecture specific code
+ needn't care. */
+ /* ??? Moving this last should be done by treating keywords like insn lists
+ and moving the `next' fields into a CGEN_KEYWORD_LIST struct. */
/* FIXME: Not used yet. */
- CGEN_ATTR_TYPE (CGEN_MAX_KEYWORD_ATTRS) attrs;
+#ifndef CGEN_KEYWORD_NBOOL_ATTRS
+#define CGEN_KEYWORD_NBOOL_ATTRS 1
+#endif
+ CGEN_ATTR_TYPE (CGEN_KEYWORD_NBOOL_ATTRS) attrs;
/* Next name hash table entry. */
struct cgen_keyword_entry *next_name;
@@ -340,93 +384,138 @@ typedef struct cgen_keyword_entry {
This struct supports runtime entry of new values, and hashed lookups. */
-typedef struct cgen_keyword {
+typedef struct cgen_keyword
+{
/* Pointer to initial [compiled in] values. */
- struct cgen_keyword_entry *init_entries;
+ CGEN_KEYWORD_ENTRY * init_entries;
+
/* Number of entries in `init_entries'. */
unsigned int num_init_entries;
+
/* Hash table used for name lookup. */
- struct cgen_keyword_entry **name_hash_table;
+ CGEN_KEYWORD_ENTRY ** name_hash_table;
+
/* Hash table used for value lookup. */
- struct cgen_keyword_entry **value_hash_table;
+ CGEN_KEYWORD_ENTRY ** value_hash_table;
+
/* Number of entries in the hash_tables. */
unsigned int hash_table_size;
+
+ /* Pointer to null keyword "" entry if present. */
+ const CGEN_KEYWORD_ENTRY * null_entry;
} CGEN_KEYWORD;
/* Structure used for searching. */
-typedef struct cgen_keyword_search {
+typedef struct
+{
/* Table being searched. */
- const struct cgen_keyword *table;
+ const CGEN_KEYWORD * table;
+
/* Specification of what is being searched for. */
- const char *spec;
+ const char * spec;
+
/* Current index in hash table. */
unsigned int current_hash;
+
/* Current element in current hash chain. */
- struct cgen_keyword_entry *current_entry;
+ CGEN_KEYWORD_ENTRY * current_entry;
} CGEN_KEYWORD_SEARCH;
/* Lookup a keyword from its name. */
-const struct cgen_keyword_entry * cgen_keyword_lookup_name
- PARAMS ((struct cgen_keyword *, const char *));
+const CGEN_KEYWORD_ENTRY * cgen_keyword_lookup_name
+ PARAMS ((CGEN_KEYWORD *, const char *));
/* Lookup a keyword from its value. */
-const struct cgen_keyword_entry * cgen_keyword_lookup_value
- PARAMS ((struct cgen_keyword *, int));
+const CGEN_KEYWORD_ENTRY * cgen_keyword_lookup_value
+ PARAMS ((CGEN_KEYWORD *, int));
/* Add a keyword. */
-void cgen_keyword_add PARAMS ((struct cgen_keyword *,
- struct cgen_keyword_entry *));
+void cgen_keyword_add PARAMS ((CGEN_KEYWORD *, CGEN_KEYWORD_ENTRY *));
/* Keyword searching.
This can be used to retrieve every keyword, or a subset. */
-struct cgen_keyword_search cgen_keyword_search_init
- PARAMS ((struct cgen_keyword *, const char *));
-const struct cgen_keyword_entry *cgen_keyword_search_next
- PARAMS ((struct cgen_keyword_search *));
+CGEN_KEYWORD_SEARCH cgen_keyword_search_init
+ PARAMS ((CGEN_KEYWORD *, const char *));
+const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next
+ PARAMS ((CGEN_KEYWORD_SEARCH *));
/* Operand value support routines. */
/* FIXME: some of the long's here will need to be bfd_vma or some such. */
const char * cgen_parse_keyword PARAMS ((const char **,
- struct cgen_keyword *,
+ CGEN_KEYWORD *,
long *));
-const char * cgen_parse_signed_integer PARAMS ((const char **, int,
- long, long, long *));
+const char * cgen_parse_signed_integer PARAMS ((const char **, int, long *));
const char * cgen_parse_unsigned_integer PARAMS ((const char **, int,
- unsigned long, unsigned long,
unsigned long *));
-const char * cgen_parse_address PARAMS ((const char **, int,
- int, long *));
+const char * cgen_parse_address PARAMS ((const char **, int, int,
+ enum cgen_parse_operand_result *,
+ long *));
const char * cgen_validate_signed_integer PARAMS ((long, long, long));
const char * cgen_validate_unsigned_integer PARAMS ((unsigned long,
unsigned long,
unsigned long));
+/* Operand modes. */
+
+/* ??? This duplicates the values in arch.h. Revisit.
+ These however need the CGEN_ prefix [as does everything in this file]. */
+/* ??? Targets may need to add their own modes so we may wish to move this
+ to <arch>-opc.h, or add a hook. */
+
+enum cgen_mode {
+ CGEN_MODE_VOID, /* FIXME: rename simulator's VM to VOID */
+ CGEN_MODE_BI, CGEN_MODE_QI, CGEN_MODE_HI, CGEN_MODE_SI, CGEN_MODE_DI,
+ CGEN_MODE_UBI, CGEN_MODE_UQI, CGEN_MODE_UHI, CGEN_MODE_USI, CGEN_MODE_UDI,
+ CGEN_MODE_SF, CGEN_MODE_DF, CGEN_MODE_XF, CGEN_MODE_TF,
+ CGEN_MODE_MAX
+};
+
+/* FIXME: Until simulator is updated. */
+#define CGEN_MODE_VM CGEN_MODE_VOID
+
/* This struct defines each entry in the operand table. */
-#ifndef CGEN_MAX_OPERAND_ATTRS
-#define CGEN_MAX_OPERAND_ATTRS 1
-#endif
+typedef struct cgen_operand
+{
+ /* Name as it appears in the syntax string. */
+ char * name;
-typedef struct cgen_operand {
- /* For debugging. */
- char *name;
+ /* The hardware element associated with this operand. */
+ const CGEN_HW_ENTRY *hw;
+
+ /* FIXME: We don't yet record ifield definitions, which we should.
+ When we do it might make sense to delete start/length (since they will
+ be duplicated in the ifield's definition) and replace them with a
+ pointer to the ifield entry. Note that as more complicated situations
+ need to be handled, going more and more with an OOP paradigm will help
+ keep the complication under control. Of course, this was the goal from
+ the start, but getting there in one step was too much too soon. */
/* Bit position (msb of first byte = bit 0).
+ This is just a hint, and may be unused in more complex operands.
May be unused for a modifier. */
unsigned char start;
/* The number of bits in the operand.
+ This is just a hint, and may be unused in more complex operands.
May be unused for a modifier. */
unsigned char length;
- /* Attributes. */
- CGEN_ATTR_TYPE (CGEN_MAX_OPERAND_ATTRS) attrs;
-#define CGEN_OPERAND_ATTRS(operand) (&(operand)->attrs)
-
-#if 0 /* ??? Interesting idea but relocs tend to get too complicated for
- simple table lookups to work. */
+#if 0 /* ??? Interesting idea but relocs tend to get too complicated,
+ and ABI dependent, for simple table lookups to work. */
/* Ideally this would be the internal (external?) reloc type. */
int reloc_type;
#endif
+
+ /* Attributes.
+ This should, but technically needn't, appear last. It is a variable sized
+ array in that one architecture may have 1 nonbool attribute and another
+ may have more. Having this last means the non-architecture specific code
+ needn't care, now or tomorrow. */
+#ifndef CGEN_OPERAND_NBOOL_ATTRS
+#define CGEN_OPERAND_NBOOL_ATTRS 1
+#endif
+ CGEN_ATTR_TYPE (CGEN_OPERAND_NBOOL_ATTRS) attrs;
+#define CGEN_OPERAND_ATTRS(operand) (&(operand)->attrs)
} CGEN_OPERAND;
/* Return value of attribute ATTR in OPERAND. */
@@ -442,48 +531,207 @@ enum cgen_operand_type;
/* FIXME: Rename, cpu-opc.h defines this as the typedef of the enum. */
#define CGEN_OPERAND_TYPE(operand) ((enum cgen_operand_type) CGEN_OPERAND_INDEX (operand))
#define CGEN_OPERAND_ENTRY(n) (& CGEN_SYM (operand_table) [n])
+
+/* Types of parse/insert/extract/print cover-fn handlers. */
+/* FIXME: move opindex first to match caller. */
+/* FIXME: also need types of insert/extract/print fns. */
+/* FIXME: not currently used as type of 3rd arg varies. */
+typedef const char * (CGEN_PARSE_OPERAND_FN) PARAMS ((const char **, int,
+ long *));
+
+/* Instruction operand instances.
+
+ For each instruction, a list of the hardware elements that are read and
+ written are recorded. */
+
+/* The type of the instance. */
+enum cgen_operand_instance_type {
+ /* End of table marker. */
+ CGEN_OPERAND_INSTANCE_END = 0,
+ CGEN_OPERAND_INSTANCE_INPUT, CGEN_OPERAND_INSTANCE_OUTPUT
+};
+
+typedef struct
+{
+ /* The type of this operand. */
+ enum cgen_operand_instance_type type;
+#define CGEN_OPERAND_INSTANCE_TYPE(opinst) ((opinst)->type)
+
+ /* The hardware element referenced. */
+ const CGEN_HW_ENTRY *hw;
+#define CGEN_OPERAND_INSTANCE_HW(opinst) ((opinst)->hw)
+
+ /* The mode in which the operand is being used. */
+ enum cgen_mode mode;
+#define CGEN_OPERAND_INSTANCE_MODE(opinst) ((opinst)->mode)
+
+ /* The operand table entry or NULL if there is none (i.e. an explicit
+ hardware reference). */
+ const CGEN_OPERAND *operand;
+#define CGEN_OPERAND_INSTANCE_OPERAND(opinst) ((opinst)->operand)
+
+ /* If `operand' is NULL, the index (e.g. into array of registers). */
+ int index;
+#define CGEN_OPERAND_INSTANCE_INDEX(opinst) ((opinst)->index)
+} CGEN_OPERAND_INSTANCE;
+
+/* Syntax string.
+
+ Each insn format and subexpression has one of these.
+
+ The syntax "string" consists of characters (n > 0 && n < 128), and operand
+ values (n >= 128), and is terminated by 0. Operand values are 128 + index
+ into the operand table. The operand table doesn't exist in C, per se, as
+ the data is recorded in the parse/insert/extract/print switch statements. */
+
+#ifndef CGEN_MAX_SYNTAX_BYTES
+#define CGEN_MAX_SYNTAX_BYTES 16
+#endif
+
+typedef struct
+{
+ unsigned char syntax[CGEN_MAX_SYNTAX_BYTES];
+} CGEN_SYNTAX;
+
+#define CGEN_SYNTAX_STRING(syn) (syn->syntax)
+#define CGEN_SYNTAX_CHAR_P(c) ((c) < 128)
+#define CGEN_SYNTAX_CHAR(c) (c)
+#define CGEN_SYNTAX_FIELD(c) ((c) - 128)
+#define CGEN_SYNTAX_MAKE_FIELD(c) ((c) + 128)
+
+/* ??? I can't currently think of any case where the mnemonic doesn't come
+ first [and if one ever doesn't building the hash tables will be tricky].
+ However, we treat mnemonics as just another operand of the instruction.
+ A value of 1 means "this is where the mnemonic appears". 1 isn't
+ special other than it's a non-printable ASCII char. */
+#define CGEN_SYNTAX_MNEMONIC 1
+#define CGEN_SYNTAX_MNEMONIC_P(ch) ((ch) == CGEN_SYNTAX_MNEMONIC)
+
+/* Instruction formats.
+
+ Instructions are grouped by format. Associated with an instruction is its
+ format. Each opcode table entry contains a format table entry.
+ ??? There is usually very few formats compared with the number of insns,
+ so one can reduce the size of the opcode table by recording the format table
+ as a separate entity. Given that we currently don't, format table entries
+ are also distinguished by their operands. This increases the size of the
+ table, but reduces the number of tables. It's all minutiae anyway so it
+ doesn't really matter [at this point in time].
+
+ ??? Support for variable length ISA's is wip. */
+
+typedef struct
+{
+ /* Length that MASK and VALUE have been calculated to
+ [VALUE is recorded elsewhere].
+ Normally it is CGEN_BASE_INSN_BITSIZE. On [V]LIW architectures where
+ the base insn size may be larger than the size of an insn, this field is
+ less than CGEN_BASE_INSN_BITSIZE. */
+ unsigned char mask_length;
+
+ /* Total length of instruction, in bits. */
+ unsigned char length;
+
+ /* Mask to apply to the first MASK_LENGTH bits.
+ Each insn's value is stored with the insn.
+ The first step in recognizing an insn for disassembly is
+ (opcode & mask) == value. */
+ unsigned int mask;
+} CGEN_FORMAT;
/* This struct defines each entry in the instruction table. */
-struct cgen_insn {
+struct cgen_insn
+{
+ /* ??? Further table size reductions can be had by moving this element
+ either to the format table or to a separate table of its own. Not
+ sure this is desirable yet. */
struct cgen_base base;
+
/* Given a pointer to a cgen_insn struct, return a pointer to `base'. */
#define CGEN_INSN_BASE(insn) (&(insn)->base)
-#define CGEN_INSN_ATTRS(insn) (&(insn)->base.attrs)
- struct cgen_syntax syntax;
-#define CGEN_INSN_SYNTAX(insn) (&(insn)->syntax)
-#define CGEN_INSN_FMT(insn) ((insn)->syntax.fmt)
-#define CGEN_INSN_BITSIZE(insn) ((insn)->syntax.length)
-};
+ /* Name of entry (that distinguishes it from all other entries).
+ This is used, for example, in simulator profiling results. */
+ /* ??? If mnemonics have operands, try to print full mnemonic. */
+ const char * name;
+#define CGEN_INSN_NAME(insn) ((insn)->name)
+ /* Mnemonic. This is used when parsing and printing the insn.
+ In the case of insns that have operands on the mnemonics, this is
+ only the constant part. E.g. for conditional execution of an `add' insn,
+ where the full mnemonic is addeq, addne, etc., this is only "add". */
+ const char * mnemonic;
+#define CGEN_INSN_MNEMONIC(insn) ((insn)->mnemonic)
+
+ /* Syntax string. */
+ const CGEN_SYNTAX syntax;
+#define CGEN_INSN_SYNTAX(insn) (& (insn)->syntax)
+
+ /* Format entry. */
+ const CGEN_FORMAT format;
+#define CGEN_INSN_MASK_BITSIZE(insn) ((insn)->format.mask_length)
+#define CGEN_INSN_BITSIZE(insn) ((insn)->format.length)
+
+ /* Instruction opcode value. */
+ unsigned int value;
+#define CGEN_INSN_VALUE(insn) ((insn)->value)
+#define CGEN_INSN_MASK(insn) ((insn)->format.mask)
+
+ /* Pointer to NULL entry terminated table of operands used,
+ or NULL if none. */
+ const CGEN_OPERAND_INSTANCE *operands;
+#define CGEN_INSN_OPERANDS(insn) ((insn)->operands)
+
+ /* Attributes.
+ This must appear last. It is a variable sized array in that one
+ architecture may have 1 nonbool attribute and another may have more.
+ Having this last means the non-architecture specific code needn't
+ care. */
+#ifndef CGEN_INSN_NBOOL_ATTRS
+#define CGEN_INSN_NBOOL_ATTRS 1
+#endif
+ CGEN_ATTR_TYPE (CGEN_INSN_NBOOL_ATTRS) attrs;
+#define CGEN_INSN_ATTRS(insn) (&(insn)->attrs)
/* Return value of attribute ATTR in INSN. */
#define CGEN_INSN_ATTR(insn, attr) \
CGEN_ATTR_VALUE (insn, CGEN_INSN_ATTRS (insn), attr)
+};
/* Instruction lists.
This is used for adding new entries and for creating the hash lists. */
-typedef struct cgen_insn_list {
- struct cgen_insn_list *next;
- const struct cgen_insn *insn;
+typedef struct cgen_insn_list
+{
+ struct cgen_insn_list * next;
+ const CGEN_INSN * insn;
} CGEN_INSN_LIST;
/* The table of instructions. */
-typedef struct cgen_insn_table {
+typedef struct
+{
/* Pointer to initial [compiled in] entries. */
- const struct cgen_insn *init_entries;
+ const CGEN_INSN * init_entries;
+
+ /* Size of an entry (since the attribute member is variable sized). */
+ unsigned int entry_size;
+
/* Number of entries in `init_entries', including trailing NULL entry. */
unsigned int num_init_entries;
+
/* Values added at runtime. */
- struct cgen_insn_list *new_entries;
+ CGEN_INSN_LIST * new_entries;
+
/* Assembler hash function. */
- unsigned int (*asm_hash) PARAMS ((const char *));
+ unsigned int (* asm_hash) PARAMS ((const char *));
+
/* Number of entries in assembler hash table. */
unsigned int asm_hash_table_size;
+
/* Disassembler hash function. */
- unsigned int (*dis_hash) PARAMS ((const char *, unsigned long));
+ unsigned int (* dis_hash) PARAMS ((const char *, unsigned long));
+
/* Number of entries in disassembler hash table. */
unsigned int dis_hash_table_size;
} CGEN_INSN_TABLE;
@@ -498,7 +746,7 @@ extern const CGEN_INSN CGEN_SYM (insn_table_entries)[];
/* Return number of instructions. This includes any added at runtime. */
-int cgen_insn_count PARAMS (());
+int cgen_insn_count PARAMS ((void));
/* The assembler insn table is hashed based on some function of the mnemonic
(the actually hashing done is up to the target, but we provide a few
@@ -541,10 +789,11 @@ CGEN_INSN_LIST * cgen_dis_lookup_insn PARAMS ((const char *, unsigned long));
/* Top level structures and functions. */
-typedef struct cgen_opcode_data {
- CGEN_HW_ENTRY *hw_list;
- /*CGEN_OPERAND_TABLE *operand_table; - FIXME:wip */
- CGEN_INSN_TABLE *insn_table;
+typedef struct
+{
+ const CGEN_HW_ENTRY * hw_list;
+ /*CGEN_OPERAND_TABLE * operand_table; - FIXME:wip */
+ CGEN_INSN_TABLE * insn_table;
} CGEN_OPCODE_DATA;
/* Each CPU has one of these. */
@@ -562,7 +811,7 @@ extern enum cgen_endian cgen_current_endian;
/* Prototypes of major functions. */
-/* Set the current cpu (+ mach number, endian, etc.). *?
+/* Set the current cpu (+ mach number, endian, etc.). */
void cgen_set_cpu PARAMS ((CGEN_OPCODE_DATA *, int, enum cgen_endian));
/* Initialize the assembler, disassembler. */
@@ -577,28 +826,40 @@ void CGEN_SYM (init_parse) PARAMS ((void));
void CGEN_SYM (init_print) PARAMS ((void));
void CGEN_SYM (init_insert) PARAMS ((void));
void CGEN_SYM (init_extract) PARAMS ((void));
+
+/* FIXME: This prototype is wrong ifndef CGEN_INT_INSN.
+ Furthermore, ifdef CGEN_INT_INSN, the insn is created in
+ target byte order (in which case why use int's at all).
+ Perhaps replace cgen_insn_t * with char *? */
const struct cgen_insn *
-CGEN_SYM (assemble_insn) PARAMS ((const char *, struct cgen_fields *,
+CGEN_SYM (assemble_insn) PARAMS ((const char *, CGEN_FIELDS *,
cgen_insn_t *, char **));
-int CGEN_SYM (insn_supported) PARAMS ((const struct cgen_syntax *));
#if 0 /* old */
+int CGEN_SYM (insn_supported) PARAMS ((const struct cgen_insn *));
int CGEN_SYM (opval_supported) PARAMS ((const struct cgen_opval *));
#endif
-extern const struct cgen_keyword CGEN_SYM (operand_mach);
+extern const CGEN_KEYWORD CGEN_SYM (operand_mach);
int CGEN_SYM (get_mach) PARAMS ((const char *));
+const CGEN_INSN *
+CGEN_SYM (get_insn_operands) PARAMS ((const CGEN_INSN *, cgen_insn_t,
+ int, int *));
+const CGEN_INSN *
+CGEN_SYM (lookup_insn) PARAMS ((const CGEN_INSN *, cgen_insn_t,
+ int, CGEN_FIELDS *, int));
+
CGEN_INLINE void
CGEN_SYM (put_operand) PARAMS ((int, const long *,
- struct cgen_fields *));
+ CGEN_FIELDS *));
CGEN_INLINE long
-CGEN_SYM (get_operand) PARAMS ((int, const struct cgen_fields *));
+CGEN_SYM (get_operand) PARAMS ((int, const CGEN_FIELDS *));
-CGEN_INLINE const char *
-CGEN_SYM (parse_operand) PARAMS ((int, const char **, struct cgen_fields *));
+const char *
+CGEN_SYM (parse_operand) PARAMS ((int, const char **, CGEN_FIELDS *));
-CGEN_INLINE const char *
-CGEN_SYM (validate_operand) PARAMS ((int, const struct cgen_fields *));
+const char *
+CGEN_SYM (insert_operand) PARAMS ((int, CGEN_FIELDS *, char *));
/* Default insn parser, printer. */
extern cgen_parse_fn CGEN_SYM (parse_insn);
@@ -608,79 +869,5 @@ extern cgen_print_fn CGEN_SYM (print_insn);
/* Read in a cpu description file. */
const char * cgen_read_cpu_file PARAMS ((const char *));
-
-/* Assembler interface.
-
- The interface to the assembler is intended to be clean in the sense that
- libopcodes.a is a standalone entity and could be used with any assembler.
- Not that one would necessarily want to do that but rather that it helps
- keep a clean interface. The interface will obviously be slanted towards
- GAS, but at least it's a start.
-
- Parsing is controlled by the assembler which calls
- CGEN_SYM (assemble_insn). If it can parse and build the entire insn
- it doesn't call back to the assembler. If it needs/wants to call back
- to the assembler, (*cgen_parse_operand_fn) is called which can either
-
- - return a number to be inserted in the insn
- - return a "register" value to be inserted
- (the register might not be a register per pe)
- - queue the argument and return a marker saying the expression has been
- queued (eg: a fix-up)
- - return an error message indicating the expression wasn't recognizable
-
- The result is an error message or NULL for success.
- The parsed value is stored in the bfd_vma *. */
-
-/* Values for indicating what the caller wants. */
-enum cgen_parse_operand_type {
- CGEN_PARSE_OPERAND_INIT, CGEN_PARSE_OPERAND_INTEGER,
- CGEN_PARSE_OPERAND_ADDRESS
-};
-
-/* Values for indicating what was parsed.
- ??? Not too useful at present but in time. */
-enum cgen_parse_operand_result {
- CGEN_PARSE_OPERAND_RESULT_NUMBER, CGEN_PARSE_OPERAND_RESULT_REGISTER,
- CGEN_PARSE_OPERAND_RESULT_QUEUED, CGEN_PARSE_OPERAND_RESULT_ERROR
-};
-
-/* Don't require bfd.h unnecessarily. */
-#ifdef BFD_VERSION
-extern const char * (*cgen_parse_operand_fn)
- PARAMS ((enum cgen_parse_operand_type, const char **, int, int,
- enum cgen_parse_operand_result *, bfd_vma *));
-#endif
-
-/* Called before trying to match a table entry with the insn. */
-void cgen_init_parse_operand PARAMS ((void));
-
-/* Called from <cpu>-asm.c to initialize operand parsing. */
-
-/* These are GAS specific. They're not here as part of the interface,
- but rather that we need to put them somewhere. */
-
-/* Call this from md_assemble to initialize the assembler callback. */
-void cgen_asm_init_parse PARAMS ((void));
-
-/* Don't require bfd.h unnecessarily. */
-#ifdef BFD_VERSION
-/* The result is an error message or NULL for success.
- The parsed value is stored in the bfd_vma *. */
-const char *cgen_parse_operand PARAMS ((enum cgen_parse_operand_type,
- const char **, int, int,
- enum cgen_parse_operand_result *,
- bfd_vma *));
-#endif
-
-/* Add a register to the assembler's hash table.
- This makes lets GAS parse registers for us.
- ??? This isn't currently used, but it could be in the future. */
-void cgen_asm_record_register PARAMS ((char *, int));
-
-/* After CGEN_SYM (assemble_insn) is done, this is called to
- output the insn and record any fixups. */
-void cgen_asm_finish_insn PARAMS ((const struct cgen_insn *, cgen_insn_t *,
- unsigned int));
#endif /* CGEN_H */
diff --git a/contrib/binutils/include/opcode/i386.h b/contrib/binutils/include/opcode/i386.h
index c74d2d6..da238c9 100644
--- a/contrib/binutils/include/opcode/i386.h
+++ b/contrib/binutils/include/opcode/i386.h
@@ -1,5 +1,5 @@
/* i386-opcode.h -- Intel 80386 opcode table
- Copyright 1989, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation.
+ Copyright 1989, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation.
This file is part of GAS, the GNU Assembler, and GDB, the GNU Debugger.
@@ -32,7 +32,12 @@ static const template i386_optab[] = {
{ "mov", 2, 0x88, _, DW|Modrm, { Reg, Reg|Mem, 0 } },
{ "mov", 2, 0xb0, _, ShortFormW, { Imm, Reg, 0 } },
{ "mov", 2, 0xc6, _, W|Modrm, { Imm, Reg|Mem, 0 } },
-{ "mov", 2, 0x8c, _, D|Modrm, { SReg3|SReg2, Reg16|Mem, 0 } },
+/* The next instruction accepts WordReg so that `movl %gs,%esi' can be
+ used to move a segment register to a 32 bit register without using
+ a size prefix. This will set the upper 16 bits of the 32 bit
+ register to an implementation defined value (on the Pentium Pro,
+ the implementation defined value is zero). */
+{ "mov", 2, 0x8c, _, D|Modrm, { SReg3|SReg2, WordReg|WordMem, 0 } },
/* move to/from control debug registers */
{ "mov", 2, 0x0f20, _, D|Modrm, { Control, Reg32, 0} },
{ "mov", 2, 0x0f21, _, D|Modrm, { Debug, Reg32, 0} },
@@ -343,17 +348,10 @@ static const template i386_optab[] = {
{"jnle", 1, 0x7f, _, Jump, { Disp, 0, 0} },
{"jg", 1, 0x7f, _, Jump, { Disp, 0, 0} },
-#if 0 /* XXX where are these macros used?
- To get them working again, they need to take
- an entire template as the parameter,
- and check for Data16/Data32 flags. */
-/* these turn into pseudo operations when disp is larger than 8 bits */
#define IS_JUMP_ON_CX_ZERO(o) \
- (o == 0x66e3)
-#define IS_JUMP_ON_ECX_ZERO(o) \
(o == 0xe3)
-#endif
+/* jcxz vs. jecxz is chosen on the basis of the address size prefix. */
{"jcxz", 1, 0xe3, _, JumpByte|Data16, { Disp, 0, 0} },
{"jecxz", 1, 0xe3, _, JumpByte|Data32, { Disp, 0, 0} },
@@ -528,19 +526,19 @@ static const template i386_optab[] = {
/* comparison (without pop) */
{"fcom", 1, 0xd8d0, _, ShortForm, { FloatReg, 0, 0} },
{"fcoms", 1, 0xd8, 2, Modrm, { Mem, 0, 0} }, /* compare %st0, mem float */
-{"ficoml", 1, 0xda, 2, Modrm, { Mem, 0, 0} }, /* compare %st0, mem word */
+{"ficoml", 1, 0xda, 2, Modrm, { Mem, 0, 0} }, /* compare %st0, mem dword */
{"fcoml", 1, 0xdc, 2, Modrm, { Mem, 0, 0} }, /* compare %st0, mem double */
{"fcoml", 1, 0xd8d0, _, ShortForm, { FloatReg, 0, 0} },
-{"ficoms", 1, 0xde, 2, Modrm, { Mem, 0, 0} }, /* compare %st0, mem dword */
+{"ficoms", 1, 0xde, 2, Modrm, { Mem, 0, 0} }, /* compare %st0, mem word */
/* comparison (with pop) */
{"fcomp", 1, 0xd8d8, _, ShortForm, { FloatReg, 0, 0} },
{"fcomp", 0, 0xd8d9, _, NoModrm, {0, 0, 0} }, /* fcomp %st, %st(1) */
{"fcomps", 1, 0xd8, 3, Modrm, { Mem, 0, 0} }, /* compare %st0, mem float */
-{"ficompl", 1, 0xda, 3, Modrm, { Mem, 0, 0} }, /* compare %st0, mem word */
+{"ficompl", 1, 0xda, 3, Modrm, { Mem, 0, 0} }, /* compare %st0, mem dword */
{"fcompl", 1, 0xdc, 3, Modrm, { Mem, 0, 0} }, /* compare %st0, mem double */
{"fcompl", 1, 0xd8d8, _, ShortForm, { FloatReg, 0, 0} },
-{"ficomps", 1, 0xde, 3, Modrm, { Mem, 0, 0} }, /* compare %st0, mem dword */
+{"ficomps", 1, 0xde, 3, Modrm, { Mem, 0, 0} }, /* compare %st0, mem word */
{"fcompp", 0, 0xded9, _, NoModrm, { 0, 0, 0} }, /* compare %st0, %st1 & pop 2 */
/* unordered comparison (with pop) */
@@ -705,36 +703,38 @@ static const template i386_optab[] = {
{"fabs", 0, 0xd9e1, _, NoModrm, { 0, 0, 0} },
/* processor control */
-{"fninit", 0, 0xdbe3, _, NoModrm, { 0, 0, 0} },
-{"finit", 0, 0x9bdbe3, _, NoModrm, { 0, 0, 0} },
-{"fldcw", 1, 0xd9, 5, Modrm, { Mem, 0, 0} },
-{"fnstcw", 1, 0xd9, 7, Modrm, { Mem, 0, 0} },
-{"fstcw", 1, 0x9bd9, 7, Modrm, { Mem, 0, 0} },
-{"fnstsw", 1, 0xdfe0, _, NoModrm, { Acc, 0, 0} },
-{"fnstsw", 1, 0xdd, 7, Modrm, { Mem, 0, 0} },
-{"fnstsw", 0, 0xdfe0, _, NoModrm, { 0, 0, 0} },
-{"fstsw", 1, 0x9bdfe0, _, NoModrm, { Acc, 0, 0} },
-{"fstsw", 1, 0x9bdd, 7, Modrm, { Mem, 0, 0} },
-{"fstsw", 0, 0x9bdfe0, _, NoModrm, { 0, 0, 0} },
-{"fnclex", 0, 0xdbe2, _, NoModrm, { 0, 0, 0} },
-{"fclex", 0, 0x9bdbe2, _, NoModrm, { 0, 0, 0} },
-/*
- We ignore the short format (287) versions of fstenv/fldenv & fsave/frstor
- instructions; i'm not sure how to add them or how they are different.
- My 386/387 book offers no details about this.
-*/
-{"fnstenv", 1, 0xd9, 6, Modrm, { Mem, 0, 0} },
-{"fstenv", 1, 0x9bd9, 6, Modrm, { Mem, 0, 0} },
-{"fldenv", 1, 0xd9, 4, Modrm, { Mem, 0, 0} },
-{"fnsave", 1, 0xdd, 6, Modrm, { Mem, 0, 0} },
-{"fsave", 1, 0x9bdd, 6, Modrm, { Mem, 0, 0} },
-{"frstor", 1, 0xdd, 4, Modrm, { Mem, 0, 0} },
-
-{"ffree", 1, 0xddc0, _, ShortForm, { FloatReg, 0, 0} },
+{"fninit", 0, 0xdbe3, _, NoModrm, { 0, 0, 0} },
+{"finit", 0, 0xdbe3, _, FWait|NoModrm, { 0, 0, 0} },
+{"fldcw", 1, 0xd9, 5, Modrm, { Mem, 0, 0} },
+{"fnstcw", 1, 0xd9, 7, Modrm, { Mem, 0, 0} },
+{"fstcw", 1, 0xd9, 7, FWait|Modrm, { Mem, 0, 0} },
+{"fnstsw", 1, 0xdfe0, _, NoModrm, { Acc, 0, 0} },
+{"fnstsw", 1, 0xdd, 7, Modrm, { Mem, 0, 0} },
+{"fnstsw", 0, 0xdfe0, _, NoModrm, { 0, 0, 0} },
+{"fstsw", 1, 0xdfe0, _, FWait|NoModrm, { Acc, 0, 0} },
+{"fstsw", 1, 0xdd, 7, FWait|Modrm, { Mem, 0, 0} },
+{"fstsw", 0, 0xdfe0, _, FWait|NoModrm, { 0, 0, 0} },
+{"fnclex", 0, 0xdbe2, _, NoModrm, { 0, 0, 0} },
+{"fclex", 0, 0xdbe2, _, FWait|NoModrm, { 0, 0, 0} },
+{"fnstenv",1, 0xd9, 6, Modrm, { Mem, 0, 0} },
+{"fstenv", 1, 0xd9, 6, FWait|Modrm, { Mem, 0, 0} },
+{"fldenv", 1, 0xd9, 4, Modrm, { Mem, 0, 0} },
+{"fnsave", 1, 0xdd, 6, Modrm, { Mem, 0, 0} },
+{"fsave", 1, 0xdd, 6, FWait|Modrm, { Mem, 0, 0} },
+{"frstor", 1, 0xdd, 4, Modrm, { Mem, 0, 0} },
+/* Short forms of fldenv, fstenv use data size prefix. (At least I
+ think so. The PentPro prog ref I have says address size in one
+ place, operand size elsewhere). FIXME: Are these the right names? */
+{"fnstenvs",1, 0xd9, 6, Modrm|Data16, { Mem, 0, 0} },
+{"fstenvs", 1, 0xd9, 6, FWait|Modrm|Data16, { Mem, 0, 0} },
+{"fldenvs", 1, 0xd9, 4, Modrm|Data16, { Mem, 0, 0} },
+
+{"ffree", 1, 0xddc0, _, ShortForm, { FloatReg, 0, 0} },
/* P6:free st(i), pop st */
-{"ffreep", 1, 0xdfc0, _, ShortForm, { FloatReg, 0, 0} },
-{"fnop", 0, 0xd9d0, _, NoModrm, { 0, 0, 0} },
-{"fwait", 0, 0x9b, _, NoModrm, { 0, 0, 0} },
+{"ffreep", 1, 0xdfc0, _, ShortForm, { FloatReg, 0, 0} },
+{"fnop", 0, 0xd9d0, _, NoModrm, { 0, 0, 0} },
+#define FWAIT_OPCODE 0x9b
+{"fwait", 0, 0x9b, _, NoModrm, { 0, 0, 0} },
/*
opcode prefixes; we allow them as seperate insns too
@@ -778,7 +778,7 @@ static const template i386_optab[] = {
/* Pentium Pro extensions */
{"rdpmc", 0, 0x0f33, _, NoModrm, { 0, 0, 0} },
-{"ud2", 0, 0x0fff, _, NoModrm, {0, 0, 0} }, /* official undefined instr. */
+{"ud2", 0, 0x0f0b, _, NoModrm, {0, 0, 0} }, /* official undefined instr. */
{"cmovo", 2, 0x0f40, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} },
{"cmovno", 2, 0x0f41, _, Modrm|ReverseRegRegmem, { WordReg|WordMem, WordReg, 0} },
@@ -828,7 +828,7 @@ static const template i386_optab[] = {
{"paddsw", 2, 0x0fed, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } },
{"paddusb", 2, 0x0fdc, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } },
{"paddusw", 2, 0x0fdd, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } },
-{"pand", 2, 0x0fda, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } },
+{"pand", 2, 0x0fdb, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } },
{"pandn", 2, 0x0fdf, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } },
{"pcmpeqb", 2, 0x0f74, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } },
{"pcmpeqw", 2, 0x0f75, _, Modrm, { RegMMX|WordMem, RegMMX, 0 } },
@@ -950,9 +950,9 @@ static const seg_entry *const two_byte_segment_defaults[] = {
/* mode 0 */
&ds, &ds, &ds, &ds, &ss, &ds, &ds, &ds,
/* mode 1 */
- &ds, &ds, &ds, &ds, &ss, &ds, &ds, &ds,
+ &ds, &ds, &ds, &ds, &ss, &ss, &ds, &ds,
/* mode 2 */
- &ds, &ds, &ds, &ds, &ss, &ds, &ds, &ds,
+ &ds, &ds, &ds, &ds, &ss, &ss, &ds, &ds,
/* mode 3 --- not a memory reference; never referenced */
};
diff --git a/contrib/binutils/include/opcode/tic30.h b/contrib/binutils/include/opcode/tic30.h
new file mode 100644
index 0000000..a700275
--- /dev/null
+++ b/contrib/binutils/include/opcode/tic30.h
@@ -0,0 +1,691 @@
+/* tic30.h -- Header file for TI TMS320C30 opcode table
+ Copyright 1998 Free Software Foundation, Inc.
+ Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
+
+This file is part of GDB, GAS, and the GNU binutils.
+
+GDB, GAS, and the GNU binutils are free software; you can redistribute
+them and/or modify them under the terms of the GNU General Public
+License as published by the Free Software Foundation; either version
+1, or (at your option) any later version.
+
+GDB, GAS, and the GNU binutils are distributed in the hope that they
+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 file; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+/* FIXME: The opcode table should be in opcodes/tic30-opc.c, not in a
+ header file. */
+
+#ifndef _TMS320_H_
+#define _TMS320_H_
+
+struct _register
+{
+ char *name;
+ unsigned char opcode;
+ unsigned char regtype;
+};
+
+typedef struct _register reg;
+
+#define REG_Rn 0x01
+#define REG_ARn 0x02
+#define REG_DP 0x03
+#define REG_OTHER 0x04
+
+static const reg tic30_regtab[] = {
+ { "r0", 0x00, REG_Rn },
+ { "r1", 0x01, REG_Rn },
+ { "r2", 0x02, REG_Rn },
+ { "r3", 0x03, REG_Rn },
+ { "r4", 0x04, REG_Rn },
+ { "r5", 0x05, REG_Rn },
+ { "r6", 0x06, REG_Rn },
+ { "r7", 0x07, REG_Rn },
+ { "ar0",0x08, REG_ARn },
+ { "ar1",0x09, REG_ARn },
+ { "ar2",0x0A, REG_ARn },
+ { "ar3",0x0B, REG_ARn },
+ { "ar4",0x0C, REG_ARn },
+ { "ar5",0x0D, REG_ARn },
+ { "ar6",0x0E, REG_ARn },
+ { "ar7",0x0F, REG_ARn },
+ { "dp", 0x10, REG_DP },
+ { "ir0",0x11, REG_OTHER },
+ { "ir1",0x12, REG_OTHER },
+ { "bk", 0x13, REG_OTHER },
+ { "sp", 0x14, REG_OTHER },
+ { "st", 0x15, REG_OTHER },
+ { "ie", 0x16, REG_OTHER },
+ { "if", 0x17, REG_OTHER },
+ { "iof",0x18, REG_OTHER },
+ { "rs", 0x19, REG_OTHER },
+ { "re", 0x1A, REG_OTHER },
+ { "rc", 0x1B, REG_OTHER },
+ { "R0", 0x00, REG_Rn },
+ { "R1", 0x01, REG_Rn },
+ { "R2", 0x02, REG_Rn },
+ { "R3", 0x03, REG_Rn },
+ { "R4", 0x04, REG_Rn },
+ { "R5", 0x05, REG_Rn },
+ { "R6", 0x06, REG_Rn },
+ { "R7", 0x07, REG_Rn },
+ { "AR0",0x08, REG_ARn },
+ { "AR1",0x09, REG_ARn },
+ { "AR2",0x0A, REG_ARn },
+ { "AR3",0x0B, REG_ARn },
+ { "AR4",0x0C, REG_ARn },
+ { "AR5",0x0D, REG_ARn },
+ { "AR6",0x0E, REG_ARn },
+ { "AR7",0x0F, REG_ARn },
+ { "DP", 0x10, REG_DP },
+ { "IR0",0x11, REG_OTHER },
+ { "IR1",0x12, REG_OTHER },
+ { "BK", 0x13, REG_OTHER },
+ { "SP", 0x14, REG_OTHER },
+ { "ST", 0x15, REG_OTHER },
+ { "IE", 0x16, REG_OTHER },
+ { "IF", 0x17, REG_OTHER },
+ { "IOF",0x18, REG_OTHER },
+ { "RS", 0x19, REG_OTHER },
+ { "RE", 0x1A, REG_OTHER },
+ { "RC", 0x1B, REG_OTHER },
+ { "", 0, 0 }
+};
+
+static const reg *const tic30_regtab_end
+ = tic30_regtab + sizeof(tic30_regtab)/sizeof(tic30_regtab[0]);
+
+/* Indirect Addressing Modes Modification Fields */
+/* Indirect Addressing with Displacement */
+#define PreDisp_Add 0x00
+#define PreDisp_Sub 0x01
+#define PreDisp_Add_Mod 0x02
+#define PreDisp_Sub_Mod 0x03
+#define PostDisp_Add_Mod 0x04
+#define PostDisp_Sub_Mod 0x05
+#define PostDisp_Add_Circ 0x06
+#define PostDisp_Sub_Circ 0x07
+/* Indirect Addressing with Index Register IR0 */
+#define PreIR0_Add 0x08
+#define PreIR0_Sub 0x09
+#define PreIR0_Add_Mod 0x0A
+#define PreIR0_Sub_Mod 0x0B
+#define PostIR0_Add_Mod 0x0C
+#define PostIR0_Sub_Mod 0x0D
+#define PostIR0_Add_Circ 0x0E
+#define PostIR0_Sub_Circ 0x0F
+/* Indirect Addressing with Index Register IR1 */
+#define PreIR1_Add 0x10
+#define PreIR1_Sub 0x11
+#define PreIR1_Add_Mod 0x12
+#define PreIR1_Sub_Mod 0x13
+#define PostIR1_Add_Mod 0x14
+#define PostIR1_Sub_Mod 0x15
+#define PostIR1_Add_Circ 0x16
+#define PostIR1_Sub_Circ 0x17
+/* Indirect Addressing (Special Cases) */
+#define IndirectOnly 0x18
+#define PostIR0_Add_BitRev 0x19
+
+typedef struct {
+ char *syntax;
+ unsigned char modfield;
+ unsigned char displacement;
+} ind_addr_type;
+
+#define IMPLIED_DISP 0x01
+#define DISP_REQUIRED 0x02
+#define NO_DISP 0x03
+
+static const ind_addr_type tic30_indaddr_tab[] = {
+ { "*+ar", PreDisp_Add, IMPLIED_DISP },
+ { "*-ar", PreDisp_Sub, IMPLIED_DISP },
+ { "*++ar", PreDisp_Add_Mod, IMPLIED_DISP },
+ { "*--ar", PreDisp_Sub_Mod, IMPLIED_DISP },
+ { "*ar++", PostDisp_Add_Mod, IMPLIED_DISP },
+ { "*ar--", PostDisp_Sub_Mod, IMPLIED_DISP },
+ { "*ar++%", PostDisp_Add_Circ, IMPLIED_DISP },
+ { "*ar--%", PostDisp_Sub_Circ, IMPLIED_DISP },
+ { "*+ar()", PreDisp_Add, DISP_REQUIRED },
+ { "*-ar()", PreDisp_Sub, DISP_REQUIRED },
+ { "*++ar()", PreDisp_Add_Mod, DISP_REQUIRED },
+ { "*--ar()", PreDisp_Sub_Mod, DISP_REQUIRED },
+ { "*ar++()", PostDisp_Add_Mod, DISP_REQUIRED },
+ { "*ar--()", PostDisp_Sub_Mod, DISP_REQUIRED },
+ { "*ar++()%", PostDisp_Add_Circ, DISP_REQUIRED },
+ { "*ar--()%", PostDisp_Sub_Circ, DISP_REQUIRED },
+ { "*+ar(ir0)", PreIR0_Add, NO_DISP },
+ { "*-ar(ir0)", PreIR0_Sub, NO_DISP },
+ { "*++ar(ir0)", PreIR0_Add_Mod, NO_DISP },
+ { "*--ar(ir0)", PreIR0_Sub_Mod, NO_DISP },
+ { "*ar++(ir0)", PostIR0_Add_Mod, NO_DISP },
+ { "*ar--(ir0)", PostIR0_Sub_Mod, NO_DISP },
+ { "*ar++(ir0)%",PostIR0_Add_Circ, NO_DISP },
+ { "*ar--(ir0)%",PostIR0_Sub_Circ, NO_DISP },
+ { "*+ar(ir1)", PreIR1_Add, NO_DISP },
+ { "*-ar(ir1)", PreIR1_Sub, NO_DISP },
+ { "*++ar(ir1)", PreIR1_Add_Mod, NO_DISP },
+ { "*--ar(ir1)", PreIR1_Sub_Mod, NO_DISP },
+ { "*ar++(ir1)", PostIR1_Add_Mod, NO_DISP },
+ { "*ar--(ir1)", PostIR1_Sub_Mod, NO_DISP },
+ { "*ar++(ir1)%",PostIR1_Add_Circ, NO_DISP },
+ { "*ar--(ir1)%",PostIR1_Sub_Circ, NO_DISP },
+ { "*ar", IndirectOnly, NO_DISP },
+ { "*ar++(ir0)b",PostIR0_Add_BitRev, NO_DISP },
+ { "", 0,0 }
+};
+
+static const ind_addr_type *const tic30_indaddrtab_end
+ = tic30_indaddr_tab + sizeof(tic30_indaddr_tab)/sizeof(tic30_indaddr_tab[0]);
+
+/* Possible operand types */
+/* Register types */
+#define Rn 0x0001
+#define ARn 0x0002
+#define DPReg 0x0004
+#define OtherReg 0x0008
+/* Addressing mode types */
+#define Direct 0x0010
+#define Indirect 0x0020
+#define Imm16 0x0040
+#define Disp 0x0080
+#define Imm24 0x0100
+#define Abs24 0x0200
+/* 3 operand addressing mode types */
+#define op3T1 0x0400
+#define op3T2 0x0800
+/* Interrupt vector */
+#define IVector 0x1000
+/* Not required */
+#define NotReq 0x2000
+
+#define GAddr1 Rn | Direct | Indirect | Imm16
+#define GAddr2 GAddr1 | AllReg
+#define TAddr1 op3T1 | Rn | Indirect
+#define TAddr2 op3T2 | Rn | Indirect
+#define Reg Rn | ARn
+#define AllReg Reg | DPReg | OtherReg
+
+typedef struct _template
+{
+ char *name;
+ unsigned int operands; /* how many operands */
+ unsigned int base_opcode; /* base_opcode is the fundamental opcode byte */
+ /* the bits in opcode_modifier are used to generate the final opcode from
+ the base_opcode. These bits also are used to detect alternate forms of
+ the same instruction */
+ unsigned int opcode_modifier;
+
+ /* opcode_modifier bits: */
+#define AddressMode 0x00600000
+#define PCRel 0x02000000
+#define StackOp 0x001F0000
+#define Rotate StackOp
+
+ /* operand_types[i] describes the type of operand i. This is made
+ by OR'ing together all of the possible type masks. (e.g.
+ 'operand_types[i] = Reg|Imm' specifies that operand i can be
+ either a register or an immediate operand */
+ unsigned int operand_types[3];
+ /* This defines the number type of an immediate argument to an instruction. */
+ int imm_arg_type;
+#define Imm_None 0
+#define Imm_Float 1
+#define Imm_SInt 2
+#define Imm_UInt 3
+}
+template;
+
+static const template tic30_optab[] = {
+ { "absf" ,2,0x00000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "absi" ,2,0x00800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "addc" ,2,0x01000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "addc3" ,3,0x20000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "addf" ,2,0x01800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "addf3" ,3,0x20800000,AddressMode, { TAddr1, TAddr2, Rn }, Imm_None },
+ { "addi" ,2,0x02000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "addi3" ,3,0x21000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "and" ,2,0x02800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt },
+ { "and3" ,3,0x21800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "andn" ,2,0x03000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt },
+ { "andn3" ,3,0x22000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "ash" ,2,0x03800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ash3" ,3,0x22800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "b" ,1,0x68000000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bu" ,1,0x68000000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "blo" ,1,0x68010000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bls" ,1,0x68020000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bhi" ,1,0x68030000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bhs" ,1,0x68040000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "beq" ,1,0x68050000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bne" ,1,0x68060000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "blt" ,1,0x68070000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "ble" ,1,0x68080000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bgt" ,1,0x68090000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bge" ,1,0x680A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bz" ,1,0x68050000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnz" ,1,0x68060000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bp" ,1,0x68090000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bn" ,1,0x68070000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnn" ,1,0x680A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnv" ,1,0x680C0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bv" ,1,0x680D0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnuf" ,1,0x680E0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "buf" ,1,0x680F0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnc" ,1,0x68040000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bc" ,1,0x68010000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnlv" ,1,0x68100000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "blv" ,1,0x68110000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnluf" ,1,0x68120000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bluf" ,1,0x68130000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bzuf" ,1,0x68140000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bd" ,1,0x68200000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bud" ,1,0x68200000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "blod" ,1,0x68210000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "blsd" ,1,0x68220000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bhid" ,1,0x68230000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bhsd" ,1,0x68240000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "beqd" ,1,0x68250000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bned" ,1,0x68260000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bltd" ,1,0x68270000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bled" ,1,0x68280000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bgtd" ,1,0x68290000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bged" ,1,0x682A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bzd" ,1,0x68250000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnzd" ,1,0x68260000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bpd" ,1,0x68290000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnd" ,1,0x68270000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnnd" ,1,0x682A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnvd" ,1,0x682C0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bvd" ,1,0x682D0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnufd" ,1,0x682E0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bufd" ,1,0x682F0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bncd" ,1,0x68240000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bcd" ,1,0x68210000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnlvd" ,1,0x68300000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "blvd" ,1,0x68310000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bnlufd" ,1,0x68320000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "blufd" ,1,0x68330000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "bzufd" ,1,0x68340000,PCRel, { AllReg|Disp, 0, 0 }, Imm_None },
+ { "br" ,1,0x60000000,0, { Imm24, 0, 0 }, Imm_UInt },
+ { "brd" ,1,0x61000000,0, { Imm24, 0, 0 }, Imm_UInt },
+ { "call" ,1,0x62000000,0, { Imm24, 0, 0 }, Imm_UInt },
+ { "callu" ,1,0x70000000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "calllo" ,1,0x70010000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callls" ,1,0x70020000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callhi" ,1,0x70030000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callhs" ,1,0x70040000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "calleq" ,1,0x70050000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callne" ,1,0x70060000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "calllt" ,1,0x70070000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callle" ,1,0x70080000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callgt" ,1,0x70090000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callge" ,1,0x700A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callz" ,1,0x70050000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callnz" ,1,0x70060000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callp" ,1,0x70090000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "calln" ,1,0x70070000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callnn" ,1,0x700A0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callnv" ,1,0x700C0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callv" ,1,0x700D0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callnuf",1,0x700E0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "calluf" ,1,0x700F0000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callnc" ,1,0x70040000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callc" ,1,0x70010000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callnlv",1,0x70100000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "calllv" ,1,0x70110000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callnluf",1,0x70120000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callluf",1,0x70130000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "callzuf",1,0x70140000,PCRel, { AllReg|Disp, 0, 0 }, Imm_UInt },
+ { "cmpf" ,2,0x04000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "cmpf3" ,2,0x23000000,AddressMode, { TAddr1, TAddr2, 0 }, Imm_None },
+ { "cmpi" ,2,0x04800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "cmpi3" ,2,0x23800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, 0 }, Imm_None },
+ { "db" ,2,0x6C000000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbu" ,2,0x6C000000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dblo" ,2,0x6C010000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbls" ,2,0x6C020000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbhi" ,2,0x6C030000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbhs" ,2,0x6C040000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbeq" ,2,0x6C050000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbne" ,2,0x6C060000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dblt" ,2,0x6C070000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dble" ,2,0x6C080000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbgt" ,2,0x6C090000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbge" ,2,0x6C0A0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbz" ,2,0x6C050000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnz" ,2,0x6C060000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbp" ,2,0x6C090000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbn" ,2,0x6C070000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnn" ,2,0x6C0A0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnv" ,2,0x6C0C0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbv" ,2,0x6C0D0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnuf" ,2,0x6C0E0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbuf" ,2,0x6C0F0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnc" ,2,0x6C040000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbc" ,2,0x6C010000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnlv" ,2,0x6C100000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dblv" ,2,0x6C110000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnluf" ,2,0x6C120000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbluf" ,2,0x6C130000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbzuf" ,2,0x6C140000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbd" ,2,0x6C200000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbud" ,2,0x6C200000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dblod" ,2,0x6C210000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dblsd" ,2,0x6C220000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbhid" ,2,0x6C230000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbhsd" ,2,0x6C240000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbeqd" ,2,0x6C250000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbned" ,2,0x6C260000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbltd" ,2,0x6C270000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbled" ,2,0x6C280000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbgtd" ,2,0x6C290000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbged" ,2,0x6C2A0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbzd" ,2,0x6C250000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnzd" ,2,0x6C260000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbpd" ,2,0x6C290000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnd" ,2,0x6C270000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnnd" ,2,0x6C2A0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnvd" ,2,0x6C2C0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbvd" ,2,0x6C2D0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnufd" ,2,0x6C2E0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbufd" ,2,0x6C2F0000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbncd" ,2,0x6C240000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbcd" ,2,0x6C210000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnlvd" ,2,0x6C300000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dblvd" ,2,0x6C310000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbnlufd",2,0x6C320000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dblufd" ,2,0x6C330000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "dbzufd" ,2,0x6C340000,PCRel, { ARn, AllReg|Disp, 0 }, Imm_None },
+ { "fix" ,2,0x05000000,AddressMode, { GAddr1, AllReg, 0 }, Imm_Float },
+ { "float" ,2,0x05800000,AddressMode, { GAddr2, Rn, 0 }, Imm_SInt },
+ { "iack" ,1,0x1B000000,AddressMode, { Direct|Indirect, 0, 0 }, Imm_None },
+ { "idle" ,0,0x06000000,0, { 0, 0, 0 }, Imm_None },
+ { "idle2" ,0,0x06000001,0, { 0, 0, 0 }, Imm_None }, /* LC31 Only */
+ { "lde" ,2,0x06800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldf" ,2,0x07000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfu" ,2,0x40000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldflo" ,2,0x40800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfls" ,2,0x41000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfhi" ,2,0x41800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfhs" ,2,0x42000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfeq" ,2,0x42800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfne" ,2,0x43000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldflt" ,2,0x43800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfle" ,2,0x44000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfgt" ,2,0x44800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfge" ,2,0x45000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfz" ,2,0x42800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfnz" ,2,0x43000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfp" ,2,0x44800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfn" ,2,0x43800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfnn" ,2,0x45000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfnv" ,2,0x46000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfv" ,2,0x46800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfnuf" ,2,0x47000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfuf" ,2,0x47800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfnc" ,2,0x42000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfc" ,2,0x40800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfnlv" ,2,0x48000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldflv" ,2,0x48800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfnluf",2,0x49000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfluf" ,2,0x49800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfzuf" ,2,0x4A000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldfi" ,2,0x07800000,AddressMode, { Direct|Indirect, Rn, 0 }, Imm_None },
+ { "ldi" ,2,0x08000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldiu" ,2,0x50000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldilo" ,2,0x50800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldils" ,2,0x51000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldihi" ,2,0x51800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldihs" ,2,0x52000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldieq" ,2,0x52800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldine" ,2,0x53000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldilt" ,2,0x53800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldile" ,2,0x54000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldigt" ,2,0x54800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldige" ,2,0x55000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldiz" ,2,0x52800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldinz" ,2,0x53000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldip" ,2,0x54800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldin" ,2,0x53800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldinn" ,2,0x55000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldinv" ,2,0x56000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldiv" ,2,0x56800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldinuf" ,2,0x57000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldiuf" ,2,0x57800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldinc" ,2,0x52000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldic" ,2,0x50800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldinlv" ,2,0x58000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldilv" ,2,0x58800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldinluf",2,0x59000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldiluf" ,2,0x59800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldizuf" ,2,0x5A000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "ldii" ,2,0x08800000,AddressMode, { Direct|Indirect, AllReg, 0 }, Imm_None },
+ { "ldm" ,2,0x09000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "ldp" ,2,0x08700000,0, { Abs24|Direct, DPReg|NotReq, 0 }, Imm_UInt },
+ { "lopower",0,0x10800001,0, { 0, 0, 0 }, Imm_None }, /* LC31 Only */
+ { "lsh" ,2,0x09800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt },
+ { "lsh3" ,3,0x24000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "maxspeed",0,0x10800000,0, { 0, 0, 0 }, Imm_None }, /* LC31 Only */
+ { "mpyf" ,2,0x0A000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "mpyf3" ,3,0x24800000,AddressMode, { TAddr1, TAddr2, Rn }, Imm_None },
+ { "mpyi" ,2,0x0A800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "mpyi3" ,3,0x25000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "negb" ,2,0x0B000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "negf" ,2,0x0B800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "negi" ,2,0x0C000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "nop" ,1,0x0C800000,AddressMode, { AllReg|Indirect|NotReq, 0, 0 }, Imm_None },
+ { "norm" ,2,0x0D000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float }, /*Check another source*/
+ { "not" ,2,0x0D800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt },
+ { "or" ,2,0x10000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt },
+ { "or3" ,3,0x25800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "pop" ,1,0x0E200000,StackOp, { AllReg, 0, 0 }, Imm_None },
+ { "popf" ,1,0x0EA00000,StackOp, { Rn, 0, 0 }, Imm_None },
+ { "push" ,1,0x0F200000,StackOp, { AllReg, 0, 0 }, Imm_None },
+ { "pushf" ,1,0x0FA00000,StackOp, { Rn, 0, 0 }, Imm_None },
+ { "reti" ,0,0x78000000,0, { 0, 0, 0 }, Imm_None },
+ { "retiu" ,0,0x78000000,0, { 0, 0, 0 }, Imm_None },
+ { "retilo" ,0,0x78010000,0, { 0, 0, 0 }, Imm_None },
+ { "retils" ,0,0x78020000,0, { 0, 0, 0 }, Imm_None },
+ { "retihi" ,0,0x78030000,0, { 0, 0, 0 }, Imm_None },
+ { "retihs" ,0,0x78040000,0, { 0, 0, 0 }, Imm_None },
+ { "retieq" ,0,0x78050000,0, { 0, 0, 0 }, Imm_None },
+ { "retine" ,0,0x78060000,0, { 0, 0, 0 }, Imm_None },
+ { "retilt" ,0,0x78070000,0, { 0, 0, 0 }, Imm_None },
+ { "retile" ,0,0x78080000,0, { 0, 0, 0 }, Imm_None },
+ { "retigt" ,0,0x78090000,0, { 0, 0, 0 }, Imm_None },
+ { "retige" ,0,0x780A0000,0, { 0, 0, 0 }, Imm_None },
+ { "retiz" ,0,0x78050000,0, { 0, 0, 0 }, Imm_None },
+ { "retinz" ,0,0x78060000,0, { 0, 0, 0 }, Imm_None },
+ { "retip" ,0,0x78090000,0, { 0, 0, 0 }, Imm_None },
+ { "retin" ,0,0x78070000,0, { 0, 0, 0 }, Imm_None },
+ { "retinn" ,0,0x780A0000,0, { 0, 0, 0 }, Imm_None },
+ { "retinv" ,0,0x780C0000,0, { 0, 0, 0 }, Imm_None },
+ { "retiv" ,0,0x780D0000,0, { 0, 0, 0 }, Imm_None },
+ { "retinuf",0,0x780E0000,0, { 0, 0, 0 }, Imm_None },
+ { "retiuf" ,0,0x780F0000,0, { 0, 0, 0 }, Imm_None },
+ { "retinc" ,0,0x78040000,0, { 0, 0, 0 }, Imm_None },
+ { "retic" ,0,0x78010000,0, { 0, 0, 0 }, Imm_None },
+ { "retinlv",0,0x78100000,0, { 0, 0, 0 }, Imm_None },
+ { "retilv" ,0,0x78110000,0, { 0, 0, 0 }, Imm_None },
+ { "retinluf",0,0x78120000,0, { 0, 0, 0 }, Imm_None },
+ { "retiluf",0,0x78130000,0, { 0, 0, 0 }, Imm_None },
+ { "retizuf",0,0x78140000,0, { 0, 0, 0 }, Imm_None },
+ { "rets" ,0,0x78800000,0, { 0, 0, 0 }, Imm_None },
+ { "retsu" ,0,0x78800000,0, { 0, 0, 0 }, Imm_None },
+ { "retslo" ,0,0x78810000,0, { 0, 0, 0 }, Imm_None },
+ { "retsls" ,0,0x78820000,0, { 0, 0, 0 }, Imm_None },
+ { "retshi" ,0,0x78830000,0, { 0, 0, 0 }, Imm_None },
+ { "retshs" ,0,0x78840000,0, { 0, 0, 0 }, Imm_None },
+ { "retseq" ,0,0x78850000,0, { 0, 0, 0 }, Imm_None },
+ { "retsne" ,0,0x78860000,0, { 0, 0, 0 }, Imm_None },
+ { "retslt" ,0,0x78870000,0, { 0, 0, 0 }, Imm_None },
+ { "retsle" ,0,0x78880000,0, { 0, 0, 0 }, Imm_None },
+ { "retsgt" ,0,0x78890000,0, { 0, 0, 0 }, Imm_None },
+ { "retsge" ,0,0x788A0000,0, { 0, 0, 0 }, Imm_None },
+ { "retsz" ,0,0x78850000,0, { 0, 0, 0 }, Imm_None },
+ { "retsnz" ,0,0x78860000,0, { 0, 0, 0 }, Imm_None },
+ { "retsp" ,0,0x78890000,0, { 0, 0, 0 }, Imm_None },
+ { "retsn" ,0,0x78870000,0, { 0, 0, 0 }, Imm_None },
+ { "retsnn" ,0,0x788A0000,0, { 0, 0, 0 }, Imm_None },
+ { "retsnv" ,0,0x788C0000,0, { 0, 0, 0 }, Imm_None },
+ { "retsv" ,0,0x788D0000,0, { 0, 0, 0 }, Imm_None },
+ { "retsnuf",0,0x788E0000,0, { 0, 0, 0 }, Imm_None },
+ { "retsuf" ,0,0x788F0000,0, { 0, 0, 0 }, Imm_None },
+ { "retsnc" ,0,0x78840000,0, { 0, 0, 0 }, Imm_None },
+ { "retsc" ,0,0x78810000,0, { 0, 0, 0 }, Imm_None },
+ { "retsnlv",0,0x78900000,0, { 0, 0, 0 }, Imm_None },
+ { "retslv" ,0,0x78910000,0, { 0, 0, 0 }, Imm_None },
+ { "retsnluf",0,0x78920000,0, { 0, 0, 0 }, Imm_None },
+ { "retsluf",0,0x78930000,0, { 0, 0, 0 }, Imm_None },
+ { "retszuf",0,0x78940000,0, { 0, 0, 0 }, Imm_None },
+ { "rnd" ,2,0x11000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "rol" ,1,0x11E00001,Rotate, { AllReg, 0, 0 }, Imm_None },
+ { "rolc" ,1,0x12600001,Rotate, { AllReg, 0, 0 }, Imm_None },
+ { "ror" ,1,0x12E0FFFF,Rotate, { AllReg, 0, 0 }, Imm_None },
+ { "rorc" ,1,0x1360FFFF,Rotate, { AllReg, 0, 0 }, Imm_None },
+ { "rptb" ,1,0x64000000,0, { Imm24, 0, 0 }, Imm_UInt },
+ { "rpts" ,1,0x139B0000,AddressMode, { GAddr2, 0, 0 }, Imm_UInt },
+ { "sigi" ,0,0x16000000,0, { 0, 0, 0 }, Imm_None },
+ { "stf" ,2,0x14000000,AddressMode, { Rn, Direct|Indirect, 0 }, Imm_Float },
+ { "stfi" ,2,0x14800000,AddressMode, { Rn, Direct|Indirect, 0 }, Imm_Float },
+ { "sti" ,2,0x15000000,AddressMode, { AllReg, Direct|Indirect, 0 }, Imm_SInt },
+ { "stii" ,2,0x15800000,AddressMode, { AllReg, Direct|Indirect, 0 }, Imm_SInt },
+ { "subb" ,2,0x16800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "subb3" ,3,0x26000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "subc" ,2,0x17000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt },
+ { "subf" ,2,0x17800000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "subf3" ,3,0x26800000,AddressMode, { TAddr1, TAddr2, Rn }, Imm_None },
+ { "subi" ,2,0x18000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "subi3" ,3,0x27000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "subrb" ,2,0x18800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "subrf" ,2,0x19000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
+ { "subri" ,2,0x19800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
+ { "swi" ,0,0x66000000,0, { 0, 0, 0 }, Imm_None },
+ { "trap" ,1,0x74800020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapu" ,1,0x74800020,0, { IVector, 0, 0 }, Imm_None },
+ { "traplo" ,1,0x74810020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapls" ,1,0x74820020,0, { IVector, 0, 0 }, Imm_None },
+ { "traphi" ,1,0x74830020,0, { IVector, 0, 0 }, Imm_None },
+ { "traphs" ,1,0x74840020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapeq" ,1,0x74850020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapne" ,1,0x74860020,0, { IVector, 0, 0 }, Imm_None },
+ { "traplt" ,1,0x74870020,0, { IVector, 0, 0 }, Imm_None },
+ { "traple" ,1,0x74880020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapgt" ,1,0x74890020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapge" ,1,0x748A0020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapz" ,1,0x74850020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapnz" ,1,0x74860020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapp" ,1,0x74890020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapn" ,1,0x74870020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapnn" ,1,0x748A0020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapnv" ,1,0x748C0020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapv" ,1,0x748D0020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapnuf",1,0x748E0020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapuf" ,1,0x748F0020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapnc" ,1,0x74840020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapc" ,1,0x74810020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapnlv",1,0x74900020,0, { IVector, 0, 0 }, Imm_None },
+ { "traplv" ,1,0x74910020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapnluf",1,0x74920020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapluf",1,0x74930020,0, { IVector, 0, 0 }, Imm_None },
+ { "trapzuf",1,0x74940020,0, { IVector, 0, 0 }, Imm_None },
+ { "tstb" ,2,0x1A000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt },
+ { "tstb3" ,2,0x27800000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, 0 }, Imm_None },
+ { "xor" ,2,0x1A800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_UInt },
+ { "xor3" ,3,0x28000000,AddressMode, { TAddr1|AllReg, TAddr2|AllReg, AllReg }, Imm_None },
+ { "" ,0,0x00000000,0, { 0, 0, 0 }, 0 }
+};
+
+static const template *const tic30_optab_end =
+ tic30_optab + sizeof(tic30_optab)/sizeof(tic30_optab[0]);
+
+typedef struct {
+ char *name;
+ unsigned int operands_1;
+ unsigned int operands_2;
+ unsigned int base_opcode;
+ unsigned int operand_types[2][3];
+ /* Which operand fits into which part of the final opcode word. */
+ int oporder;
+} partemplate;
+
+/* oporder defines - not very descriptive. */
+#define OO_4op1 0
+#define OO_4op2 1
+#define OO_4op3 2
+#define OO_5op1 3
+#define OO_5op2 4
+#define OO_PField 5
+
+static const partemplate tic30_paroptab[] = {
+ { "q_absf_stf", 2,2,0xC8000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } },
+ OO_4op1 },
+ { "q_absi_sti", 2,2,0xCA000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } },
+ OO_4op1 },
+ { "q_addf3_stf", 3,2,0xCC000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } },
+ OO_5op1 },
+ { "q_addi3_sti", 3,2,0xCE000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } },
+ OO_5op1 },
+ { "q_and3_sti", 3,2,0xD0000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } },
+ OO_5op1 },
+ { "q_ash3_sti", 3,2,0xD2000000, { { Rn, Indirect, Rn }, { Rn, Indirect, 0 } },
+ OO_5op2 },
+ { "q_fix_sti", 2,2,0xD4000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } },
+ OO_4op1 },
+ { "q_float_stf", 2,2,0xD6000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } },
+ OO_4op1 },
+ { "q_ldf_ldf", 2,2,0xC4000000, { { Indirect, Rn, 0 }, { Indirect, Rn, 0 } },
+ OO_4op2 },
+ { "q_ldf_stf", 2,2,0xD8000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } },
+ OO_4op1 },
+ { "q_ldi_ldi", 2,2,0xC6000000, { { Indirect, Rn, 0 }, { Indirect, Rn, 0 } },
+ OO_4op2 },
+ { "q_ldi_sti", 2,2,0xDA000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } },
+ OO_4op1 },
+ { "q_lsh3_sti", 3,2,0xDC000000, { { Rn, Indirect, Rn }, { Rn, Indirect, 0 } },
+ OO_5op2 },
+ { "q_mpyf3_addf3",3,3,0x80000000, { { Rn | Indirect, Rn | Indirect, Rn },
+ { Rn | Indirect, Rn | Indirect, Rn } }, OO_PField },
+ { "q_mpyf3_stf", 3,2,0xDE000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } },
+ OO_5op1 },
+ { "q_mpyf3_subf3",3,3,0x84000000, { { Rn | Indirect, Rn | Indirect, Rn },
+ { Rn | Indirect, Rn | Indirect, Rn } }, OO_PField },
+ { "q_mpyi3_addi3",3,3,0x88000000, { { Rn | Indirect, Rn | Indirect, Rn },
+ { Rn | Indirect, Rn | Indirect, Rn } }, OO_PField },
+ { "q_mpyi3_sti", 3,2,0xE0000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } },
+ OO_5op1 },
+ { "q_mpyi3_subi3",3,3,0x8C000000, { { Rn | Indirect, Rn | Indirect, Rn },
+ { Rn | Indirect, Rn | Indirect, Rn } }, OO_PField },
+ { "q_negf_stf", 2,2,0xE2000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } },
+ OO_4op1 },
+ { "q_negi_sti", 2,2,0xE4000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } },
+ OO_4op1 },
+ { "q_not_sti", 2,2,0xE6000000, { { Indirect, Rn, 0 }, { Rn, Indirect, 0 } },
+ OO_4op1 },
+ { "q_or3_sti", 3,2,0xE8000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } },
+ OO_5op1 },
+ { "q_stf_stf", 2,2,0xC0000000, { { Rn, Indirect, 0 }, { Rn, Indirect, 0 } },
+ OO_4op3 },
+ { "q_sti_sti", 2,2,0xC2000000, { { Rn, Indirect, 0 }, { Rn, Indirect, 0 } },
+ OO_4op3 },
+ { "q_subf3_stf", 3,2,0xEA000000, { { Rn, Indirect, Rn }, { Rn, Indirect, 0 } },
+ OO_5op2 },
+ { "q_subi3_sti", 3,2,0xEC000000, { { Rn, Indirect, Rn }, { Rn, Indirect, 0 } },
+ OO_5op2 },
+ { "q_xor3_sti", 3,2,0xEE000000, { { Indirect, Rn, Rn }, { Rn, Indirect, 0 } },
+ OO_5op1 },
+ { "", 0,0,0x00000000, { { 0, 0, 0 }, { 0, 0, 0 } }, 0 }
+};
+
+static const partemplate *const tic30_paroptab_end =
+ tic30_paroptab + sizeof(tic30_paroptab)/sizeof(tic30_paroptab[0]);
+
+#endif
diff --git a/contrib/binutils/include/opcode/v850.h b/contrib/binutils/include/opcode/v850.h
new file mode 100644
index 0000000..0c10ade
--- /dev/null
+++ b/contrib/binutils/include/opcode/v850.h
@@ -0,0 +1,154 @@
+/* v850.h -- Header file for NEC V850 opcode table
+ Copyright 1996 Free Software Foundation, Inc.
+ Written by J.T. Conklin, Cygnus Support
+
+This file is part of GDB, GAS, and the GNU binutils.
+
+GDB, GAS, and the GNU binutils are free software; you can redistribute
+them and/or modify them under the terms of the GNU General Public
+License as published by the Free Software Foundation; either version
+1, or (at your option) any later version.
+
+GDB, GAS, and the GNU binutils are distributed in the hope that they
+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 file; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef V850_H
+#define V850_H
+
+/* The opcode table is an array of struct v850_opcode. */
+
+struct v850_opcode
+{
+ /* The opcode name. */
+ const char *name;
+
+ /* The opcode itself. Those bits which will be filled in with
+ operands are zeroes. */
+ unsigned long opcode;
+
+ /* The opcode mask. This is used by the disassembler. This is a
+ mask containing ones indicating those bits which must match the
+ opcode field, and zeroes indicating those bits which need not
+ match (and are presumably filled in by operands). */
+ unsigned long mask;
+
+ /* An array of operand codes. Each code is an index into the
+ operand table. They appear in the order which the operands must
+ appear in assembly code, and are terminated by a zero. */
+ unsigned char operands[8];
+
+ /* Which (if any) operand is a memory operand. */
+ unsigned int memop;
+
+ /* Target processor(s). A bit field of processors which support
+ this instruction. Note a bit field is used as some instructions
+ are available on multiple, different processor types, whereas
+ other instructions are only available on one specific type. */
+ unsigned int processors;
+};
+
+/* Values for the processors field in the v850_opcode structure. */
+#define PROCESSOR_V850 (1 << 0) /* Just the V850. */
+#define PROCESSOR_ALL -1 /* Any processor. */
+
+/* The table itself is sorted by major opcode number, and is otherwise
+ in the order in which the disassembler should consider
+ instructions. */
+extern const struct v850_opcode v850_opcodes[];
+extern const int v850_num_opcodes;
+
+
+/* The operands table is an array of struct v850_operand. */
+
+struct v850_operand
+{
+ /* The number of bits in the operand. */
+ /* If this value is -1 then the operand's bits are in a discontinous distribution in the instruction. */
+ int bits;
+
+ /* (bits >= 0): How far the operand is left shifted in the instruction. */
+ /* (bits == -1): Bit mask of the bits in the operand. */
+ int shift;
+
+ /* Insertion function. This is used by the assembler. To insert an
+ operand value into an instruction, check this field.
+
+ If it is NULL, execute
+ i |= (op & ((1 << o->bits) - 1)) << o->shift;
+ (i is the instruction which we are filling in, o is a pointer to
+ this structure, and op is the opcode value; this assumes twos
+ complement arithmetic).
+
+ If this field is not NULL, then simply call it with the
+ instruction and the operand value. It will return the new value
+ of the instruction. If the ERRMSG argument is not NULL, then if
+ the operand value is illegal, *ERRMSG will be set to a warning
+ string (the operand will be inserted in any case). If the
+ operand value is legal, *ERRMSG will be unchanged (most operands
+ can accept any value). */
+ unsigned long (* insert) PARAMS ((unsigned long instruction, long op,
+ const char ** errmsg));
+
+ /* Extraction function. This is used by the disassembler. To
+ extract this operand type from an instruction, check this field.
+
+ If it is NULL, compute
+ op = o->bits == -1 ? ((i) & o->shift) : ((i) >> o->shift) & ((1 << o->bits) - 1);
+ if (o->flags & V850_OPERAND_SIGNED)
+ op = (op << (32 - o->bits)) >> (32 - o->bits);
+ (i is the instruction, o is a pointer to this structure, and op
+ is the result; this assumes twos complement arithmetic).
+
+ If this field is not NULL, then simply call it with the
+ instruction value. It will return the value of the operand. If
+ the INVALID argument is not NULL, *INVALID will be set to
+ non-zero if this operand type can not actually be extracted from
+ this operand (i.e., the instruction does not match). If the
+ operand is valid, *INVALID will not be changed. */
+ unsigned long (* extract) PARAMS ((unsigned long instruction, int * invalid));
+
+ /* One bit syntax flags. */
+ int flags;
+};
+
+/* Elements in the table are retrieved by indexing with values from
+ the operands field of the v850_opcodes table. */
+
+extern const struct v850_operand v850_operands[];
+
+/* Values defined for the flags field of a struct v850_operand. */
+
+/* This operand names a general purpose register */
+#define V850_OPERAND_REG 0x01
+
+/* This operand names a system register */
+#define V850_OPERAND_SRG 0x02
+
+/* This operand names a condition code used in the setf instruction */
+#define V850_OPERAND_CC 0x04
+
+/* This operand takes signed values */
+#define V850_OPERAND_SIGNED 0x08
+
+/* This operand is the ep register. */
+#define V850_OPERAND_EP 0x10
+
+/* This operand is a PC displacement */
+#define V850_OPERAND_DISP 0x20
+
+/* This is a relaxable operand. Only used for D9->D22 branch relaxing
+ right now. We may need others in the future (or maybe handle them like
+ promoted operands on the mn10300?) */
+#define V850_OPERAND_RELAX 0x40
+
+/* The register specified must not be r0 */
+#define V850_NOT_R0 0x80
+
+
+#endif /* V850_H */
diff --git a/contrib/binutils/include/regs/ChangeLog b/contrib/binutils/include/regs/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/contrib/binutils/include/regs/ChangeLog
diff --git a/contrib/binutils/include/remote-sim.h b/contrib/binutils/include/remote-sim.h
index 77685d5..a4480b4 100644
--- a/contrib/binutils/include/remote-sim.h
+++ b/contrib/binutils/include/remote-sim.h
@@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (REMOTE_SIM_H)
#define REMOTE_SIM_H 1
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* This file is used when building stand-alone simulators, so isolate this
file from gdb. */
@@ -32,113 +36,286 @@ typedef unsigned int SIM_ADDR;
typedef CORE_ADDR_TYPE SIM_ADDR;
#endif
+
/* Semi-opaque type used as result of sim_open and passed back to all
other routines. "desc" is short for "descriptor".
It is up to each simulator to define `sim_state'. */
typedef struct sim_state *SIM_DESC;
+
/* Values for `kind' arg to sim_open. */
+
typedef enum {
SIM_OPEN_STANDALONE, /* simulator used standalone (run.c) */
SIM_OPEN_DEBUG /* simulator used by debugger (gdb) */
} SIM_OPEN_KIND;
+
/* Return codes from various functions. */
+
typedef enum {
SIM_RC_FAIL = 0,
- SIM_RC_OK = 1
+ SIM_RC_OK = 1,
+ SIM_RC_UNKNOWN_BREAKPOINT = 2,
+ SIM_RC_INSUFFICIENT_RESOURCES = 3,
+ SIM_RC_DUPLICATE_BREAKPOINT = 4
} SIM_RC;
+
+/* The bfd struct, as an opaque type. */
+
+struct _bfd;
+
+
/* Main simulator entry points. */
-/* Initialize the simulator. This function is called when the simulator
- is selected from the gdb command line.
- KIND specifies how the simulator will be used. Currently there are only
- two kinds: standalone and debug.
- ARGV is passed from the command line and can be used to select whatever
- run time options the simulator provides.
- ARGV is the standard NULL terminated array of pointers, with argv[0]
- being the program name.
- The result is a descriptor that must be passed back to the other sim_foo
- functions. */
-SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, char **argv));
+/* Create a fully initialized simulator instance.
+
+ (This function is called when the simulator is selected from the
+ gdb command line.)
+
+ KIND specifies how the simulator shall be used. Currently there
+ are only two kinds: stand-alone and debug.
+
+ CALLBACK specifies a standard host callback (defined in callback.h).
+
+ ABFD, when non NULL, designates a target program. The program is
+ not loaded.
+
+ ARGV is a standard ARGV pointer such as that passed from the
+ command line. The syntax of the argument list is is assumed to be
+ ``SIM-PROG { SIM-OPTION } [ TARGET-PROGRAM { TARGET-OPTION } ]''.
+ The trailing TARGET-PROGRAM and args are only valid for a
+ stand-alone simulator.
+
+ On success, the result is a non NULL descriptor that shall be
+ passed to the other sim_foo functions. While the simulator
+ configuration can be parameterized by (in decreasing precedence)
+ ARGV's SIM-OPTION, ARGV's TARGET-PROGRAM and the ABFD argument, the
+ successful creation of the simulator shall not dependent on the
+ presence of any of these arguments/options.
+
+ Hardware simulator: The created simulator shall be sufficiently
+ initialized to handle, with out restrictions any client requests
+ (including memory reads/writes, register fetch/stores and a
+ resume).
+
+ Process simulator: that process is not created until a call to
+ sim_create_inferior. FIXME: What should the state of the simulator
+ be? */
+
+SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct _bfd *abfd, char **argv));
-/* Terminate usage of the simulator. This may involve freeing target memory
- and closing any open files and mmap'd areas. You cannot assume sim_kill
- has already been called.
- QUITTING is non-zero if we cannot hang on errors. */
+
+/* Destory a simulator instance.
+
+ QUITTING is non-zero if we cannot hang on errors.
+
+ This may involve freeing target memory and closing any open files
+ and mmap'd areas. You cannot assume sim_kill has already been
+ called. */
void sim_close PARAMS ((SIM_DESC sd, int quitting));
-/* Load program PROG into the simulator.
- Return non-zero if you wish the caller to handle it
- (it is done this way because most simulators can use gr_load_image,
- but defining it as a callback seems awkward). */
-int sim_load PARAMS ((SIM_DESC sd, char *prog, int from_tty));
+/* Load program PROG into the simulators memory.
+
+ If ABFD is non-NULL, the bfd for the file has already been opened.
+ The result is a return code indicating success.
+
+ Hardware simulator: Normally, each program section is written into
+ memory according to that sections LMA using physical (direct)
+ addressing. The exception being systems, such as PPC/CHRP, which
+ support more complicated program loaders. A call to this function
+ should not effect the state of the processor registers. Multiple
+ calls to this function are permitted and have an accumulative
+ effect.
+
+ Process simulator: Calls to this function may be ignored.
+
+ FIXME: Most hardware simulators load the image at the VMA using
+ virtual addressing.
+
+ FIXME: For some hardware targets, before a loaded program can be
+ executed, it requires the manipulation of VM registers and tables.
+ Such manipulation should probably (?) occure in
+ sim_create_inferior. */
+
+SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct _bfd *abfd, int from_tty));
+
/* Prepare to run the simulated program.
- START_ADDRESS is, yes, you guessed it, the start address of the program.
- ARGV and ENV are NULL terminated lists of pointers.
- Gdb will set the start address via sim_store_register as well, but
- standalone versions of existing simulators are not set up to cleanly call
- sim_store_register, so the START_ADDRESS argument is there as a
- workaround. */
-void sim_create_inferior PARAMS ((SIM_DESC sd, SIM_ADDR start_address,
- char **argv, char **env));
+ ABFD, if not NULL, provides initial processor state information.
+ ARGV and ENV, if non NULL, are NULL terminated lists of pointers.
-/* Kill the running program.
- This may involve closing any open files and deleting any mmap'd areas. */
+ Hardware simulator: This function shall initialize the processor
+ registers to a known value. The program counter and possibly stack
+ pointer shall be set using information obtained from ABFD (or
+ hardware reset defaults). ARGV and ENV, dependant on the target
+ ABI, may be written to memory.
-void sim_kill PARAMS ((SIM_DESC sd));
+ Process simulator: After a call to this function, a new process
+ instance shall exist. The TEXT, DATA, BSS and stack regions shall
+ all be initialized, ARGV and ENV shall be written to process
+ address space (according to the applicable ABI) and the program
+ counter and stack pointer set accordingly. */
+
+SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, struct _bfd *abfd, char **argv, char **env));
-/* Read LENGTH bytes of the simulated program's memory and store in BUF.
- Result is number of bytes read, or zero if error. */
+
+/* Fetch LENGTH bytes of the simulated program's memory. Start fetch
+ at virtual address MEM and store in BUF. Result is number of bytes
+ read, or zero if error. */
int sim_read PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length));
-/* Store LENGTH bytes from BUF in the simulated program's memory.
- Result is number of bytes write, or zero if error. */
+
+/* Store LENGTH bytes from BUF into the simulated program's
+ memory. Store bytes starting at virtual address MEM. Result is
+ number of bytes write, or zero if error. */
int sim_write PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length));
-/* Fetch register REGNO and store the raw value in BUF. */
-void sim_fetch_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf));
+/* Fetch register REGNO storing its raw (target endian) value in the
+ LENGTH byte buffer BUF. Return the actual size of the register or
+ zero if REGNO is not applicable.
-/* Store register REGNO from BUF (in raw format). */
+ Legacy implementations ignore LENGTH and always return -1.
-void sim_store_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf));
+ If LENGTH does not match the size of REGNO no data is transfered
+ (the actual register size is still returned). */
-/* Print some interesting information about the simulator.
- VERBOSE is non-zero for the wordy version. */
+int sim_fetch_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf, int length));
-void sim_info PARAMS ((SIM_DESC sd, int verbose));
-/* Fetch why the program stopped.
- SIGRC will contain either the argument to exit() or the signal number. */
+/* Store register REGNO from the raw (target endian) value in BUF.
+ Return the actual size of the register or zero if REGNO is not
+ applicable.
-enum sim_stop { sim_exited, sim_stopped, sim_signalled };
+ Legacy implementations ignore LENGTH and always return -1.
+
+ If LENGTH does not match the size of REGNO no data is transfered
+ (the actual register size is still returned). */
+
+int sim_store_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf, int length));
-void sim_stop_reason PARAMS ((SIM_DESC sd, enum sim_stop *reason, int *sigrc));
-/* Run (or resume) the program. */
+/* Print whatever statistics the simulator has collected.
+
+ VERBOSE is currently unused and must always be zero. */
+
+void sim_info PARAMS ((SIM_DESC sd, int verbose));
+
+
+/* Run (or resume) the simulated program. */
void sim_resume PARAMS ((SIM_DESC sd, int step, int siggnal));
+
+/* Asynchronous request to stop the simulation.
+ A nonzero return indicates that the simulator is able to handle
+ the request */
+
+int sim_stop PARAMS ((SIM_DESC sd));
+
+
+/* Fetch the REASON why the program stopped.
+
+ SIM_EXITED: The program has terminated. SIGRC indicates the target
+ dependant exit status.
+
+ SIM_STOPPED: The program has stopped. SIGRC uses the host's signal
+ numbering as a way of identifying the reaon: program interrupted by
+ user via a sim_stop request (SIGINT); a breakpoint instruction
+ (SIGTRAP); a completed single step (SIGTRAP); an internal error
+ condition (SIGABRT); an illegal instruction (SIGILL); Access to an
+ undefined memory region (SIGSEGV); Mis-aligned memory access
+ (SIGBUS).
+
+ SIM_SIGNALLED: The program has stopped. The simulator has
+ encountered target code that requires the (HOST) signal SIGRC to be
+ delivered to the simulated program. Ex: `kill (getpid (),
+ TARGET_SIGxxx)'. Where TARGET_SIGxxx has been translated into a
+ host signal. FIXME: This is not always possible..
+
+ SIM_RUNNING, SIM_POLLING: The return of one of these values
+ indicates a problem internal to the simulator. */
+
+enum sim_stop { sim_running, sim_polling, sim_exited, sim_stopped, sim_signalled };
+
+void sim_stop_reason PARAMS ((SIM_DESC sd, enum sim_stop *reason, int *sigrc));
+
+
/* Passthru for other commands that the simulator might support.
- If SD is NULL, the command is to be interpreted as refering to
- the global state, however the simulator defines that. */
+ Simulators should be prepared to deal with any combination of NULL
+ or empty CMD. */
void sim_do_command PARAMS ((SIM_DESC sd, char *cmd));
-/* Provide simulator with a standard host_callback_struct.
- If SD is NULL, the command is to be interpreted as refering to
- the global state, however the simulator defines that. */
+/* Call these functions to set and clear breakpoints at ADDR. */
+
+SIM_RC sim_set_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr));
+SIM_RC sim_clear_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr));
+SIM_RC sim_clear_all_breakpoints PARAMS ((SIM_DESC sd));
-void sim_set_callbacks PARAMS ((SIM_DESC sd, struct host_callback_struct *));
+/* These functions are used to enable and disable breakpoints. */
+
+SIM_RC sim_enable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr));
+SIM_RC sim_disable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr));
+SIM_RC sim_enable_all_breakpoints PARAMS ((SIM_DESC sd));
+SIM_RC sim_disable_all_breakpoints PARAMS ((SIM_DESC sd));
+
+
+/* Provide simulator with a default (global) host_callback_struct.
+ THIS PROCEDURE IS DEPRECIATED.
+ GDB and NRUN do not use this interface.
+ This procedure does not take a SIM_DESC argument as it is
+ used before sim_open. */
+
+void sim_set_callbacks PARAMS ((struct host_callback_struct *));
+
+
+/* Set the size of the simulator memory array.
+ THIS PROCEDURE IS DEPRECIATED.
+ GDB and NRUN do not use this interface.
+ This procedure does not take a SIM_DESC argument as it is
+ used before sim_open. */
+
+void sim_size PARAMS ((int i));
+
+
+/* Run a simulation with tracing enabled.
+ THIS PROCEDURE IS DEPRECIATED.
+ GDB and NRUN do not use this interface.
+ This procedure does not take a SIM_DESC argument as it is
+ used before sim_open. */
+
+int sim_trace PARAMS ((SIM_DESC sd));
+
+
+/* Configure the size of the profile buffer.
+ THIS PROCEDURE IS DEPRECIATED.
+ GDB and NRUN do not use this interface.
+ This procedure does not take a SIM_DESC argument as it is
+ used before sim_open. */
+
+void sim_set_profile_size PARAMS ((int n));
+
+
+/* Kill the running program.
+ THIS PROCEDURE IS DEPRECIATED.
+ GDB and NRUN do not use this interface.
+ This procedure will be replaced as part of the introduction of
+ multi-cpu simulators. */
+
+void sim_kill PARAMS ((SIM_DESC sd));
+
+#ifdef __cplusplus
+}
+#endif
#endif /* !defined (REMOTE_SIM_H) */
diff --git a/contrib/binutils/include/symcat.h b/contrib/binutils/include/symcat.h
new file mode 100644
index 0000000..01efada
--- /dev/null
+++ b/contrib/binutils/include/symcat.h
@@ -0,0 +1,40 @@
+/* Symbol concatenation utilities.
+
+ Copyright (C) 1998, Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef SYM_CAT_H
+#define SYM_CAT_H
+
+#if defined (__STDC__) || defined (ALMOST_STDC)
+#define CONCAT2(a,b) a##b
+#define CONCAT3(a,b,c) a##b##c
+#define CONCAT4(a,b,c,d) a##b##c##d
+#define STRINGX(s) #s
+#else
+#define CONCAT2(a,b) a/**/b
+#define CONCAT3(a,b,c) a/**/b/**/c
+#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d
+#define STRINGX(s) "?"
+#endif
+
+#define XCONCAT2(a,b) CONCAT2(a,b)
+#define XCONCAT3(a,b,c) CONCAT3(a,b,c)
+#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d)
+
+#define XSTRING(s) STRINGX(s)
+
+#endif SYM_CAT_H
diff --git a/contrib/binutils/install-sh b/contrib/binutils/install-sh
new file mode 100755
index 0000000..853408c
--- /dev/null
+++ b/contrib/binutils/install-sh
@@ -0,0 +1,287 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+# CYGNUS LOCAL: exeext variable
+exeext=""
+# END CYGNUS LOCAL
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ # CYGNUS LOCAL: -x option
+ -x=*) exeext=`echo $1 | sed 's/-x=//'`
+ shift
+ continue;;
+
+ -x) exeext=".exe"
+ shift
+ continue;;
+ # END CYGNUS LOCAL
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=mkdir
+ fi
+else
+
+# CYGNUS LOCAL noer
+# Win32-based gcc automatically appends .exe to produced executables,
+# whether asked for or not. This breaks installs. The following
+# changes the value of $src to $src.exe if $src is missing
+
+ if [ -f $src ]
+ then
+ true
+ elif [ -f $src.exe ]
+ then
+ echo "install: $src does not exist, trying with .exe appended"
+ src="$src".exe
+ fi
+
+# end CYGNUS LOCAL noer
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+
+ # CYGNUS LOCAL: Use exeext
+ case "`basename $dst`" in
+ *.*) ;;
+ *) dst="$dst$exeext" ;;
+ esac
+ # END CYGNUS LOCAL
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/contrib/binutils/ld/ChangeLog b/contrib/binutils/ld/ChangeLog
index abef050..6baf1f4 100644
--- a/contrib/binutils/ld/ChangeLog
+++ b/contrib/binutils/ld/ChangeLog
@@ -1,11 +1,662 @@
+Mon Apr 27 11:56:21 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set version number to 2.9.1.
+ * configure: Rebuild.
+
+ Based on patch from H.J. Lu <hjl@gnu.org>:
+ * emultempl/elf32.em (global_vercheck_needed): New file static
+ variable.
+ (global_vercheck_failed): New file static variable.
+ (gld${EMULATION_NAME}_after_open): Check for shared libraries
+ twice, once with force set to 0 and once with it set to 1.
+ (gld${EMULATION_NAME}_check_ld_so_conf): Add force parameter.
+ Change all callers.
+ (gld${EMULATION_NAME}_search_needed): Likewise.
+ (gld${EMULATION_NAME}_try_needed): Likewise. If not force, check
+ whether the libraries needs any incompatible versions.
+ (gld${EMULATION_NAME}_vercheck): New static function.
+
+Tue Apr 7 13:35:29 1998 H.J. Lu <hjl@gnu.org>
+
+ * configure.in (TESTBFDLIB): New. Defined and substituted.
+ * Makefile.am (TESTBFDLIB): Changed to @TESTBFDLIB@.
+ * configure, Makefile.in: Rebuild.
+
+Mon Apr 6 15:33:39 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (ld.info): Invoke makeinfo with -I options directly
+ rather than relying on default rule. Don't depend upon
+ bfdsumm.texi.
+ (ld.dvi): Likewise.
+ (bfdsumm.texi): Remove target.
+ (CLEANFILES): Take bfdsumm.texi out of value.
+ * Makefile.in: Rebuild.
+
+Sun Apr 5 13:07:57 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/pe.sc: Use shell variables to avoid depending upon
+ how $ is handled when expanding a shell substitution.
+
+Fri Apr 3 13:31:46 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (MOSTLYCLEANFILES): Add ld.log and ld.sum.
+ (DISTCLEANFILES): Define with site.exp and site.bak.
+ * Makefile.in: Rebuild.
+
+ * Makefile.am (DISTCLEANFILES): Remove.
+ (distclean-local): New target.
+ * Makefile.in: Rebuild.
+
+Mon Mar 30 16:12:48 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set version number to 2.9.
+ * configure: Rebuild.
+
+Sat Mar 28 16:48:19 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (MOSTLYCLEANFILES): Remove tmpdir.
+ (mostlyclean-local): New target to remove tmpdir.
+ * Makefile.in: Rebuild.
+
+ Fix some gcc -Wall warnings:
+ * ldcref.c (output_cref): Add casts to avoid warnings.
+ * ldfile.c (ldfile_add_arch): Likewise.
+ * ldlang.c (lang_leave_overlay_section): Likewise.
+ * lexsup.c (OPTION_COUNT): Likewise.
+ (parse_args): Likewise.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan):
+ Likewise.
+ * emultempl/sunos.em (gld${EMULATION_NAME}_search_dir): Likewise.
+ * ldlang.c (lang_check): Initialize variables to avoid warnings.
+ * ldwrite.c (build_link_order): Likewise.
+ * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Likewise.
+ * emultempl/armcoff.em (gld${EMULATION_NAME}_before_allocation):
+ Remove unused variables.
+
+ * Makefile.am (MOSTLYCLEANFILES): Correct name (was
+ MOSTCLEANFILES).
+ * Makefile.in: Rebuild.
+
+Fri Mar 27 16:39:25 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation): Put
+ ARM code inside ifdef TARGET_IS_armpe.
+
+Wed Mar 25 11:34:13 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Based on patch from H.J. Lu <hjl@gnu.org>:
+ * Makefile.am (LDDISTSTUFF): New variable.
+ (diststuff): New target.
+ * Makefile.in: Rebuild.
+
+ * scripttempl/pe.sc: Only include .idata\$[0-7] in .idata when
+ relocating.
+
+Tue Mar 24 15:59:29 1998 Nick Clifton <nickc@cygnus.com>
+
+ * scripttempl/pe.sc (.text): Add .glue_7 and .glue_7t sections to
+ hold Arm/Thumb stubs.
+
+ * emultempl/pe.em (gld_pe_before_allocation): Call
+ arm_process_before_allocation (for ARM/Thumb targets) in order to
+ gather interworking stb information.
+
+Mon Mar 23 18:54:15 1998 Joel Sherrill <joel@OARcorp.com>
+
+ * configure.tgt: (sh*-*-rtems*): Switched from ELF to COFF.
+
+Fri Mar 20 19:17:13 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4, configure: Rebuild with libtool 1.2.
+
+Thu Mar 19 14:54:45 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * scripttempl/pe.sc: The Cygwin32 library uses a .data$nocopy
+ section to avoid copying certain data on fork. The linker used to
+ include this between __data_start__ and __data_end__, but that
+ breaks building the cygwin32 dll. The fix is to rename the
+ section ".data_cygwin_nocopy" and explictly include it after
+ __data_end__.
+
+Wed Mar 18 09:42:24 1998 Nick Clifton <nickc@cygnus.com>
+
+ * configure.tgt (targ_extra_emuls): Add thumb-pe target.
+
+Sun Mar 8 23:34:14 1998 Stan Cox <scox@equinox.cygnus.com>
+
+ * configure.tgt (sparclite*-*-elf): Added.
+
+Mon Mar 2 19:24:08 1998 Michael Meissner <meissner@cygnus.com>
+
+ * ldlang.c (lang_size_sections): If the default memory region is
+ *default*, see if there is a memory region that could be used.
+
+Mon Feb 23 17:46:51 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/pe.em (sort_sections): Permit the wildcard to include
+ a trailing '*' when sorting grouped sections.
+ * scripttempl/pe.sc: Include grouped sections using NAME\$*. Only
+ include them when relocating.
+
+Wed Feb 18 23:39:46 1998 Richard Henderson <rth@cygnus.com>
+
+ * Makefile.am (install-exec-local): Install properly when ln
+ fails or tooldir == prefix.
+
+Fri Feb 13 15:24:06 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Define.
+ * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e.
+
+Thu Feb 12 14:10:44 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/elf.sc: Align the _end symbol according to the ELF
+ format size. From Gordon W. Ross <gwr@mc.com>.
+
+ NetBSD patches from Gordon W. Ross <gwr@mc.com>:
+ * configure.host (alpha*-*-netbsd*): New host.
+ * configure.tgt (alpha*-*-netbsd*, powerpc-*-netbsd*): New
+ targets.
+
+ * lexsup.c (help): Update bug-gnu-utils address.
+ * ld.texinfo (Bug Reporting): Likewise.
+
+Tue Feb 10 18:05:56 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (lang_size_sections): Warn if some memory regions were
+ defined, but a loadable section is going into the default memory
+ region.
+
+Tue Feb 10 16:17:20 1998 H.J. Lu <hjl@gnu.org>
+
+ * ldlex.l (V_IDENTIFIER): Allow '.' as symbol prefix.
+
+Tue Feb 10 15:09:45 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (Makefile): Add target, for dependencies on
+ configure.host and configure.tgt.
+ * configure.host, configure.tgt: Change -linux* to -linux-gnu*.
+ * Makefile.in: Rebuild.
+
+Mon Feb 9 13:44:40 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * scripttempl/elfd10v.sc (.stack): Move stack to 0x00..7FFE.
+
+ * emulparams/d10velf.sh (READONLY_START_ADDR): Read only section
+ moved to 0x00.....4.
+
+Sat Feb 7 15:41:26 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure, aclocal.m4: Rebuild with new libtool.
+
+Thu Feb 5 12:16:11 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/pe.sc: Remove ${RELOCATING-0} from all sections.
+ From Thomas de Lellis <tdel@wrs.com>.
+
+ * configure, Makefile.in, aclocal.m4: Rebuild with new libtool.
+
+Wed Feb 4 13:02:32 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (ld_new_LDADD): Remove @LEXLIB@.
+ * Makefile.in: Rebuild.
+
+Mon Feb 2 19:34:54 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
+
+ Add tms320c30 support:
+ * configure.tgt (tic30-*-*aout*, tic30-*-*coff*): New targets.
+ * emulparams/tic30aout.sh: New file.
+ * emulparams/tic30coff.sh: New file.
+ * scripttempl/tic30aout.sc: New file.
+ * scripttempl/tic30coff.sc: New file.
+ * Makefile.am (ALL_EMULATIONS): Add etic30aout.o and
+ etic30coff.o.
+ (etic30aout.c, etic30coff.c): New targets.
+ * Makefile.in: Rebuild.
+
+Mon Feb 2 14:10:59 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Correct HOSTING_CRT0 in alpha*-*-linux* case to
+ accept either ld.so or ld-linux.so.
+
+Fri Jan 30 19:16:28 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * Makefile.am ({CC,CXX}_FOR_TARGET): Change program_transform_name
+ to transform.
+ * Makefile.in: Regenerate.
+
+Fri Jan 30 19:15:17 1998 Geoff Keating <geoffk@ozemail.com.au>
+
+ * scripttempl/elfppc.sc: Put .dynsbss in .sbss.
+
+Fri Jan 30 11:43:49 1998 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * Makefile.am (eelf32bsmip.c, eelf32lsmip.c): New targets.
+ * Makefile.in: Rebuild.
+
+Thu Jan 29 16:04:21 1998 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * ldfile.c (slash): Set to backslash if _WIN32 but not
+ __CYGWIN32__.
+ (ldfile_open_file_search): If __MSDOS__ or _WIN32, accept a
+ leading backslash or a leading x: as an absolute path.
+ (ldfile_find_command_file): Use slash rather than / when
+ generating name to try.
+ * lexsup.c (PATH_SEPARATOR): Define.
+ (set_default_dirlist): Use PATH_SEPARATOR rather than ':'.
+
+Wed Jan 28 14:06:30 1998 Richard Henderson <rth@cygnus.com>
+
+ * emulparams/elf64_sparc.sh (ELFSIZE): 64
+ (TEXT_START_ADDR): Round off, since SIZEOF_HEADERS is added later.
+ (DATA_PLT): Needed by v9 abi.
+
+Wed Jan 28 16:37:27 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
+
+ * configure.tgt (i[3456]86-*-mingw32*): New entry.
+
+Wed Jan 28 15:51:58 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/elf.sc: Only include linkonce sections in final
+ sections when relocating.
+
+Wed Jan 28 14:10:01 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld.texinfo (Options): Add a brief description of the types of
+ information included in a link map.
+
+ * ld.texinfo (Options): Mention LDEMULATION in description of -m.
+ (Environment): Mention LDEMULATION.
+
+ * ld.texinfo (Options): Clarify --export-dynamic a bit.
+
+Thu Jan 22 16:07:23 1998 Richard Henderson <rth@cygnus.com>
+
+ * ldlex.l (<SCRIPT>{WILDCHAR}*): Take care for the comments this
+ pattern could match.
+
+Wed Jan 21 22:26:46 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols): When doing
+ a relocateable link, set the image base to 0, and don't define the
+ various symbols.
+ * emulparams/i386pe.sh (RELOCATEABLE_OUTPUT_FORMAT): Define.
+ * scripttempl/pe.sc: Swap the .data and .bss sections so that
+ .data comes first. If doing a relocateable link, use
+ RELOCATEABLE_OUTPUT_FORMAT if it is defined, and start the
+ sections at 0, and don't define any symbols.
+
+ * ldlang.c (lang_memory_default): Correct parenthisization of
+ expression.
+
+Wed Jan 21 21:20:32 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * emultempl/sunos.em: Don't include sys/types.h and sys/stat.h
+ here; they are included already via sysdep.h.
+
+Tue Jan 6 13:40:02 1998 Richard Henderson <rth@cygnus.com>
+
+ * scripttempl/i960.sc: Don't explicitly set .data and .bss start.
+
+Fri Jan 2 20:15:37 1998 Michael Meissner <meissner@cygnus.com>
+
+ * ldgram.y (attributes_opt): Pass region pointer to
+ lang_set_flags, not &region->flags.
+
+ * ldlang.c (lang_memory_default): New function to figure out a
+ default memory region for a section if it was not specified.
+ (lang_memory_region_lookup): Zero flags, not_flags field.
+ (lang_map{,_flags}): Print attribute flags in memory map.
+ (lang_size_sections): Call lang_memory_default to get default
+ memory region.
+ (lang_set_flags): Implement attribute flags for real. Take new
+ argument to give the flags we are to skip for this region.
+
+ * ldlang.h (memory_region_struct): Add not_flags field, make both
+ flags fields flagword type.
+ (lang_output_section_state): Make flags field flagword type.
+ (lang_set_flags): Update prototype to match new calling sequence.
+ (lang_memory_region_default): Add prototype.
+
+Thu Jan 1 18:04:51 1998 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/h8300h.sc: Fix typo.
+ * scripttempl/h8300s.sc: Likewise.
+
+Sun Dec 21 12:51:49 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldexp.c (fold_name): Don't crash if the symbol is defined in a
+ section with no output section, such as a shared library section.
+
+Wed Dec 17 12:14:11 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * lexsup.c (parse_args): Keep track of where we are in the option
+ parsing before calling ldemul_parse_args, so that we don't call it
+ multiple times on the same argument and confuse the getopt
+ internals.
+
+Wed Dec 10 17:40:08 1997 Nick Clifton <nickc@cygnus.com>
+
+ * scripttempl/armcoff.sc: Add glue sections (code taken from Arm
+ branch).
+
+ * emulparams/armcoff.sh (TEMPLATE_NAME): Set to armcoff.
+
+ * emultempl/armcoff.em: New file, imported from Arm branch.
+
+Tue Dec 9 15:28:17 1997 Michael Meissner <meissner@cygnus.com>
+
+ * Makefile.am: Add Oct 23 changes to Makefile.in here.
+
+ * Makefile.{am,in}: (ALL_EMULATIONS): Add ed10velf.o.
+
+
+
+Tue Dec 2 10:14:47 1997 Nick Clifton <nickc@cygnus.com>
+
+ * configure.tgt (targ_extra_emuls): Add support for Thumb target.
+
+Sat Nov 22 15:23:19 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlex.l: Don't define hex_mode. Correct number regexp to not
+ accept hex digits without a leading $ or 0x. Handle leading $
+ correctly. Pass 0 rather than hex_mode to bfd_scan_vma.
+ * ldlex.h (hex_mode): Don't declare.
+
+Thu Nov 13 13:45:00 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.tgt (targ_extra_emuls): Make FreeBSD a i386bsd
+ variant.
+
+Sun Nov 2 14:51:36 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * configure.host (alpha*-*-linux*): Correct HOSTING_CRT0. Set
+ HOSTING_LIBS.
+
+Thu Oct 30 12:25:55 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld.h (args_type): Add warn_mismatch field.
+ * ldmain.c (main): Initialize warn_mismatch field.
+ * lexsup.c (parse_args): Handle --no-warn-mismatch option.
+ * ldlang.c (ignore_bfd_error): New static function.
+ (lang_check): If warn_mismatch is false, don't warn about
+ mismatched input files.
+ * ld.texinfo, ld.1: Document new option.
+
+Thu Oct 23 14:38:18 1997 Nick Clifton <nickc@cygnus.com>
+
+ * scripttempl/v850.sc: Rename linker symbol '_stack' to '__stack'
+ to avoid conflicts with C code which is defining a variable called
+ 'stack'.
+
+Thu Oct 23 00:57:45 1997 Richard Henderson <rth@dot.cygnus.com>
+
+ * Makefile.in (ALL_EMULATIONS): Move eelf64_sparc.o ...
+ (ALL_64_EMULATIONS): ... here.
+ (eelf64_sparc.c): Template should be elf32 not generic.
+ * emulparams/elf64_sparc.sh (TEMPLATE_NAME): New definition.
+
+Thu Oct 23 00:44:20 1997 Richard Henderson <rth@dot.cygnus.com>
+
+ * configure.tgt: Add sparc64-*-linux*.
+ * emulparams/elf64_sparc.sh (GENERATE_SHLIB_SCRIPT, NOP): New.
+
+Wed Oct 22 11:29:25 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/pe.sc: Put .eh_frame in .rdata.
+
+Fri Oct 17 00:00:13 1997 Richard Henderson <rth@cygnus.com>
+
+ * ldlang.c (lang_register_vers_node): Only check globals<=>locals,
+ since we need to be able to export different versions of the same
+ symbol.
+
+Wed Oct 15 14:52:36 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/pe.sc: Put .stab and .stabstr sections at end.
+
+Wed Oct 8 12:37:05 1997 Richard Henderson <rth@cygnus.com>
+
+ * configure.tgt, configure.host: Change alpha-*-* to alpha*-*-*;
+ config.guess now recognizes alphaev5 etc.
+
+Fri Oct 3 14:23:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Don't treat
+ -s and -u as -static and -unix.
+
+Thu Oct 2 18:40:28 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (wild_doit): Rewrite flag handling for clarity. If we
+ are not adding the first input section, and SEC_READONLY is clear
+ on the output section, then don't copy it from the input section.
+ If SEC_READONLY is not set on the input section, then clear it on
+ the output section.
+
+ * configure.tgt (mips*-sgi-irix[56]*): Use elf32bsmip rather than
+ elf32bmip.
+ (mips*el-*-linux*): Change elf32lmip to elf32lsmip and elf32bmip
+ to elf32bsmip.
+ (mips*-*-linux*): Likewise.
+ * emulparams/elf32bsmip.sh: New file; just like elf32bmip.sh, but
+ setting ENTRY to __start.
+ * emulparams/elf32lsmip.sh: New file; just like elf32lmip.sh, but
+ setting ENTRY to __start.
+ * scripttempl/elf.sc: Always set ENTRY to _start if it was not
+ already set.
+
+Wed Oct 1 16:41:00 1997 Nick Clifton <nickc@cygnus.com>
+
+ * emulparams/v850.sh (ROZDATA_START_ADDR, ROSDATA_START_ADDR): New
+ Variables.
+
+ * scripttempl/v850.sc: Move read only areas out of zero and small
+ data sections and into their own sections.
+
+Wed Sep 24 16:59:15 1997 Joel Sherrill <joel@oarcorp.com>
+
+ * configure.tgt (sh*-*-rtems*): New target, like sh-*-elf*.
+
+Wed Sep 24 11:33:14 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ld.texinfo (Section Options): Improve documentation of NOLOAD
+ directive.
+
+ * aclocal.m4: Rebuild with new libtool.
+ * configure: Rebuild.
+
+Mon Sep 22 17:24:06 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (wild_doit): Revert patch of September 3.
+
+Wed Sep 17 16:45:34 1997 Nick Clifton <nickc@cygnus.com>
+
+ * Makefile.am, Makefile.in: Add rule for ev850.c
+ * configure.tgt (targ_extra_emuls): Add v850 target.
+
+Tue Sep 9 07:49:56 1997 Fred Fish <fnf@ninemoons.com>
+
+ * ldlang.c (lang_memory_region_lookup): Remove extraneous
+ initialization of p.
+
+Thu Sep 4 09:03:33 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): In
+ expression produced for -bpT and -bpD options, align to a 32 byte
+ boundary rather than an 8 byte boundary.
+ * scripttempl/aix.sc: Put .tocbss at start of .bss section.
+
+ * ldmisc.h, ldmisc.c, ldcref.c: Rename finfo to lfinfo, to avoid
+ function name conflict with AIX 4.2 unistd.h header file.
+
+Wed Sep 3 15:12:32 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (wild_doit): Clear SEC_HAS_CONTENTS from a
+ noload_section.
+
+Fri Aug 29 00:32:31 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (ld_new_DEPENDENCIES): Remove @LEXLIB@.
+ * Makefile.in: Rebuild.
+
+Thu Aug 28 10:12:10 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.tgt (arc-*-elf*): Recognize.
+ * Makefile.am (ALL_EMULATIONS): Add earcelf.o.
+ * Makefile.in: Regenerate.
+ * emulparams/arcelf.sh: New file.
+
+Wed Aug 20 11:14:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (wildcardp): Don't let a backslash by itself cause a
+ pattern to be treated as a wildcard pattern.
+
+ * ldgram.y (atype): Accept parentheses with no type.
+
+ * ld.texinfo (Section Definition): Clarify use of whitespace.
+ (Section Placement): Likewise.
+
+
+Sat Aug 9 00:42:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (ld.info): Change dependency from
+ $(BFDDIR)/doc/bfdsumm.texi to bfdsumm.texi.
+ (ld.dvi): Likewise.
+ (bfdsumm.texi): New target.
+ (CLEANFILES): Add bfdsumm.texi.
+ * Makefile.in: Rebuild.
+
+ * Makefile.am: New file, based on old Makefile.in.
+ * acinclude.m4: New file, from old aclocal.m4.
+ * configure.in: Call AM_INIT_AUTOMAKE and AM_PROG_LIBTOOL. Remove
+ shared library handling; now handled by libtool. Replace
+ AC_CONFIG_HEADER with AM_CONFIG_HEADER. Call AC_PROG_YACC,
+ AC_PROG_LEX, and AC_DECL_YYTEXT. Call AM_MAINTAINER_MODE,
+ AM_CYGWIN32, and AM_EXEEXT. Don't call CY_CYGWIN32 or CY_EXEEXT.
+ * configure.host: Don't set HLDFLAGS, HLDENV, or RPATH_ENVVAR.
+ * acconfig.h: Mention PACKAGE and VERSION.
+ * stamp-h.in: New file.
+ * ldver.c (ld_program_version): Set ld_program_version from
+ VERSION.
+ * ldgram.y, ldlex.l: Replace VERSION with VERSIONK.
+ * Makefile.in: Now built with automake.
+ * aclocal.m4: Now built with aclocal.
+ * configure, config.in: Rebuild.
+
+Mon Jul 28 19:04:50 1997 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * configure.in: Use CYGWIN and EXEEXT autoconf macro to look for
+ win32 dependencies.
+ * configure: Regenerated with autoconf 2.12.
+ * Makefile.in: Add $(EXEEXT) to executable.
+
+Tue Jul 22 18:50:38 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * emulparams/i386go32.sh (OUTPUT_FORMAT): Set to "coff-go32".
+ (SEGMENT_SIZE): Set to 0x200.
+ * scripttempl/i386go32.sc: Rewrite.
+ * configure.tgt (i[3456]86-*-msdosdjgpp*): New target.
+
+Mon Jul 7 12:39:42 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Manfred Hollstein <manfred@s-direktnet.de>:
+ * configure.host (i[3456]86-*-linux*libc1*): Renamed from
+ i[3456]86-*-linux*.
+ (i[3456]86-*-linux*): New host.
+
+Thu Jun 26 13:54:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/pe.sc: Put .rsrc after .reloc. Put input .rsrc
+ sections in the output .rsrc section.
+
+Wed Jun 25 12:48:41 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * configure.host (m68*-*-linux*libc1*): Renamed from
+ `m68*-*-linux*'.
+ (m68*-*-linux*): New configuration for use with GNU libc 2.
+
+Mon Jun 16 19:18:21 1997 Geoff Keating <geoffk@ozemail.com.au>
+
+ * scripttempl/elfppc.sc: Correct .rela.sdata entries.
+
+ * scripttempl/elfppc.sc: Put the PLT between the small and large
+ BSS segments.
+ * emulparams/elf32ppc.sh (TEXT_START_ADDR): The ABI says `A
+ program base of 0x02000000 is recommended...' because otherwise
+ shared libraries are less efficient. We use 0x01800000 because
+ otherwise it's impossible to branch to location 0, for instance if
+ you have an undefined weak symbol.
+
+Mon Jun 16 12:49:36 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * ldlang.c (lang_place_undefineds): Add \n in einfo call.
+ (lang_size_sections): Likewise.
+ * ldlex.l: Likewise.
+ * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Likewise.
+ * emultempl/mipsecoff.em (gld${EMULATION_NAME}_after_open):
+ Likewise.
+ (check_sections): Likewise.
+ (gld${EMULATION_NAME}_after_allocation): Likewise.
+ * emultempl/pe.em (gld_$${EMULATION_NAME}_before_allocation):
+ Likewise.
+ * mpw-eppcmac.c (gldppcmacos_read_file): Likewise.
+ * mpw-idtmips.c (gldmipsidt_after_open): Likewise.
+ (check_sections): Likewise.
+ (gldmipsidt_after_allocation): Likewise.
+
+ * ldemul.c (ldemul_choose_mode): Remove unused einfo argument.
+
+Fri Jun 6 23:47:42 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/pe.sc: Add zeroes after .idata$3 to mark the end of
+ the import list.
+
+Thu May 29 13:13:22 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Don't
+ crash if an output section has no BFD section.
+
+Fri May 23 15:23:25 1997 Fred Fish <fnf@cygnus.com>
+
+ * lexsup.c (ld_options): Add entry for the new "task-link" option.
+ (parse_args): Handle the "task-link" option.
+ (OPTION_TASK_LINK): Add define.
+
Wed May 21 17:44:15 1997 Ian Lance Taylor <ian@cygnus.com>
* ldmain.c (main): Correct check of fclose return value when
handling --force-exe-suffix.
-Tue May 13 10:43:26 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * ldver.c: Set to "2.8.1".
+Thu May 15 11:35:29 1997 Nick Clifton <nickc@cygnus.com>
+
+ * ldlang.c (lang_check): Add test of the return value from the
+ call to bfd_merge_private_bfd_data().
+
+Mon May 12 23:22:58 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * scripttempl/elfmips.sc: Remove.
+ * scripttempl/elf.sc: Set ENTRY based on target. Permit
+ TEXT_DYNAMIC to control .dynamic segment. Permit
+ SHLIB_TEXT_START_ADDR to set start of shared object. Support
+ INITIAL_READONLY_SECTIONS. Put .stub in .text. Only put
+ .gnu.linkonce.t* in .text when relocating. Support
+ OTHER_TEXT_SECTIONS. Support SHLIB_DATA_ADDR as well as
+ DATA_ADDR. Support OTHER_GOT_SYMBOLS and OTHER_GOT_SECTIONS.
+ * emulparams/elf32b4300.sh (SCRIPT_NAME): Set to elf.
+ (DATA_ADDR): Don't set.
+ (INITIAL_READONLY_SECTIONS): Rename from OTHER_READONLY_SECTIONS.
+ (OTHER_TEXT_SECTIONS): Set.
+ (OTHER_GOT_SECTIONS): Rename from OTHER_READWRITE_SECTIONS.
+ (MACHINE): Set to empty string.
+ * emulparams/elf32l4300.sh: Likewise.
+ * emulparams/elf32ebmip.sh: Likewise.
+ * emulparams/elf32elmip.sh: Likewise.
+ * emulparams/elf32bmip.sh: Likewise. Also:
+ (TEXT_DYNAMIC): Set.
+ * emulparams/elf32lmips.sh: Likewise.
+ * Makefile.in (eelf32bmips.c): Depend upon elf.sc rather than
+ elfmips.sc.
+ (eelf32ebmips.c, eelf32elmips.c, eelf32lmip.c): Likewise.
Mon May 12 11:11:06 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -13,6 +664,10 @@ Mon May 12 11:11:06 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.
byte boundary, instead let the linker use whatever the individual
sections require.
+Fri May 9 17:45:46 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.tgt (i[3456]86-*-gnu*): Don't include Mach support.
+
Tue May 6 13:21:19 1997 Ian Lance Taylor <ian@cygnus.com>
From Sean McNeil <sean@mcneil.com>:
@@ -31,8 +686,25 @@ Wed Apr 30 12:23:21 1997 Manfred Hollstein <manfred@s-direktnet.de>
* scripttempl/m88kbcs.sc (__.initp.end, _etext): Added whitespace
around assignment of current location pointer.
+Thu Apr 17 13:07:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldctor.c (ldctor_build_sets): Make sure the set is aligned
+ appropriately.
+
+Tue Apr 15 13:19:26 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (INSTALL): Set to @INSTALL@.
+ (INSTALL_XFORM, INSTALL_XFORM1): Remove.
+ (install): Depend upon ld.new and installdirs. Use
+ $(program_transform_name) directly, rather than using
+ $(INSTALL_XFORM) and $(INSTALL_XFORM1).
+ (installdirs): New target.
+ (install-info): Run mkinstalldirs.
+
Mon Apr 14 12:06:15 1997 Ian Lance Taylor <ian@cygnus.com>
+ * Makefile.in (INSTALL): Change install.sh to install-sh.
+
From Thomas Graichen <graichen@rzpd.de>:
* configure.in: Use ${CONFIG_SHELL} when running $ac_config_sub.
* configure: Rebuild.
@@ -42,9 +714,21 @@ Fri Apr 4 11:42:41 1997 Ian Lance Taylor <ian@cygnus.com>
* emultempl/pe.em: Include "libiberty.h".
(sort_sections_1): Use xmalloc rather than alloca.
-Thu Apr 3 18:54:20 1997 Ian Lance Taylor <ian@cygnus.com>
+ * ldlex.l: Recognize SQUAD.
+ * ldgram.y (length): Add SQUAD.
+ * ldctor.c (ldctor_build_sets): Use SQUAD for a signed 8 byte
+ reloc.
+ * ldlang.c (print_data_statement): Handle SQUAD.
+ (lang_size_sections, lang_do_assignments): Likewise.
+ * ldexp.c (exp_print_token): Add SQUAD to table.
+ * ldwrite.c (build_link_order): Handle SQUAD.
+ * ld.texinfo (Section Data Expressions): Document SQUAD.
+
+Thu Apr 3 13:19:40 1997 Ian Lance Taylor <ian@cygnus.com>
- * ldver.c (ld_program_version): Set to "2.8".
+ * ldver.c (ld_program_version): Set to 2.8.1.
+
+ * Branched binutils 2.8.
Wed Apr 2 11:55:27 1997 Ian Lance Taylor <ian@cygnus.com>
@@ -321,6 +1005,11 @@ Fri Jan 3 14:04:40 1997 Ian Lance Taylor <ian@cygnus.com>
* ld.texinfo (Operators): Remove '@' from @smallexmple in comment
to avoid confusing texi2roff.
+Fri Jan 3 11:27:02 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * scripttempl/v850.sc (.zdata): Add .zcommon section.
+ (.tdata): Add .tcommon and .tcommon_byte sections.
+
Thu Jan 2 18:14:32 1997 Ian Lance Taylor <ian@cygnus.com>
* configure.tgt (mips*el-*-linux*, mips*-*-linux*): New targets.
@@ -340,10 +1029,24 @@ Tue Dec 31 14:48:30 1996 Ian Lance Taylor <ian@cygnus.com>
size_dynamic_sections.
* ld.texinfo, ld.1: Document --filter/-F and --auxiliary/-f.
+Mon Dec 30 13:55:57 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * scripttempl/v850.sc (.tdata) Add .tbss and .tbyte sections.
+
Wed Dec 18 22:57:35 1996 Stan Shebs <shebs@andros.cygnus.com>
* mpw-make.sed: Use NewFolderRecursive for installation.
+Fri Dec 13 14:08:50 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * scripttempl/v850.sc: Make sure __{e,g}p start relative to the
+ {s,t}data sections. Do not emit any linker generated symbols if
+ -r. Use {TEXT,{Z,S,T}DATA}_START_ADDR variables to initialize
+ where the different sections go. Change some whitespace.
+
+ * emulparams/v850.sh ({TEXT,{Z,S,T}DATA}_START_ADDR): Define
+ appropriately. Remove crud not used anymore.
+
Fri Dec 13 10:19:57 1996 Jeffrey A Law (law@cygnus.com)
* Makefile.in (emn10200.c): Add dependencies.
@@ -378,8 +1081,8 @@ Mon Dec 2 11:43:50 1996 Ian Lance Taylor <ian@cygnus.com>
Wed Nov 27 03:22:05 1996 Jason Merrill <jason@yorick.cygnus.com>
* scripttempl/elf{,mips,ppc}.sc: Add the remaining DWARF sections.
-
* scripttempl/elfd10v.sc: Likewise.
+ * scripttempl/v850.sc: Likewise.
Tue Nov 26 16:58:33 1996 Ian Lance Taylor <ian@cygnus.com>
@@ -413,6 +1116,11 @@ Fri Nov 1 10:01:27 1996 Ian Lance Taylor <ian@cygnus.com>
* scripttempl/m68kcoff.sc: Make sure the etext and __CTOR_LIST__
symbols are correctly aligned.
+Thu Oct 31 09:28:59 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scriptempl/v850.sc (zdata): Handle reszdata, romzdata and
+ romzbss too.
+
Tue Oct 29 12:33:05 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* emulparams/d10velf.sh: Changes needed for D10V-EVA board.
@@ -426,6 +1134,21 @@ Mon Oct 28 15:37:00 1996 Doug Evans <dje@canuck.cygnus.com>
* configure.tgt (sparclet*-*-aout*): Delete, use sparc*-*-aout*.
+Wed Oct 23 16:17:22 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scriptempl/v850.sc (zdata): Fix typo "zrodata" -> "rozdata".
+
+ * scriptempl/v850.sc (zdata): Make sure this stays
+ in lo-memory.
+
+Tue Oct 22 11:36:47 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/v850.sc (__ep): Put it at the start
+ of the tda section.
+
+ * scriptempl/v850.sc: Move all "normal" sections into
+ the external memory region (0x100000 - 0x200000).
+
Mon Oct 21 17:16:59 1996 Michael Meissner <meissner@wogglebug.tiac.net>
* scripttempl/elfd10v.sc: Clone from elf.sc, move .text to
@@ -450,6 +1173,10 @@ Fri Oct 18 15:43:38 1996 Ian Lance Taylor <ian@cygnus.com>
EMULATION_OFILES.
* configure: Rebuild.
+Fri Oct 18 12:58:35 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/v850.sc (__gp, __ep): Define.
+
Thu Oct 17 18:14:07 1996 Ian Lance Taylor <ian@cygnus.com>
* ld.texinfo: Try to consistently use a single or a double dash
@@ -459,6 +1186,20 @@ Thu Oct 17 10:17:20 1996 Doug Evans <dje@canuck.cygnus.com>
* emulparams/m32relf.sh (EMBEDDED): Define.
+Thu Oct 17 10:56:49 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/v850.sc (.zdata): Add this before .text.
+ (.sdata): Also include .rosdata as part of the .sdata.
+ (.tdata): Include this just before .sdata.
+
+ * emulparms/v850.sh (SCRIPT_NAME): Use "v850" not "elf".
+ * scripttempl/v850.sc: Wrap script with a "cat << EOF".
+
+Wed Oct 16 23:10:01 1996 Jeffrey A Law (law@cygnus.com)
+
+ * scripttempl/v850.sc: New linker script for the V850.
+ * Makefile.in: Use it.
+
Thu Oct 10 17:57:00 1996 Ian Lance Taylor <ian@cygnus.com>
* emulparams/elf32b4300.sh: Define _gp in OTHER_GOT_SYMBOLS, not
@@ -575,6 +1316,10 @@ Mon Sep 16 17:55:21 1996 Ian Lance Taylor <ian@cygnus.com>
* scripttempl/armcoff.sc: For -N or -n, don't align .data. From
Chris Hadley <Christopher.Hadley@cl.cam.ac.uk>
+Sun Sep 15 22:09:56 1996 Jeffrey A Law (law@cygnus.com)
+
+ * emulparms/v850.sh: Fix OTHER_RELOCATING_SECTIONS.
+
Sun Sep 15 10:38:16 1996 Mark Alexander <marka@cygnus.com>
* emulparms/d10v.sh: Set OTHER_RELOCATING_SECTIONS to put
@@ -600,6 +1345,19 @@ Wed Sep 4 15:53:43 1996 Ian Lance Taylor <ian@cygnus.com>
* configure.tgt (alpha-*-gnu*): New target. From Fila Kolodny
<fila@ibi.com>.
+Tue Sep 3 00:52:54 1996 Jeffrey A Law (law@cygnus.com)
+
+ * emulparms/v850.sh: Set OTHER_RELOCATING_SECTIONS
+
+Sun Sep 1 21:48:58 1996 Jeffrey A Law (law@cygnus.com)
+
+ * emulparms/v850.sh: Set EMBEDDED.
+
+Fri Aug 30 22:30:30 1996 Jeffrey A Law (law@cygnus.com)
+
+ * emulparms/v850.sh: Entry symbol is "_start", tweak
+ ctor/dtor support.
+
Fri Aug 30 18:32:31 1996 Ian Lance Taylor <ian@cygnus.com>
* configure.tgt (sh-*-elf*): New target.
@@ -640,6 +1398,12 @@ Thu Aug 22 17:10:40 1996 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (HLDENV): New variable.
($(LD_PROG)): Use $(HLDENV).
+Thu Aug 22 16:29:28 1996 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (ev850.c): New target.
+ * configure.tgt (v850-*-*): New target.
+ * emulparams/v850.sh: New file.
+
Thu Aug 22 11:16:02 1996 Stan Shebs <shebs@andros.cygnus.com>
* mpw-make.sed: Add @DASH_C_FLAG@ to compiler edit.
@@ -2992,7 +3756,6 @@ Tue Apr 11 12:02:03 1995 Stan Shebs <shebs@andros.cygnus.com>
* ldlex.l (TRUE_FALSE_ALREADY_DEFINED): If MPW, set this to
prevent redefinition errors.
-
Tue Apr 4 17:55:18 1995 Steve Chamberlain <sac@bang.hack.com>
* ldwrite.c (clone_section): Align clone sections on even
@@ -3081,7 +3844,6 @@ Thu Mar 9 12:21:51 1995 Michael Meissner <meissner@tiktok.cygnus.com>
bfd_merge_private_bfd_data to let the backend do additional
checks.
-
Tue Mar 7 00:53:08 1995 Ian Lance Taylor <ian@cygnus.com>
* ldemul.c (ldemul_choose_mode): If emulation not recognized, list
@@ -3138,7 +3900,6 @@ Fri Feb 17 13:06:47 1995 Michael Meissner <meissner@cygnus.com>
Offset _GLOBAL_OFFSET_TABLE_ 32768 from the start of the GOT area
to double the size of the table.
-
Thu Feb 9 18:29:43 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
* Makefile.in (distclean): Do recursive deletion, since ldscripts
@@ -3272,7 +4033,6 @@ Mon Dec 19 14:02:13 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* ldwrite.c (clone_section, split_sections): New functions.
* lexsup.c (parse_args): Understand new split options.
-
Fri Dec 9 17:22:55 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
* scripttempl/elf.sc: Move .ctors and .dtors from .text segment to
diff --git a/contrib/binutils/ld/Makefile.am b/contrib/binutils/ld/Makefile.am
new file mode 100644
index 0000000..e5be23d
--- /dev/null
+++ b/contrib/binutils/ld/Makefile.am
@@ -0,0 +1,778 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus dejagnu
+
+tooldir = $(exec_prefix)/$(target_alias)
+
+YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
+YFLAGS = -d
+LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
+
+# We put the scripts in the directory $(scriptdir)/ldscripts.
+# We can't put the scripts in $(datadir) because the SEARCH_DIR
+# directives need to be different for native and cross linkers.
+scriptdir = $(tooldir)/lib
+
+EMUL = @EMUL@
+EMULATION_OFILES = @EMULATION_OFILES@
+
+# Search path to override the default search path for -lfoo libraries.
+# If LIB_PATH is empty, the ones in the script (if any) are left alone.
+# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
+# a cross-linker, in which case the default is empty. See genscripts.sh.)
+# Otherwise, they are replaced with the ones given in LIB_PATH,
+# which may have the form: LIB_PATH=/lib:/usr/local/lib
+LIB_PATH =
+
+BASEDIR = $(srcdir)/..
+BFDDIR = $(BASEDIR)/bfd
+INCDIR = $(BASEDIR)/include
+DEP = mkdep
+
+# What version of the manual to build
+DOCVER = gen
+
+#stuff for self hosting (can be overridden in config file).
+HOSTING_CRT0 = @HOSTING_CRT0@
+HOSTING_LIBS = @HOSTING_LIBS@
+HOSTING_EMU = -m $(EMUL)
+
+# Setup the testing framework, if you have one
+EXPECT = `if [ -f $$r/../expect/expect ] ; \
+ then echo $$r/../expect/expect ; \
+ else echo expect ; fi`
+
+RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \
+ then echo $${srcroot}/../dejagnu/runtest ; \
+ else echo runtest ; fi`
+
+RUNTESTFLAGS =
+
+CC_FOR_TARGET = ` \
+ if [ -f $$r/../gcc/xgcc ] ; then \
+ if [ -f $$r/../newlib/Makefile ] ; then \
+ echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
+ else \
+ echo $$r/../gcc/xgcc -B$$r/../gcc/; \
+ fi; \
+ else \
+ if [ "@host@" = "@target@" ] ; then \
+ echo $(CC); \
+ else \
+ echo gcc | sed '$(transform)'; \
+ fi; \
+ fi`
+
+CXX = gcc
+CXX_FOR_TARGET = ` \
+ if [ -f $$r/../gcc/xgcc ] ; then \
+ if [ -f $$r/../newlib/Makefile ] ; then \
+ echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
+ else \
+ echo $$r/../gcc/xgcc -B$$r/../gcc/; \
+ fi; \
+ else \
+ if [ "@host@" = "@target@" ] ; then \
+ echo $(CXX); \
+ else \
+ echo gcc | sed '$(transform)'; \
+ fi; \
+ fi`
+
+noinst_PROGRAMS = ld-new
+info_TEXINFOS = ld.texinfo
+noinst_TEXINFOS = ldint.texinfo
+man_MANS = ld.1
+
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) $(HDEFINES) $(CFLAGS)
+
+BFDLIB = ../bfd/libbfd.la
+LIBIBERTY = ../libiberty/libiberty.a
+
+ALL_EMULATIONS = \
+ ea29k.o \
+ eaixppc.o \
+ eaixrs6.o \
+ ealpha.o \
+ earcelf.o \
+ earmaoutb.o \
+ earmaoutl.o \
+ earmcoff.o \
+ earmpe.o \
+ ecoff_sparc.o \
+ ed10velf.o \
+ edelta68.o \
+ eebmon29k.o \
+ eelf32_sparc.o \
+ eelf32b4300.o \
+ eelf32bmip.o \
+ eelf32ebmip.o \
+ eelf32elmip.o \
+ eelf32l4300.o \
+ eelf32lmip.o \
+ eelf32lppc.o \
+ eelf32ppc.o \
+ eelf_i386.o \
+ egld960.o \
+ egld960coff.o \
+ ego32.o \
+ eh8300.o \
+ eh8300h.o \
+ eh8300s.o \
+ eh8500.o \
+ eh8500b.o \
+ eh8500c.o \
+ eh8500m.o \
+ eh8500s.o \
+ ehp300bsd.o \
+ ehp3hpux.o \
+ ehppaelf.o \
+ ei386aout.o \
+ ei386bsd.o \
+ ei386coff.o \
+ ei386go32.o \
+ ei386linux.o \
+ ei386lynx.o \
+ ei386mach.o \
+ ei386moss.o \
+ ei386msdos.o \
+ ei386nbsd.o \
+ ei386nw.o \
+ ei386pe.o \
+ elnk960.o \
+ em68k4knbsd.o \
+ em68kaout.o \
+ em68kaux.o \
+ em68kcoff.o \
+ em68kelf.o \
+ em68klinux.o \
+ em68klynx.o \
+ em68knbsd.o \
+ em68kpsos.o \
+ em88kbcs.o \
+ emipsbig.o \
+ emipsbsd.o \
+ emipsidt.o \
+ emipsidtl.o \
+ emipslit.o \
+ emipslnews.o \
+ enews.o \
+ ens32knbsd.o \
+ epc532macha.o \
+ eppcmacos.o \
+ eppcnw.o \
+ eppcpe.o \
+ eriscix.o \
+ esa29200.o \
+ esh.o \
+ eshelf.o \
+ eshlelf.o \
+ eshl.o \
+ esparcaout.o \
+ esparclinux.o \
+ esparclynx.o \
+ esparcnbsd.o \
+ est2000.o \
+ esun3.o \
+ esun4.o \
+ etic30aout.o \
+ etic30coff.o \
+ evanilla.o \
+ evax.o \
+ evsta.o \
+ ew65.o \
+ ez8001.o \
+ ez8002.o
+
+ALL_64_EMULATIONS = \
+ eelf64_sparc.o \
+ eelf64alpha.o
+
+CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
+ ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
+ mri.c ldcref.c
+
+HFILES = config.h ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
+ ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
+ ldwrite.h mri.h
+
+GENERATED_CFILES = ldgram.c ldlex.c
+GENERATED_HFILES = ldgram.h ldemul-list.h
+
+OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
+ ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
+ ldfile.o ldcref.o ${EMULATION_OFILES}
+
+STAGESTUFF = *.o ldscripts/* e*.c
+
+ldmain.o: ldmain.c config.status
+ $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' -DTARGET='"@target@"' $(srcdir)/ldmain.c
+
+ldemul-list.h: Makefile
+ (echo "/* This file is automatically generated. DO NOT EDIT! */";\
+ for f in `echo " " ${EMULATION_OFILES} "" \
+ | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
+ echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
+ done;\
+ echo "";\
+ echo "#define EMULATION_LIST \\";\
+ for f in `echo " " ${EMULATION_OFILES} "" \
+ | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
+ echo " &ld_$${f}_emulation, \\"; \
+ done;\
+ echo " 0") >ldemul-tmp.h
+ mv ldemul-tmp.h ldemul-list.h
+
+# These all start with e so 'make clean' can find them.
+
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
+GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
+@TDIRS@
+
+ea29k.c: $(srcdir)/emulparams/a29k.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} a29k "$(tdir_a29k)"
+eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
+ $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} aixppc "$(tdir_aixppc)"
+eaixrs6.c: $(srcdir)/emulparams/aixrs6.sh \
+ $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} aixrs6 "$(tdir_aixrs6)"
+ealpha.c: $(srcdir)/emulparams/alpha.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} alpha "$(tdir_alpha)"
+earcelf.c: $(srcdir)/emulparams/arcelf.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} arcelf "$(tdir_arcelf)"
+earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
+earmaoutl.c: $(srcdir)/emulparams/armaoutl.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armaoutl "$(tdir_armaoutl)"
+earmcoff.c: $(srcdir)/emulparams/armcoff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armcoff "$(tdir_armcoff)"
+earmpe.c: $(srcdir)/emulparams/armpe.sh \
+ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armpe "$(tdir_armpe)"
+ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
+ed10velf.c: $(srcdir)/emulparams/d10velf.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} d10velf "$(tdir_d10v)"
+edelta68.c: $(srcdir)/emulparams/delta68.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} delta68 "$(tdir_delta68)"
+eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ebmon29k "$(tdir_ebmon29k)"
+em32relf.c: $(srcdir)/emulparams/m32relf.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m32relf "$(tdir_m32r)"
+eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
+eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
+eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
+eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
+eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
+eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
+eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
+eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
+eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
+eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
+eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
+eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
+eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
+egld960.c: $(srcdir)/emulparams/gld960.sh \
+ $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} gld960 "$(tdir_gld960)"
+egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
+ $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} gld960coff "$(tdir_gld960coff)"
+ego32.c: $(srcdir)/emulparams/go32.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} go32 "$(tdir_go32)"
+eh8300.c: $(srcdir)/emulparams/h8300.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300 "$(tdir_h8300)"
+eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300h "$(tdir_h8300h)"
+eh8300s.c: $(srcdir)/emulparams/h8300s.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300s "$(tdir_h8300s)"
+eh8500.c: $(srcdir)/emulparams/h8500.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500 "$(tdir_h8500)"
+eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500b "$(tdir_h8500b)"
+eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500c "$(tdir_h8500c)"
+eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500m "$(tdir_h8500m)"
+eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8500s "$(tdir_h8500s)"
+ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} hp300bsd "$(tdir_hp300bsd)"
+ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} hp3hpux "$(tdir_hp3hpux)"
+ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
+ $(srcdir)/emultempl/hppaelf.em $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} hppaelf "$(tdir_hppaelf)"
+ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386aout "$(tdir_i386aout)"
+ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
+ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386coff "$(tdir_i386coff)"
+ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
+ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
+ $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386linux "$(tdir_i386linux)"
+ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386lynx "$(tdir_i386lynx)"
+ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386mach "$(tdir_i386mach)"
+ei386moss.c: $(srcdir)/emulparams/i386moss.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386moss "$(tdir_i386moss)"
+ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386msdos "$(tdir_i386msdos)"
+ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)"
+ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386nw "$(tdir_i386nw)"
+ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
+ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} i386pe "$(tdir_i386pe)"
+elnk960.c: $(srcdir)/emulparams/lnk960.sh \
+ $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
+em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68k4knbsd "$(tdir_m68k4knbsd)"
+em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68kaout "$(tdir_m68kaout)"
+em68kaux.c: $(srcdir)/emulparams/m68kaux.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kaux.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68kaux "$(tdir_m68kaux)"
+em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
+em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
+em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
+ $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68klinux "$(tdir_m68klinux)"
+em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68klynx "$(tdir_m68klynx)"
+em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
+em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/psos.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m68kpsos "$(tdir_m68kpsos)"
+em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
+emipsbig.c: $(srcdir)/emulparams/mipsbig.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} mipsbig
+emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} mipsbsd
+emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
+ $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} mipsidt "$(tdir_mipsidt)"
+emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
+ $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
+emipslit.c: $(srcdir)/emulparams/mipslit.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} mipslit "$(tdir_mipslit)"
+emipslnews.c: $(srcdir)/emulparams/mipslnews.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} mipslnews
+emn10300.c: $(srcdir)/emulparams/mn10300.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} mn10300 "$(tdir_mn10300)"
+emn10200.c: $(srcdir)/emulparams/mn10200.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} mn10200 "$(tdir_mn10200)"
+enews.c: $(srcdir)/emulparams/news.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} news "$(tdir_news)"
+ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)"
+epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)"
+eppcmacos.c: $(srcdir)/emulparams/ppcmacos.sh \
+ $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ppcmacos "$(tdir_ppcmacos)"
+eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ppcnw "$(tdir_ppcnw)"
+eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
+ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ppcpe "$(tdir_ppcpe)"
+eriscix.c: $(srcdir)/emulparams/riscix.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} riscix "$(tdir_riscix)"
+esa29200.c: $(srcdir)/emulparams/sa29200.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sa29200 "$(tdir_sa29200)"
+esh.c: $(srcdir)/emulparams/sh.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sh "$(tdir_sh)"
+eshelf.c: $(srcdir)/emulparams/shelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shelf "$(tdir_shelf)"
+eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shlelf "$(tdir_shlelf)"
+eshl.c: $(srcdir)/emulparams/shl.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shl "$(tdir_shl)"
+esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sparcaout "$(tdir_sparcaout)"
+esparclinux.c: $(srcdir)/emulparams/sparclinux.sh \
+ $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sparclinux "$(tdir_sparclinux)"
+esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sparclynx "$(tdir_sparclynx)"
+esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
+est2000.c: $(srcdir)/emulparams/st2000.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} st2000 "$(tdir_st2000)"
+esun3.c: $(srcdir)/emulparams/sun3.sh \
+ $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sun3 "$(tdir_sun3)"
+esun4.c: $(srcdir)/emulparams/sun4.sh \
+ $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} sun4 "$(tdir_sun4)"
+etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic30aout "$(tdir_tic30aout)"
+etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
+evanilla.c: $(srcdir)/emulparams/vanilla.sh \
+ $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} vanilla "$(tdir_vanilla)"
+evax.c: $(srcdir)/emulparams/vax.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} vax "$(tdir_vax)"
+evsta.c: $(srcdir)/emulparams/vsta.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} vsta "$(tdir_vsta)"
+ev850.c: $(srcdir)/emulparams/v850.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/v850.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} v850 "$(tdir_v850)"
+ew65.c: $(srcdir)/emulparams/w65.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} w65 "$(tdir_w65)"
+ez8001.c: $(srcdir)/emulparams/z8001.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} z8001 "$(tdir_z8001)"
+ez8002.c: $(srcdir)/emulparams/z8002.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} z8002 "$(tdir_z8002)"
+
+ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
+ ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
+ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(BFDLIB) $(LIBIBERTY)
+ld_new_LDADD = $(EMULATION_OFILES) $(BFDLIB) $(LIBIBERTY)
+
+# The generated emulation files mostly have the same dependencies.
+$(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
+ ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
+ ldctor.h ldexp.h ldlang.h ldgram.h
+
+# This is the real libbfd.a created by libtool.
+TESTBFDLIB = @TESTBFDLIB@
+
+check-DEJAGNU: site.exp
+ srcroot=`cd $(srcdir) && pwd`; export srcroot; \
+ r=`pwd`; export r; \
+ EXPECT=$(EXPECT); export EXPECT; \
+ if [ -f $(top_builddir)/../expect/expect ]; then \
+ TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
+ export TCL_LIBRARY; \
+ fi; \
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
+ CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
+ CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
+ CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
+ OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
+ LIBIBERTY="$(LIBIBERTY)" HOSTING_EMU="$(HOSTING_EMU)" \
+ HOSTING_CRT0="$(HOSTING_CRT0)" HOSTING_LIBS="$(HOSTING_LIBS)" \
+ $(RUNTESTFLAGS); \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi
+
+# Rules for testing by relinking ld itself.
+# A similar test is in the testsuite. This target is for ease of use
+# when porting ld.
+
+ld-partial.o: ld-new$(EXEEXT)
+ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
+ld1$(EXEEXT): ld-partial.o
+ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.o $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
+
+ld1-full$(EXEEXT): ld-new
+ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
+
+ld2$(EXEEXT): ld1$(EXEEXT)
+ ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
+
+ld3$(EXEEXT): ld2$(EXEEXT)
+ ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
+
+bootstrap: ld3$(EXEEXT)
+ cmp ld2$(EXEEXT) ld3$(EXEEXT)
+
+.PHONY: bootstrap
+
+# A test program for C++ constructors and destructors.
+# This test is now in the testsuite.
+#
+#cdtest: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
+# ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
+# cdtest-main.o cdtest-bar.o cdtest-foo.o $(HOSTING_LIBS)
+#
+#cdtest.out: cdtest
+# ./cdtest > cdtest.tmp
+# mv cdtest.tmp cdtest.out
+#
+#cdtest-ur.o: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
+# ./ld.new $(HOSTING_EMU) -o cdtest-ur.o -Ur cdtest-main.o \
+# cdtest-bar.o cdtest-foo.o
+#
+#cdtest-ur: cdtest-ur.o
+# ./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.o \
+# $(HOSTING_LIBS)
+#
+#cdtest-ur.out: cdtest-ur
+# ./cdtest-ur > cdtest-ur.tmp
+# mv cdtest-ur.tmp cdtest-ur.out
+#
+#check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
+# diff $(srcdir)/cdtest.exp cdtest.out
+# diff $(srcdir)/cdtest.exp cdtest-ur.out
+#
+#.PHONY: check-cdtest
+
+# END OF CHECK TARGETS
+
+# DOCUMENTATION TARGETS
+# Manual configuration file; not usually attached to normal configuration,
+# because almost all configs use "gen" version of manual.
+# Set DOCVER above to change.
+configdoc.texi: ${DOCVER}-doc.texi
+ ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \
+ || ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \
+ || cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
+
+ld.info: $(srcdir)/ld.texinfo configdoc.texi
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo
+
+ld.dvi: $(srcdir)/ld.texinfo configdoc.texi
+ TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc' $(TEXI2DVI) $(srcdir)/ld.texinfo
+
+# We want to reconfigure if configure.host or configure.tgt changes.
+Makefile: configure.host configure.tgt
+
+MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
+ ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
+mostlyclean-local:
+ -rm -rf tmpdir
+CLEANFILES = dep.sed .dep .dep1
+
+.PHONY: install-exec-local install-data-local
+
+install-exec-local: ld-new$(EXEEXT)
+ $(mkinstalldirs) $(bindir) $(tooldir)/bin
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`"; \
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/-new//'|sed '$(transform)'`; \
+ else :; fi; \
+ done
+ rm -f $(tooldir)/bin/ld$(EXEEXT)
+ n=`echo ld | sed '$(transform)'`; \
+ if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \
+ ln $(bindir)/$$n$(EXEEXT) $(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
+ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(tooldir)/bin/ld$(EXEEXT); \
+ fi
+
+install-data-local:
+ $(mkinstalldirs) $(scriptdir)
+ for f in ldscripts/*; do \
+ $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
+ done
+
+# Stuff that should be included in a distribution. The diststuff
+# target is run by the taz target in ../Makefile.in.
+LDDISTSTUFF = ldgram.c ldgram.h ldlex.c
+diststuff: $(LDDISTSTUFF) info
+
+DISTCLEANFILES = site.exp site.bak
+
+distclean-local:
+ rm -rf ldscripts
+
+# Targets to rebuild dependencies in this Makefile.
+# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
+.dep: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
+ rm -f .dep1
+ $(MAKE) DEP=$(DEP) .dep1
+ sed -f dep.sed <.dep1 >.dep
+
+# This rule really wants a mkdep that runs "gcc -MM".
+.dep1: $(CFILES) $(GENERATED_CFILES)
+ rm -f .dep2
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
+ $(DEP) -f .dep2 $(INCLUDES) $?
+ $(srcdir)/../move-if-change .dep2 .dep1
+
+dep.sed: dep-in.sed config.status
+ sed <$(srcdir)/dep-in.sed >dep.sed \
+ -e 's!@INCDIR@!$(INCDIR)!' \
+ -e 's!@SRCDIR@!$(srcdir)!'
+
+dep: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
+ cat .dep >> tmp-Makefile
+ $(srcdir)/../move-if-change tmp-Makefile Makefile
+
+dep-in: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
+ cat .dep >> tmp-Makefile.in
+ $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
+
+dep-am: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
+ cat .dep >> tmp-Makefile.am
+ $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
+
+.PHONY: dep dep-in dep-am
+
+# What appears below is generated by a hacked mkdep using gcc -MM.
+
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+
+ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
+ ld.h ldexp.h ldlang.h ldmisc.h ldgram.h ldmain.h ldctor.h
+ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h ld.h ldemul.h \
+ ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldemul-list.h
+ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
+ ld.h ldmain.h ldmisc.h ldexp.h ldgram.h ldlang.h
+ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
+ ld.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h \
+ ldlex.h ldemul.h
+ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/obstack.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
+ ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h ldmisc.h \
+ ldctor.h ldfile.h $(INCDIR)/fnmatch.h
+ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/progress.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
+ ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h ldemul.h \
+ ldlex.h ldfile.h ldctor.h
+ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/demangle.h ld.h ldmisc.h ldexp.h ldlang.h \
+ ldgram.h ldlex.h ldmain.h ldfile.h
+ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h ld.h ldver.h \
+ ldemul.h ldmain.h
+ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/libiberty.h ld.h ldexp.h ldlang.h ldwrite.h \
+ ldmisc.h ldgram.h ldmain.h
+lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/getopt.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
+ ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \
+ ldver.h ldemul.h
+mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h sysdep.h \
+ config.h $(INCDIR)/fopen-same.h ld.h ldexp.h ldlang.h \
+ ldmisc.h mri.h ldgram.h $(INCDIR)/libiberty.h
+ldcref.o: ldcref.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/libiberty.h ld.h ldmain.h ldmisc.h ldexp.h \
+ ldlang.h
+ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
+ ld.h ldexp.h ldver.h ldlang.h ldemul.h ldfile.h ldmisc.h \
+ ldmain.h mri.h ldlex.h
+ldlex.o: ldlex.c ../bfd/bfd.h sysdep.h config.h $(INCDIR)/fopen-same.h \
+ ld.h ldgram.h ldmisc.h ldexp.h ldlang.h ldfile.h ldlex.h \
+ ldmain.h
+
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/contrib/binutils/ld/NEWS b/contrib/binutils/ld/NEWS
index b2449c4..ba32596 100644
--- a/contrib/binutils/ld/NEWS
+++ b/contrib/binutils/ld/NEWS
@@ -1,5 +1,14 @@
-*- text -*-
+Changes in version 2.9:
+
+* Added SQUAD to the linker script language.
+
+* New option --no-warn-mismatch.
+
+* The MEMORY command now parses the attributes to determine where sections that
+are not placed in a specific memory region are placed.
+
Changes in version 2.8:
* Linker scripts may now contain shell wildcard characters for file and section
diff --git a/contrib/binutils/ld/README b/contrib/binutils/ld/README
index 4efa989..8947d04 100644
--- a/contrib/binutils/ld/README
+++ b/contrib/binutils/ld/README
@@ -1,21 +1,20 @@
-This is a BETA release of a completely rewritten GNU linker.
-It is distributed with other "binary utilities" which should
-be in ../binutils. See ../binutils/README for more general notes,
-including where to send bug reports.
+This is the GNU linker. It is distributed with other "binary
+utilities" which should be in ../binutils. See ../binutils/README for
+more general notes, including where to send bug reports.
-There are many new features of the linker:
+There are many features of the linker:
* The linker uses a Binary File Descriptor library (../bfd)
that it uses to read and write object files. This helps
insulate the linker itself from the format of object files.
-* The linker support a number of different object file
+* The linker supports a number of different object file
formats. It can even handle multiple formats at once:
Read two input formats and write a third.
* The linker can be configured for cross-linking.
-* The linker contains a control language.
+* The linker supports a control language.
* There is a user manual (ld.texinfo), as well as the
beginnings of an internals manual (ldint.texinfo).
@@ -29,7 +28,8 @@ If you want to make a cross-linker, you may want to specify
a different search path of -lfoo libraries than the default.
You can do this by setting the LIB_PATH variable in ./Makefile.
-To build just the linker, make the target all-ld.
+To build just the linker, make the target all-ld from the top level
+directory (one directory above this one).
Porting to a new target
=======================
@@ -38,11 +38,21 @@ See the ldint.texinfo manual.
Reporting bugs etc
===========================
+
See ../binutils/README.
Known problems
==============
+The Solaris linker normally exports all dynamic symbols from an
+executable. The GNU linker does not do this by default. This is
+because the GNU linker tries to present the same interface for all
+similar targets (in this case, all native ELF targets). This does not
+matter for normal programs, but it can make a difference for programs
+which try to dlopen an executable, such as PERL or Tcl. You can make
+the GNU linker export all dynamic symbols with the -E or
+--export-dynamic command line option.
+
HP/UX 9.01 has a shell bug that causes the linker scripts to be
generated incorrectly. The symptom of this appears to be "fatal error
- scanner input buffer overflow" error messages. There are various
diff --git a/contrib/binutils/ld/acconfig.h b/contrib/binutils/ld/acconfig.h
index 6034cad..c627d7f 100644
--- a/contrib/binutils/ld/acconfig.h
+++ b/contrib/binutils/ld/acconfig.h
@@ -1,4 +1,10 @@
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
+
/* Whether strstr must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSTR
diff --git a/contrib/binutils/ld/acinclude.m4 b/contrib/binutils/ld/acinclude.m4
new file mode 100644
index 0000000..71b09b9
--- /dev/null
+++ b/contrib/binutils/ld/acinclude.m4
@@ -0,0 +1 @@
+sinclude(../bfd/acinclude.m4)
diff --git a/contrib/binutils/ld/aclocal.m4 b/contrib/binutils/ld/aclocal.m4
index 7adc004..cbf8bd1 100644
--- a/contrib/binutils/ld/aclocal.m4
+++ b/contrib/binutils/ld/aclocal.m4
@@ -1 +1,460 @@
-sinclude(../bfd/aclocal.m4)
+dnl aclocal.m4 generated automatically by aclocal 1.2e
+
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+sinclude(../bfd/acinclude.m4)
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AM_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+
+# serial 1
+
+AC_DEFUN(AM_PROG_INSTALL,
+[AC_REQUIRE([AC_PROG_INSTALL])
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+AC_SUBST(INSTALL_SCRIPT)dnl
+])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+
+# serial 24 AM_PROG_LIBTOOL
+AC_DEFUN(AM_PROG_LIBTOOL,
+[AC_REQUIRE([AM_ENABLE_SHARED])dnl
+AC_REQUIRE([AM_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_RANLIB])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AM_PROG_LD])dnl
+AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+dnl
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+])
+
+# AM_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_SHARED,
+[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
+changequote([, ])dnl
+[ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AM_DISABLE_SHARED,
+[AM_ENABLE_SHARED(no)])
+
+# AM_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AM_DISABLE_STATIC,
+[AM_ENABLE_STATIC(no)])
+
+# AM_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_STATIC,
+[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
+changequote([, ])dnl
+[ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+])
+
+
+# AM_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AM_PROG_LD,
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+changequote(,)dnl
+ /* | [A-Za-z]:\\*)
+changequote([,])dnl
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(ac_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_SUBST(LD)
+AM_PROG_LD_GNU
+])
+
+AC_DEFUN(AM_PROG_LD_GNU,
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi])
+])
+
+# AM_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AM_PROG_NM,
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(ac_cv_path_NM,
+[case "$NM" in
+changequote(,)dnl
+/* | [A-Za-z]:\\*)
+changequote([,])dnl
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac])
+NM="$ac_cv_path_NM"
+AC_MSG_RESULT([$NM])
+AC_SUBST(NM)
+])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+# Check to see if we're running under Cygwin32, without using
+# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_CYGWIN32()
+AC_DEFUN(AM_CYGWIN32,
+[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
+[AC_TRY_COMPILE(,[return __CYGWIN32__;],
+am_cv_cygwin32=yes, am_cv_cygwin32=no)
+rm -f conftest*])
+CYGWIN32=
+test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
+
+# Check to see if we're running under Win32, without using
+# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
+# Otherwise set it to "".
+
+dnl AM_EXEEXT()
+dnl This knows we add .exe if we're building in the Cygwin32
+dnl environment. But if we're not, then it compiles a test program
+dnl to see if there is a suffix for executables.
+AC_DEFUN(AM_EXEEXT,
+[AC_REQUIRE([AM_CYGWIN32])
+AC_REQUIRE([AM_MINGW32])
+AC_MSG_CHECKING([for executable suffix])
+AC_CACHE_VAL(am_cv_exeext,
+[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*])
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+AC_MSG_RESULT(${am_cv_exeext})
+AC_SUBST(EXEEXT)])
+
+# Check to see if we're running under Mingw, without using
+# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_MINGW32()
+AC_DEFUN(AM_MINGW32,
+[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
+[AC_TRY_COMPILE(,[return __MINGW32__;],
+am_cv_mingw32=yes, am_cv_mingw32=no)
+rm -f conftest*])
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT($USE_MAINTAINER_MODE)
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+ AC_SUBST(MAINT)dnl
+]
+)
+
diff --git a/contrib/binutils/ld/config.in b/contrib/binutils/ld/config.in
index 4313165..a9de5b8 100644
--- a/contrib/binutils/ld/config.in
+++ b/contrib/binutils/ld/config.in
@@ -1,5 +1,11 @@
/* config.in. Generated automatically from configure.in by autoheader. */
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
+
/* Whether strstr must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSTR
@@ -12,6 +18,9 @@
/* Whether getenv must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_GETENV
+/* Define if lex declares yytext as a char * by default, not a char[]. */
+#undef YYTEXT_POINTER
+
/* Do we need to use the b modifier when opening binary files? */
#undef USE_BINARY_FOPEN
diff --git a/contrib/binutils/ld/configure b/contrib/binutils/ld/configure
index f0d151e..d15e3d2 100755
--- a/contrib/binutils/ld/configure
+++ b/contrib/binutils/ld/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
+# Generated automatically using autoconf version 2.12.1
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -12,11 +12,22 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
- --enable-targets alternative target configurations"
+ --enable-shared build shared libraries [default=yes]
+ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list"
+ac_help="$ac_help
+ --enable-static build static libraries [default=yes]
+ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list"
ac_help="$ac_help
- --enable-shared build shared BFD library"
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
+ac_help="$ac_help
+ --enable-targets alternative target configurations"
ac_help="$ac_help
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)"
+ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -55,6 +66,7 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
@@ -338,7 +350,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
+ echo "configure generated by autoconf version 2.12.1"
exit 0 ;;
-with-* | --with-*)
@@ -525,42 +537,8 @@ fi
-# Check whether --enable-targets or --disable-targets was given.
-if test "${enable_targets+set}" = set; then
- enableval="$enable_targets"
- case "${enableval}" in
- yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
- ;;
- no) enable_targets= ;;
- *) enable_targets=$enableval ;;
-esac
-fi
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- case "${enableval}" in
- yes) shared=true ;;
- no) shared=false ;;
- *bfd*) shared=true ;;
- *) shared=false ;;
-esac
-fi
-# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
-if test "${enable_64_bit_bfd+set}" = set; then
- enableval="$enable_64_bit_bfd"
- case "${enableval}" in
- yes) want64=true ;;
- no) want64=false ;;
- *) { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;;
-esac
-else
- want64=false
-fi
-
-
-
ac_aux_dir=
-for ac_dir in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`; do
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -572,7 +550,7 @@ for ac_dir in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`; do
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`" 1>&2; exit 1; }
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
@@ -601,33 +579,33 @@ esac
# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:610: checking host system type" >&5
+echo "configure:588: checking host system type" >&5
host_alias=$host
case "$host_alias" in
NONE)
case $nonopt in
NONE)
- if host_alias=`$ac_config_guess`; then :
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
fi ;;
*) host_alias=$nonopt ;;
esac ;;
esac
-host=`$ac_config_sub $host_alias`
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:631: checking target system type" >&5
+echo "configure:609: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -638,14 +616,14 @@ NONE)
esac ;;
esac
-target=`$ac_config_sub $target_alias`
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:649: checking build system type" >&5
+echo "configure:627: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -656,7 +634,7 @@ NONE)
esac ;;
esac
-build=`$ac_config_sub $build_alias`
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -667,12 +645,110 @@ test "$host_alias" != "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
-if test -z "$target" ; then
- { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:662: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
fi
-if test -z "$host" ; then
- { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; }
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:716: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
if test "$program_transform_name" = s,x,x,; then
program_transform_name=
else
@@ -692,13 +768,198 @@ test "$program_suffix" != NONE &&
# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:773: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
-# host-specific stuff:
+PACKAGE=ld
+
+VERSION=2.9.1
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:819: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
+else
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:832: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:845: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:858: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
+else
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:871: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=yes
+fi
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:934: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:702: checking for $ac_word" >&5
+echo "configure:963: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -727,7 +988,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:731: checking for $ac_word" >&5
+echo "configure:992: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -775,7 +1036,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:779: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -785,11 +1046,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 789 "configure"
+#line 1050 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -809,12 +1070,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:813: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1074: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:818: checking whether we are using GNU C" >&5
+echo "configure:1079: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -823,7 +1084,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -838,7 +1099,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:842: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1103: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -865,106 +1126,602 @@ else
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:880: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:1143: checking for ld used by GCC" >&5
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+ /* | [A-Za-z]:\\*)
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:1161: checking for GNU ld" >&5
+else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:1164: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ echo "$ac_t""$LD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:1200: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
+
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:1216: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$NM" in
+/* | [A-Za-z]:\\*)
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac
+fi
+
+NM="$ac_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1253: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 1289 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
;;
esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+
+# Check whether --enable-targets or --disable-targets was given.
+if test "${enable_targets+set}" = set; then
+ enableval="$enable_targets"
+ case "${enableval}" in
+ yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
+ ;;
+ no) enable_targets= ;;
+ *) enable_targets=$enableval ;;
+esac
+fi
+# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
+if test "${enable_64_bit_bfd+set}" = set; then
+ enableval="$enable_64_bit_bfd"
+ case "${enableval}" in
+ yes) want64=true ;;
+ no) want64=false ;;
+ *) { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;;
+esac
+else
+ want64=false
+fi
+
+
+
+
+
+if test -z "$target" ; then
+ { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
+fi
+if test -z "$host" ; then
+ { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; }
+fi
+
+# host-specific stuff:
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1358: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
done
- IFS="$ac_save_IFS"
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1387: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1435: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 1445 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:1449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ ac_cv_prog_cc_cross=yes
fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
fi
-echo "$ac_t""$INSTALL" 1>&6
+rm -fr conftest*
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1469: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1474: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-. ${srcdir}/configure.host
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1498: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
+echo "configure:1529: checking for Cygwin32 environment" >&5
+if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1534 "configure"
+#include "confdefs.h"
+
+int main() {
+return __CYGWIN32__;
+; return 0; }
+EOF
+if { (eval echo configure:1541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_cygwin32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_cygwin32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+echo "$ac_t""$am_cv_cygwin32" 1>&6
+CYGWIN32=
+test "$am_cv_cygwin32" = yes && CYGWIN32=yes
+echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
+echo "configure:1558: checking for Mingw32 environment" >&5
+if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1563 "configure"
+#include "confdefs.h"
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+echo "$ac_t""$am_cv_mingw32" 1>&6
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1589: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*
+fi
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+echo "$ac_t""${am_cv_exeext}" 1>&6
+for ac_prog in 'bison -y' byacc
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1618: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$YACC"; then
+ ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_YACC="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+YACC="$ac_cv_prog_YACC"
+if test -n "$YACC"; then
+ echo "$ac_t""$YACC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
-# For most hosts we can use a simple definition to pick up the BFD and
-# opcodes libraries. However, if we are building shared libraries, we
-# need to handle some hosts specially.
-BFDLIB='-L../bfd -lbfd'
-case "${host}" in
-*-*-sunos*)
- # On SunOS, we must link against the name we are going to install,
- # not -lbfd, since SunOS does not support SONAME.
- if test "${shared}" = "true"; then
- BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
- fi
- ;;
-alpha*-*-osf*)
- # On Alpha OSF/1, the native linker searches all the -L
- # directories for any LIB.so files, and only then searches for any
- # LIB.a files. That means that if there is an installed
- # libbfd.so, but this build is not done with --enable-shared, the
- # link will wind up being against the install libbfd.so rather
- # than the newly built libbfd. To avoid this, we must explicitly
- # link against libbfd.a when --enable-shared is not used.
- if test "${shared}" != "true"; then
- BFDLIB='../bfd/libbfd.a'
- fi
- ;;
-esac
+test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+# Extract the first word of "flex", so it can be a program name with args.
+set dummy flex; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1650: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$LEX"; then
+ ac_cv_prog_LEX="$LEX" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_LEX="flex"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
+fi
+fi
+LEX="$ac_cv_prog_LEX"
+if test -n "$LEX"; then
+ echo "$ac_t""$LEX" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$LEXLIB"
+then
+ case "$LEX" in
+ flex*) ac_lib=fl ;;
+ *) ac_lib=l ;;
+ esac
+ echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
+echo "configure:1683: checking for yywrap in -l$ac_lib" >&5
+ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-l$ac_lib $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1691 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char yywrap();
+
+int main() {
+yywrap()
+; return 0; }
+EOF
+if { (eval echo configure:1702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LEXLIB="-l$ac_lib"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:968: checking how to run the C preprocessor" >&5
+echo "configure:1725: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -979,13 +1736,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 983 "configure"
+#line 1740 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -996,13 +1753,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1000 "configure"
+#line 1757 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1024,21 +1781,110 @@ else
fi
echo "$ac_t""$CPP" 1>&6
+echo $ac_n "checking lex output file root""... $ac_c" 1>&6
+echo "configure:1786: checking lex output file root" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # The minimal lex program is just a single line: %%. But some broken lexes
+# (Solaris, I think it was) want two %% lines, so accommodate them.
+echo '%%
+%%' | $LEX
+if test -f lex.yy.c; then
+ ac_cv_prog_lex_root=lex.yy
+elif test -f lexyy.c; then
+ ac_cv_prog_lex_root=lexyy
+else
+ { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; }
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
+echo "configure:1807: checking whether yytext is a pointer" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # POSIX says lex can declare yytext either as a pointer or an array; the
+# default is implementation-dependent. Figure out which it is, since
+# not all implementations provide the %pointer and %array declarations.
+ac_cv_prog_lex_yytext_pointer=no
+echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
+ac_save_LIBS="$LIBS"
+LIBS="$LIBS $LEXLIB"
+cat > conftest.$ac_ext <<EOF
+#line 1819 "configure"
+#include "confdefs.h"
+`cat $LEX_OUTPUT_ROOT.c`
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ ac_cv_prog_lex_yytext_pointer=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+rm -f "${LEX_OUTPUT_ROOT}.c"
+
+fi
+
+echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6
+if test $ac_cv_prog_lex_yytext_pointer = yes; then
+ cat >> confdefs.h <<\EOF
+#define YYTEXT_POINTER 1
+EOF
+
+fi
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:1849: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+
+
+
+. ${srcdir}/configure.host
+
+
+
+
+
+
for ac_hdr in string.h strings.h stdlib.h unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1032: checking for $ac_hdr" >&5
+echo "configure:1878: 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 1037 "configure"
+#line 1883 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1067,12 +1913,12 @@ done
for ac_func in sbrk
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1071: checking for $ac_func" >&5
+echo "configure:1917: 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 1076 "configure"
+#line 1922 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1095,7 +1941,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1124,12 +1970,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:1128: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1974: 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 1133 "configure"
+#line 1979 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -1137,7 +1983,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1162,7 +2008,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:1166: checking for opendir in -ldir" >&5
+echo "configure:2012: 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
@@ -1170,7 +2016,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1174 "configure"
+#line 2020 "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
@@ -1181,7 +2027,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1203,7 +2049,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1207: checking for opendir in -lx" >&5
+echo "configure:2053: 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
@@ -1211,7 +2057,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1215 "configure"
+#line 2061 "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
@@ -1222,7 +2068,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1247,7 +2093,7 @@ fi
case "${host}" in
-i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
+i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
cat >> confdefs.h <<\EOF
#define USE_BINARY_FOPEN 1
EOF
@@ -1255,12 +2101,12 @@ EOF
esac
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:1259: checking whether strstr must be declared" >&5
+echo "configure:2105: 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 1264 "configure"
+#line 2110 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1281,7 +2127,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:1285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -1303,12 +2149,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:1307: checking whether free must be declared" >&5
+echo "configure:2153: 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 1312 "configure"
+#line 2158 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1329,7 +2175,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:1333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -1351,12 +2197,12 @@ EOF
fi
echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:1355: checking whether sbrk must be declared" >&5
+echo "configure:2201: checking whether sbrk must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1360 "configure"
+#line 2206 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1377,7 +2223,7 @@ int main() {
char *(*pfn) = (char *(*)) sbrk
; return 0; }
EOF
-if { (eval echo configure:1381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_sbrk=no
else
@@ -1399,12 +2245,12 @@ EOF
fi
echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:1403: checking whether getenv must be declared" >&5
+echo "configure:2249: 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 1408 "configure"
+#line 2254 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1425,7 +2271,7 @@ int main() {
char *(*pfn) = (char *(*)) getenv
; return 0; }
EOF
-if { (eval echo configure:1429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_getenv=no
else
@@ -1502,6 +2348,13 @@ else
fi
+if test x${enable_static} = xno; then
+ TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
+else
+ TESTBFDLIB="../bfd/.libs/libbfd.a"
+fi
+
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -1525,7 +2378,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -1592,7 +2445,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -1612,6 +2465,7 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
@@ -1648,21 +2502,38 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
-s%@CC@%$CC%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@HLDFLAGS@%$HLDFLAGS%g
-s%@HLDENV@%$HLDENV%g
-s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@RANLIB@%$RANLIB%g
+s%@CC@%$CC%g
+s%@LD@%$LD%g
+s%@NM@%$NM%g
+s%@LN_S@%$LN_S%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@EXEEXT@%$EXEEXT%g
+s%@YACC@%$YACC%g
+s%@LEX@%$LEX%g
+s%@LEXLIB@%$LEXLIB%g
+s%@CPP@%$CPP%g
+s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
+s%@MAINT@%$MAINT%g
s%@HDEFINES@%$HDEFINES%g
s%@HOSTING_CRT0@%$HOSTING_CRT0%g
s%@HOSTING_LIBS@%$HOSTING_LIBS%g
s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g
-s%@BFDLIB@%$BFDLIB%g
-s%@CPP@%$CPP%g
s%@EMUL@%$EMUL%g
s%@TDIRS@%$TDIRS%g
s%@EMULATION_OFILES@%$EMULATION_OFILES%g
+s%@TESTBFDLIB@%$TESTBFDLIB%g
CEOF
EOF
@@ -1873,9 +2744,11 @@ fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
+
EOF
cat >> $CONFIG_STATUS <<\EOF
-case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
+test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
exit 0
EOF
chmod +x $CONFIG_STATUS
diff --git a/contrib/binutils/ld/configure.host b/contrib/binutils/ld/configure.host
index 6f71858..883ce67 100644
--- a/contrib/binutils/ld/configure.host
+++ b/contrib/binutils/ld/configure.host
@@ -8,9 +8,6 @@
# HOSTING_CRT0 crt0.o file used for bootstrapping
# HOSTING_LIBS libraries used for bootstrapping
# NATIVE_LIB_DIRS library directories to search on this host
-# HLDFLAGS link flags to use on this host
-# HLDENV environment variable to set when linking for the host
-# RPATH_ENVVAR environment variable used to find shared libraries
HDEFINES=
HOSTING_CRT0=/lib/crt0.o
@@ -19,11 +16,21 @@ NATIVE_LIB_DIRS=
case "${host}" in
-alpha-*-linux*)
+alpha*-*-linux-gnu*)
+ HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`gcc --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*.so..\).*,\1,"` `gcc --print-file-name=crt1.o` `gcc --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
+ HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -L`dirname \`gcc --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc --print-file-name=crtend.o; fi` `gcc --print-file-name=crtn.o`'
+ ;;
+
+alpha*-*-netbsd*)
+ # The new BSD `make' has a bug: it doesn't pass empty arguments in
+ # shell commands. So we need to make this value non-empty in order
+ # for the genscripts.sh call to work. There's nothing magic about
+ # the value `/lib'; it's just a dummy.
+ NATIVE_LIB_DIRS=/lib
HOSTING_CRT0=/usr/lib/crt0.o
;;
-alpha-*-*)
+alpha*-*-*)
HOSTING_CRT0=/usr/ccs/lib/crt0.o
NATIVE_LIB_DIRS=/usr/ccs/lib
;;
@@ -78,11 +85,16 @@ i[3456]86-*-linux*aout* | i[3456]86-*-linuxoldld)
HOSTING_CRT0=/usr/lib/crt0.o
;;
-i[3456]86-*-linux*)
+i[3456]86-*-linux*libc1*)
HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
;;
+i[3456]86-*-linux-gnu*)
+ HOSTING_CRT0='-dynamic-linker `fgrep ld-linux.so \`gcc --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld-linux.so..\).*,\1,"` `gcc --print-file-name=crt1.o` `gcc --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
+ HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -L`dirname \`gcc --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc --print-file-name=crtend.o; fi` `gcc --print-file-name=crtn.o`'
+ ;;
+
i[3456]86-*-lynxos*)
HOSTING_CRT0=/lib/init1.o
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
@@ -106,11 +118,16 @@ m68*-*-linux*aout*)
HOSTING_CRT0=/usr/lib/crt0.o
;;
-m68*-*-linux*)
+m68*-*-linux*libc1*)
HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
;;
+m68*-*-linux-gnu*)
+ HOSTING_CRT0='-dynamic-linker /lib/ld.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
+ HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
+ ;;
+
m68*-*-lynxos*)
HOSTING_CRT0=/lib/init1.o
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
@@ -147,52 +164,3 @@ sparc*-*-solaris2*)
;;
esac
-
-HLDFLAGS=
-HLDENV=
-RPATH_ENVVAR=LD_LIBRARY_PATH
-# If we have shared libraries, try to set rpath reasonably.
-if test "${shared}" = "true"; then
- case "${host}" in
- *-*-hpux*)
- HLDFLAGS='-Wl,+s,+b,$(libdir)'
- RPATH_ENVVAR=SHLIB_PATH
- ;;
- *-*-irix[56]*)
- HLDFLAGS='-Wl,-rpath,$(libdir)'
- ;;
- *-*-linux*aout*)
- ;;
- *-*-linux*)
- HLDFLAGS='-Wl,-rpath,$(libdir)'
- ;;
- *-*-solaris*)
- HLDFLAGS='-R $(libdir)'
- ;;
- *-*-sysv4*)
- HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
- ;;
- esac
-fi
-
-# On SunOS, if the linker supports the -rpath option, use it to
-# prevent ../bfd and ../opcodes from being included in the run time
-# search path.
-case "${host}" in
- *-*-sunos*)
- echo 'main () { }' > conftest.c
- ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
- if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
- :
- elif grep 'No such file' conftest.t >/dev/null 2>&1; then
- :
- elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
- :
- elif test "${shared}" = "true"; then
- HLDFLAGS='-Wl,-rpath=$(libdir)'
- else
- HLDFLAGS='-Wl,-rpath='
- fi
- rm -f conftest.t conftest.c conftest
- ;;
-esac
diff --git a/contrib/binutils/ld/configure.in b/contrib/binutils/ld/configure.in
index 3646e2f..dbadbe0 100644
--- a/contrib/binutils/ld/configure.in
+++ b/contrib/binutils/ld/configure.in
@@ -3,6 +3,12 @@ dnl
AC_PREREG(2.5)
AC_INIT(ldmain.c)
+AC_CANONICAL_SYSTEM
+
+AM_INIT_AUTOMAKE(ld, 2.9.1)
+
+AM_PROG_LIBTOOL
+
AC_ARG_ENABLE(targets,
[ --enable-targets alternative target configurations],
[case "${enableval}" in
@@ -11,14 +17,6 @@ AC_ARG_ENABLE(targets,
no) enable_targets= ;;
*) enable_targets=$enableval ;;
esac])dnl
-AC_ARG_ENABLE(shared,
-[ --enable-shared build shared BFD library],
-[case "${enableval}" in
- yes) shared=true ;;
- no) shared=false ;;
- *bfd*) shared=true ;;
- *) shared=false ;;
-esac])dnl
AC_ARG_ENABLE(64-bit-bfd,
[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
[case "${enableval}" in
@@ -27,60 +25,35 @@ AC_ARG_ENABLE(64-bit-bfd,
*) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
esac],[want64=false])dnl
-AC_CONFIG_HEADER(config.h:config.in)
+AM_CONFIG_HEADER(config.h:config.in)
-AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
-AC_CANONICAL_SYSTEM
if test -z "$target" ; then
AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
fi
if test -z "$host" ; then
AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
fi
-AC_ARG_PROGRAM
# host-specific stuff:
AC_PROG_CC
-AC_PROG_INSTALL
+AM_PROG_INSTALL
+AM_CYGWIN32
+AM_EXEEXT
+
+AC_PROG_YACC
+AC_PROG_LEX
+AC_DECL_YYTEXT
+
+AM_MAINTAINER_MODE
. ${srcdir}/configure.host
-AC_SUBST(HLDFLAGS)
-AC_SUBST(HLDENV)
-AC_SUBST(RPATH_ENVVAR)
AC_SUBST(HDEFINES)
AC_SUBST(HOSTING_CRT0)
AC_SUBST(HOSTING_LIBS)
AC_SUBST(NATIVE_LIB_DIRS)
-# For most hosts we can use a simple definition to pick up the BFD and
-# opcodes libraries. However, if we are building shared libraries, we
-# need to handle some hosts specially.
-BFDLIB='-L../bfd -lbfd'
-case "${host}" in
-*-*-sunos*)
- # On SunOS, we must link against the name we are going to install,
- # not -lbfd, since SunOS does not support SONAME.
- if test "${shared}" = "true"; then
- BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
- fi
- ;;
-alpha*-*-osf*)
- # On Alpha OSF/1, the native linker searches all the -L
- # directories for any LIB.so files, and only then searches for any
- # LIB.a files. That means that if there is an installed
- # libbfd.so, but this build is not done with --enable-shared, the
- # link will wind up being against the install libbfd.so rather
- # than the newly built libbfd. To avoid this, we must explicitly
- # link against libbfd.a when --enable-shared is not used.
- if test "${shared}" != "true"; then
- BFDLIB='../bfd/libbfd.a'
- fi
- ;;
-esac
-AC_SUBST(BFDLIB)
-
AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
AC_CHECK_FUNCS(sbrk)
AC_HEADER_DIRENT
@@ -150,5 +123,11 @@ else
fi
AC_SUBST(EMULATION_OFILES)
-AC_OUTPUT(Makefile,
-[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
+if test x${enable_static} = xno; then
+ TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
+else
+ TESTBFDLIB="../bfd/.libs/libbfd.a"
+fi
+AC_SUBST(TESTBFDLIB)
+
+AC_OUTPUT(Makefile)
diff --git a/contrib/binutils/ld/emulparams/arcelf.sh b/contrib/binutils/ld/emulparams/arcelf.sh
new file mode 100644
index 0000000..b1c9c17
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/arcelf.sh
@@ -0,0 +1,11 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-littlearc"
+LITTLE_OUTPUT_FORMAT="elf32-littlearc"
+BIG_OUTPUT_FORMAT="elf32-bigarc"
+TEXT_START_ADDR=0x0
+MAXPAGESIZE=0x1000
+NONPAGED_TEXT_START_ADDR=0x0
+ARCH=arc
+MACHINE=
+ENTRY=start
+#TEMPLATE_NAME=elf32
diff --git a/contrib/binutils/ld/emulparams/elf32b4300.sh b/contrib/binutils/ld/emulparams/elf32b4300.sh
index 147ec2d..24f8d98 100644
--- a/contrib/binutils/ld/emulparams/elf32b4300.sh
+++ b/contrib/binutils/ld/emulparams/elf32b4300.sh
@@ -1,15 +1,15 @@
-SCRIPT_NAME=elfmips
+SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-bigmips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
TEXT_START_ADDR=0xa0020000
-DATA_ADDR=.
MAXPAGESIZE=0x40000
-OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
-OTHER_READWRITE_SECTIONS='
+OTHER_GOT_SECTIONS='
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
'
@@ -22,7 +22,7 @@ OTHER_SECTIONS='
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'
ARCH=mips
-MACHINE=4000
+MACHINE=
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
DYNAMIC_LINK=false
diff --git a/contrib/binutils/ld/emulparams/elf32l4300.sh b/contrib/binutils/ld/emulparams/elf32l4300.sh
index fdf31b1..690de88 100644
--- a/contrib/binutils/ld/emulparams/elf32l4300.sh
+++ b/contrib/binutils/ld/emulparams/elf32l4300.sh
@@ -1,15 +1,15 @@
-SCRIPT_NAME=elfmips
+SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-littlemips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
TEXT_START_ADDR=0xa0020000
-DATA_ADDR=.
MAXPAGESIZE=0x40000
-OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
-OTHER_READWRITE_SECTIONS='
+OTHER_GOT_SECTIONS='
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
'
@@ -22,7 +22,7 @@ OTHER_SECTIONS='
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'
ARCH=mips
-MACHINE=4000
+MACHINE=
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
DYNAMIC_LINK=false
diff --git a/contrib/binutils/ld/emulparams/i386pe.sh b/contrib/binutils/ld/emulparams/i386pe.sh
index 1249064..188a8ad 100644
--- a/contrib/binutils/ld/emulparams/i386pe.sh
+++ b/contrib/binutils/ld/emulparams/i386pe.sh
@@ -1,5 +1,5 @@
ARCH=i386
SCRIPT_NAME=pe
OUTPUT_FORMAT="pei-i386"
+RELOCATEABLE_OUTPUT_FORMAT="pe-i386"
TEMPLATE_NAME=pe
-
diff --git a/contrib/binutils/ld/emulparams/tic30aout.sh b/contrib/binutils/ld/emulparams/tic30aout.sh
new file mode 100755
index 0000000..2a4c13f
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/tic30aout.sh
@@ -0,0 +1,7 @@
+SCRIPT_NAME=tic30aout
+OUTPUT_FORMAT="a.out-tic30"
+OUTPUT_ARCH="tms320c30"
+TEXT_START_ADDR=0x0
+TARGET_PAGE_SIZE=128
+ARCH=tms320c30
+BIG=1
diff --git a/contrib/binutils/ld/emulparams/tic30coff.sh b/contrib/binutils/ld/emulparams/tic30coff.sh
new file mode 100755
index 0000000..df77943
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/tic30coff.sh
@@ -0,0 +1,7 @@
+SCRIPT_NAME=tic30coff
+OUTPUT_FORMAT="coff-tic30"
+OUTPUT_ARCH="tms320c30"
+TEXT_START_ADDR=0x0
+TARGET_PAGE_SIZE=128
+ARCH=tms320c30
+BIG=1
diff --git a/contrib/binutils/ld/emulparams/v850.sh b/contrib/binutils/ld/emulparams/v850.sh
new file mode 100644
index 0000000..78bfbd3
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/v850.sh
@@ -0,0 +1,14 @@
+MACHINE=
+SCRIPT_NAME=v850
+OUTPUT_FORMAT="elf32-v850"
+TEXT_START_ADDR=0x100000
+ZDATA_START_ADDR=0x160
+ROZDATA_START_ADDR="ALIGN (4)"
+SDATA_START_ADDR="ALIGN (4)"
+ROSDATA_START_ADDR="ALIGN (4)"
+TDATA_START_ADDR="ALIGN (4)"
+CALL_TABLE_START_ADDR="ALIGN (4)"
+ARCH=v850
+MAXPAGESIZE=256
+ENTRY=_start
+EMBEDDED=yes
diff --git a/contrib/binutils/ld/emultempl/elf32.em b/contrib/binutils/ld/emultempl/elf32.em
index f02775e..c4debe2 100644
--- a/contrib/binutils/ld/emultempl/elf32.em
+++ b/contrib/binutils/ld/emultempl/elf32.em
@@ -7,7 +7,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
- Copyright (C) 1991, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
@@ -54,8 +54,10 @@ static void gld${EMULATION_NAME}_check_needed
static void gld${EMULATION_NAME}_stat_needed
PARAMS ((lang_input_statement_type *));
static boolean gld${EMULATION_NAME}_search_needed
- PARAMS ((const char *, const char *));
-static boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *));
+ PARAMS ((const char *, const char *, int));
+static boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *, int));
+static void gld${EMULATION_NAME}_vercheck
+ PARAMS ((lang_input_statement_type *));
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
static void gld${EMULATION_NAME}_find_statement_assignment
PARAMS ((lang_statement_union_type *));
@@ -143,11 +145,13 @@ cat >>e${EMULATION_NAME}.c <<EOF
in which we may find shared libraries. /etc/ld.so.conf is really
only meaningful on Linux, but we check it on other systems anyhow. */
-static boolean gld${EMULATION_NAME}_check_ld_so_conf PARAMS ((const char *));
+static boolean gld${EMULATION_NAME}_check_ld_so_conf
+ PARAMS ((const char *, int));
static boolean
-gld${EMULATION_NAME}_check_ld_so_conf (name)
+gld${EMULATION_NAME}_check_ld_so_conf (name, force)
const char *name;
+ int force;
{
static boolean initialized;
static char *ld_so_conf;
@@ -215,7 +219,7 @@ gld${EMULATION_NAME}_check_ld_so_conf (name)
if (ld_so_conf == NULL)
return false;
- return gld${EMULATION_NAME}_search_needed (ld_so_conf, name);
+ return gld${EMULATION_NAME}_search_needed (ld_so_conf, name, force);
}
EOF
@@ -224,11 +228,13 @@ fi
cat >>e${EMULATION_NAME}.c <<EOF
/* These variables are required to pass information back and forth
- between after_open and check_needed and stat_needed. */
+ between after_open and check_needed and stat_needed and vercheck. */
static struct bfd_link_needed_list *global_needed;
static struct stat global_stat;
static boolean global_found;
+static struct bfd_link_needed_list *global_vercheck_needed;
+static boolean global_vercheck_failed;
/* This is called after all the input files have been opened. */
@@ -254,9 +260,7 @@ gld${EMULATION_NAME}_after_open ()
for (l = needed; l != NULL; l = l->next)
{
struct bfd_link_needed_list *ll;
- const char *lib_path;
- size_t len;
- search_dirs_type *search;
+ int force;
/* If we've already seen this file, skip it. */
for (ll = needed; ll != l; ll = ll->next)
@@ -277,55 +281,71 @@ gld${EMULATION_NAME}_after_open ()
linker will search. That means that we want to use
rpath_link, rpath, then the environment variable
LD_LIBRARY_PATH (native only), then the linker script
- LIB_SEARCH_DIRS. We do not search using the -L arguments. */
- if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
- l->name))
- continue;
- if (gld${EMULATION_NAME}_search_needed (command_line.rpath, l->name))
- continue;
- if (command_line.rpath_link == NULL
- && command_line.rpath == NULL)
+ LIB_SEARCH_DIRS. We do not search using the -L arguments.
+
+ We search twice. The first time, we skip objects which may
+ introduce version mismatches. The second time, we force
+ their use. See gld${EMULATION_NAME}_vercheck comment. */
+ for (force = 0; force < 2; force++)
{
- lib_path = (const char *) getenv ("LD_RUN_PATH");
- if (gld${EMULATION_NAME}_search_needed (lib_path, l->name))
- continue;
- }
+ const char *lib_path;
+ size_t len;
+ search_dirs_type *search;
+
+ if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
+ l->name, force))
+ break;
+ if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
+ l->name, force))
+ break;
+ if (command_line.rpath_link == NULL
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
+ if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
+ force))
+ break;
+ }
EOF
if [ "x${host}" = "x${target}" ] ; then
if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
cat >>e${EMULATION_NAME}.c <<EOF
- lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
- if (gld${EMULATION_NAME}_search_needed (lib_path, l->name))
- continue;
+ lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
+ if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force))
+ break;
EOF
fi
fi
cat >>e${EMULATION_NAME}.c <<EOF
- len = strlen (l->name);
- for (search = search_head; search != NULL; search = search->next)
- {
- char *filename;
-
- if (search->cmdline)
- continue;
- filename = (char *) xmalloc (strlen (search->name) + len + 2);
- sprintf (filename, "%s/%s", search->name, l->name);
- if (gld${EMULATION_NAME}_try_needed (filename))
+ len = strlen (l->name);
+ for (search = search_head; search != NULL; search = search->next)
+ {
+ char *filename;
+
+ if (search->cmdline)
+ continue;
+ filename = (char *) xmalloc (strlen (search->name) + len + 2);
+ sprintf (filename, "%s/%s", search->name, l->name);
+ if (gld${EMULATION_NAME}_try_needed (filename, force))
+ break;
+ free (filename);
+ }
+ if (search != NULL)
break;
- free (filename);
- }
- if (search != NULL)
- continue;
EOF
if [ "x${host}" = "x${target}" ] ; then
if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
cat >>e${EMULATION_NAME}.c <<EOF
- if (gld${EMULATION_NAME}_check_ld_so_conf (l->name))
- continue;
+ if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
+ break;
EOF
fi
fi
cat >>e${EMULATION_NAME}.c <<EOF
+ }
+
+ if (force < 2)
+ continue;
einfo ("%P: warning: %s, needed by %B, not found (try using --rpath)\n",
l->name, l->by);
@@ -335,9 +355,10 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* Search for a needed file in a path. */
static boolean
-gld${EMULATION_NAME}_search_needed (path, name)
+gld${EMULATION_NAME}_search_needed (path, name, force)
const char *path;
const char *name;
+ int force;
{
const char *s;
size_t len;
@@ -364,7 +385,7 @@ gld${EMULATION_NAME}_search_needed (path, name)
}
strcpy (sset, name);
- if (gld${EMULATION_NAME}_try_needed (filename))
+ if (gld${EMULATION_NAME}_try_needed (filename, force))
return true;
free (filename);
@@ -378,11 +399,13 @@ gld${EMULATION_NAME}_search_needed (path, name)
}
/* This function is called for each possible name for a dynamic object
- named by a DT_NEEDED entry. */
+ named by a DT_NEEDED entry. The FORCE parameter indicates whether
+ to skip the check for a conflicting version. */
static boolean
-gld${EMULATION_NAME}_try_needed (name)
+gld${EMULATION_NAME}_try_needed (name, force)
const char *name;
+ int force;
{
bfd *abfd;
@@ -400,6 +423,62 @@ gld${EMULATION_NAME}_try_needed (name)
return false;
}
+ /* Check whether this object would include any conflicting library
+ versions. If FORCE is set, then we skip this check; we use this
+ the second time around, if we couldn't find any compatible
+ instance of the shared library. */
+
+ if (! force)
+ {
+ struct bfd_link_needed_list *needed;
+
+ if (! bfd_elf_get_bfd_needed_list (abfd, &needed))
+ einfo ("%F%P:%B: bfd_elf_get_bfd_needed_list failed: %E\n", abfd);
+
+ if (needed != NULL)
+ {
+ global_vercheck_needed = needed;
+ global_vercheck_failed = false;
+ lang_for_each_input_file (gld${EMULATION_NAME}_vercheck);
+ if (global_vercheck_failed)
+ {
+ (void) bfd_close (abfd);
+ /* Return false to force the caller to move on to try
+ another file on the search path. */
+ return false;
+ }
+
+ /* But wait! It gets much worse. On Linux, if a shared
+ library does not use libc at all, we are supposed to skip
+ it the first time around in case we encounter a shared
+ library later on with the same name which does use the
+ version of libc that we want. This is much too horrible
+ to use on any system other than Linux. */
+
+EOF
+case ${target} in
+ *-*-linux-gnu*)
+ cat >>e${EMULATION_NAME}.c <<EOF
+ {
+ struct bfd_link_needed_list *l;
+
+ for (l = needed; l != NULL; l = l->next)
+ if (strncmp (l->name, "libc.so", 7) == 0)
+ break;
+ if (l == NULL)
+ {
+ (void) bfd_close (abfd);
+ return false;
+ }
+ }
+
+EOF
+ ;;
+esac
+cat >>e${EMULATION_NAME}.c <<EOF
+ }
+ }
+
/* We've found a dynamic object matching the DT_NEEDED entry. */
/* We have already checked that there is no other input file of the
@@ -538,6 +617,78 @@ gld${EMULATION_NAME}_stat_needed (s)
global_needed->name, global_needed->by, f);
}
+/* On Linux, it's possible to have different versions of the same
+ shared library linked against different versions of libc. The
+ dynamic linker somehow tags which libc version to use in
+ /etc/ld.so.cache, and, based on the libc that it sees in the
+ executable, chooses which version of the shared library to use.
+
+ We try to do a similar check here by checking whether this shared
+ library needs any other shared libraries which may conflict with
+ libraries we have already included in the link. If it does, we
+ skip it, and try to find another shared library farther on down the
+ link path.
+
+ This is called via lang_for_each_input_file.
+ GLOBAL_VERCHECK_NEEDED is the list of objects needed by the object
+ which we ar checking. This sets GLOBAL_VERCHECK_FAILED if we find
+ a conflicting version. */
+
+static void
+gld${EMULATION_NAME}_vercheck (s)
+ lang_input_statement_type *s;
+{
+ const char *soname, *f;
+ struct bfd_link_needed_list *l;
+
+ if (global_vercheck_failed)
+ return;
+ if (s->the_bfd == NULL
+ || (bfd_get_file_flags (s->the_bfd) & DYNAMIC) == 0)
+ return;
+
+ soname = bfd_elf_get_dt_soname (s->the_bfd);
+ if (soname == NULL)
+ soname = bfd_get_filename (s->the_bfd);
+
+ f = strrchr (soname, '/');
+ if (f != NULL)
+ ++f;
+ else
+ f = soname;
+
+ for (l = global_vercheck_needed; l != NULL; l = l->next)
+ {
+ const char *suffix;
+
+ if (strcmp (f, l->name) == 0)
+ {
+ /* Probably can't happen, but it's an easy check. */
+ continue;
+ }
+
+ if (strchr (l->name, '/') != NULL)
+ continue;
+
+ suffix = strstr (l->name, ".so.");
+ if (suffix == NULL)
+ continue;
+
+ suffix += sizeof ".so." - 1;
+
+ if (strncmp (f, l->name, suffix - l->name) == 0)
+ {
+ /* Here we know that S is a dynamic object FOO.SO.VER1, and
+ the object we are considering needs a dynamic object
+ FOO.SO.VER2, and VER1 and VER2 are different. This
+ appears to be a version mismatch, so we tell the caller
+ to try a different version of this library. */
+ global_vercheck_failed = true;
+ return;
+ }
+ }
+}
+
/* This is called after the sections have been attached to output
sections, but before any sizes or addresses have been set. */
@@ -844,7 +995,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
/* If the name of the section is representable in C, then create
symbols to mark the start and the end of the section. */
for (ps = outsecname; *ps != '\0'; ps++)
- if (! isalnum (*ps) && *ps != '_')
+ if (! isalnum ((unsigned char) *ps) && *ps != '_')
break;
if (*ps == '\0' && config.build_constructors)
{
@@ -907,6 +1058,7 @@ gld${EMULATION_NAME}_place_section (s)
os = &s->output_section_statement;
if (strcmp (os->name, hold_section->name) == 0
+ && os->bfd_section != NULL
&& ((hold_section->flags & (SEC_LOAD | SEC_ALLOC))
== (os->bfd_section->flags & (SEC_LOAD | SEC_ALLOC))))
hold_use = os;
diff --git a/contrib/binutils/ld/emultempl/pe.em b/contrib/binutils/ld/emultempl/pe.em
index 8f0913e..fcabcbd 100644
--- a/contrib/binutils/ld/emultempl/pe.em
+++ b/contrib/binutils/ld/emultempl/pe.em
@@ -2,7 +2,7 @@
# It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker.
- Copyright 1995, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1995, 96, 97, 1998 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -364,6 +364,9 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
return 1;
}
+/* Assign values to the special symbols before the linker script is
+ read. */
+
static void
gld_${EMULATION_NAME}_set_symbols()
{
@@ -373,8 +376,18 @@ gld_${EMULATION_NAME}_set_symbols()
lang_statement_list_type *save;
if (!init[IMAGEBASEOFF].inited)
- init[IMAGEBASEOFF].value = init[DLLOFF].value
- ? NT_DLL_IMAGE_BASE : NT_EXE_IMAGE_BASE;
+ {
+ if (link_info.relocateable)
+ init[IMAGEBASEOFF].value = 0;
+ else if (init[DLLOFF].value)
+ init[IMAGEBASEOFF].value = NT_DLL_IMAGE_BASE;
+ else
+ init[IMAGEBASEOFF].value = NT_EXE_IMAGE_BASE;
+ }
+
+ /* Don't do any symbol assignments if this is a relocateable link. */
+ if (link_info.relocateable)
+ return;
/* Glue the assignments into the abs section */
save = stat_ptr;
@@ -551,15 +564,18 @@ sort_sections (s)
}
/* If this is a collection of grouped sections, sort them.
- The linker script must explicitly mention "*(.foo\$)".
- Don't sort them if \$ is not the last character (not sure if
- this is really useful, but it allows explicitly mentioning
- some \$ sections and letting the linker handle the rest). */
+ The linker script must explicitly mention "*(.foo\$)" or
+ "*(.foo\$*)". Don't sort them if \$ is not the last
+ character (not sure if this is really useful, but it
+ allows explicitly mentioning some \$ sections and letting
+ the linker handle the rest). */
if (s->wild_statement.section_name != NULL)
{
char *q = strchr (s->wild_statement.section_name, '\$');
- if (q && q[1] == 0)
+ if (q != NULL
+ && (q[1] == '\0'
+ || (q[1] == '*' && q[2] == '\0')))
{
lang_statement_union_type *end;
int count;
@@ -593,14 +609,35 @@ gld_${EMULATION_NAME}_before_allocation()
{
if (!ppc_process_before_allocation(is->the_bfd, &link_info))
{
- einfo("Errors encountered processing file %s", is->filename);
+ einfo("Errors encountered processing file %s\n", is->filename);
}
}
}
/* We have seen it all. Allocate it, and carry on */
ppc_allocate_toc_section (&link_info);
-#endif
+#else
+#ifdef TARGET_IS_armpe
+ /* FIXME: we should be able to set the size of the interworking stub
+ section.
+
+ Here we rummage through the found bfds to collect glue
+ information. FIXME: should this be based on a command line
+ option? krk@cygnus.com */
+ {
+ LANG_FOR_EACH_INPUT_STATEMENT (is)
+ {
+ if (!arm_process_before_allocation (is->the_bfd, & link_info))
+ {
+ einfo ("Errors encountered processing file %s", is->filename);
+ }
+ }
+ }
+
+ /* We have seen it all. Allocate it, and carry on */
+ arm_allocate_interworking_sections (& link_info);
+#endif /* TARGET_IS_armpe */
+#endif /* TARGET_IS_ppcpe */
sort_sections (stat_ptr->head);
}
@@ -610,7 +647,11 @@ gld_${EMULATION_NAME}_before_allocation()
gets mapped to the output section with everything from the '\$' on stripped
(e.g. .text).
See the Microsoft Portable Executable and Common Object File Format
- Specification 4.1, section 4.2, Grouped Sections. */
+ Specification 4.1, section 4.2, Grouped Sections.
+
+ FIXME: This is now handled by the linker script using wildcards,
+ but I'm leaving this here in case we want to enable it for sections
+ which are not mentioned in the linker script. */
/*ARGSUSED*/
static boolean
diff --git a/contrib/binutils/ld/ld.1 b/contrib/binutils/ld/ld.1
index 610f046..79c9f10 100644
--- a/contrib/binutils/ld/ld.1
+++ b/contrib/binutils/ld/ld.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1991, 92, 93, 94, 95, 1996 Free Software Foundation
+.\" Copyright (c) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation
.\" See section COPYING for conditions for redistribution
.TH ld 1 "17 August 1992" "cygnus support" "GNU Development Tools"
.de BP
@@ -91,6 +91,7 @@ ld \- the GNU linker
.RB "[\|" \-n | \-N "\|]"
.RB "[\|" \-noinhibit-exec "\|]"
.RB "[\|" \-no\-keep\-memory "\|]"
+.RB "[\|" \-no\-warn\-mismatch "\|]"
.RB "[\|" "\-oformat\ "\c
.I output-format\c
\&\|]
@@ -666,6 +667,16 @@ tables as necessary. This may be required if the linker runs out of
memory space while linking a large executable.
.TP
+.B \-no\-warn\-mismatch
+Normally the linker will give an error if you try to link together
+input files that are mismatched for some reason, perhaps because they
+have been compiled for different processors or for different
+endiannesses. This option tells the linker that it should silently
+permit such possible errors. This option should only be used with
+care, in cases when you have taken some special action that ensures
+that the linker errors are inappropriate.
+
+.TP
.BI "\-o " "output"
.I output\c
\& is a name for the program produced by \c
diff --git a/contrib/binutils/ld/ld.h b/contrib/binutils/ld/ld.h
index d504a2e..e0e2a4d 100644
--- a/contrib/binutils/ld/ld.h
+++ b/contrib/binutils/ld/ld.h
@@ -91,6 +91,10 @@ typedef struct
/* If true, generate a cross reference report. */
boolean cref;
+ /* If true (which is the default), warn about mismatched input
+ files. */
+ boolean warn_mismatch;
+
/* Name of shared object whose symbol table should be filtered with
this shared object. From the --filter option. */
char *filter_shlib;
diff --git a/contrib/binutils/ld/ld.texinfo b/contrib/binutils/ld/ld.texinfo
index 0a5d17a..05f3984 100644
--- a/contrib/binutils/ld/ld.texinfo
+++ b/contrib/binutils/ld/ld.texinfo
@@ -17,7 +17,7 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the @sc{gnu} linker LD.
-Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -64,7 +64,7 @@ notice identical to this one except for the removal of this paragraph
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -328,9 +328,17 @@ entry point.
@item -E
@itemx --export-dynamic
When creating a dynamically linked executable, add all symbols to the
-dynamic symbol table. Normally, the dynamic symbol table contains only
-symbols which are used by a dynamic object. This option is needed for
-some uses of @code{dlopen}.
+dynamic symbol table. The dynamic symbol table is the set of symbols
+which are visible from dynamic objects at run time.
+
+If you do not use this option, the dynamic symbol table will normally
+contain only those symbols which are referenced by some dynamic object
+mentioned in the link.
+
+If you use @code{dlopen} to load a dynamic object which needs to refer
+back to the symbols defined by the program, rather than some other
+dynamic object, then you will probably need to use this option when
+linking the program itself.
@kindex -f
@kindex --auxiliary
@@ -482,17 +490,31 @@ at the point in which the linker script appears in the command line.
@kindex -m @var{emulation}
@item -m@var{emulation}
Emulate the @var{emulation} linker. You can list the available
-emulations with the @samp{--verbose} or @samp{-V} options. The default
-depends on how your @code{ld} was configured.
+emulations with the @samp{--verbose} or @samp{-V} options.
+
+If the @samp{-m} option is not used, the emulation is taken from the
+@code{LDEMULATION} environment variable, if that is defined.
+
+Otherwise, the default emulation depends upon how the linker was
+configured.
@cindex link map
@kindex -M
@kindex --print-map
@item -M
@itemx --print-map
-Print (to the standard output) a link map---diagnostic information about
-where symbols are mapped by @code{ld}, and information on global common
-storage allocation.
+Print a link map to the standard output. A link map provides
+information about the link, including the following:
+
+@itemize @bullet
+@item
+Where object files and symbols are mapped into memory.
+@item
+How common symbols are allocated.
+@item
+All archive members included in the link, with a mention of the symbol
+which caused the archive member to be brought in.
+@end itemize
@kindex -n
@cindex read-only text
@@ -770,12 +792,10 @@ values. See the code in testsuite/ld-empic for details.
@item --help
Print a summary of the command-line options on the standard output and exit.
-@cindex link map
@kindex -Map
@item -Map @var{mapfile}
-Print to the file @var{mapfile} a link map---diagnostic information
-about where symbols are mapped by @code{ld}, and information on global
-common storage allocation.
+Print a link map to the file @var{mapfile}. See the description of the
+@samp{-M} option, above.
@cindex memory usage
@kindex --no-keep-memory
@@ -786,6 +806,16 @@ instead optimize for memory usage, by rereading the symbol tables as
necessary. This may be required if @code{ld} runs out of memory space
while linking a large executable.
+@kindex --no-warn-mismatch
+@item --no-warn-mismatch
+Normally @code{ld} will give an error if you try to link together input
+files that are mismatched for some reason, perhaps because they have
+been compiled for different processors or for different endiannesses.
+This option tells @code{ld} that it should silently permit such possible
+errors. This option should only be used with care, in cases when you
+have taken some special action that ensures that the linker errors are
+inappropriate.
+
@kindex --no-whole-archive
@item --no-whole-archive
Turn off the effect of the @code{--whole-archive} option for subsequent
@@ -1209,8 +1239,8 @@ call before the linker has a chance to wrap it to @code{malloc}.
@node Environment
@section Environment Variables
-You can change the behavior of @code{ld} with the environment
-variable @code{GNUTARGET}.
+You can change the behavior of @code{ld} with the environment variables
+@code{GNUTARGET} and @code{LDEMULATION}.
@kindex GNUTARGET
@cindex default input format
@@ -1225,6 +1255,17 @@ there is no method of ensuring that the magic number used to specify
object-file formats is unique. However, the configuration procedure for
BFD on each system places the conventional format for that system first
in the search-list, so ambiguities are resolved in favor of convention.
+
+@kindex LDEMULATION
+@cindex default emulation
+@cindex emulation, default
+@code{LDEMULATION} determines the default emulation if you don't use the
+@samp{-m} option. The emulation can affect various aspects of linker
+behaviour, particularly the default linker script. You can list the
+available emulations with the @samp{--verbose} or @samp{-V} options. If
+the @samp{-m} option is not used, and the @code{LDEMULATION} environment
+variable is not defined, the default emulation depends upon how the
+linker was configured.
@end ifset
@node Commands
@@ -1838,11 +1879,38 @@ names. Use distinct names to specify multiple regions.
@cindex memory region attributes
@item (@var{attr})
-is an optional list of attributes, permitted for compatibility with the
-AT&T linker but not used by @code{ld} beyond checking that the
-attribute list is valid. Valid attribute lists must be made up of the
-characters ``@code{LIRWX}''. If you omit the attribute list, you may
-omit the parentheses around it as well.
+is an optional list of attributes that specify whether to use a
+particular memory to place sections that are not listed in the linker
+script. Valid attribute lists must be made up of the characters
+``@code{ALIRWX}'' that match section attributes. If you omit the
+attribute list, you may omit the parentheses around it as well. The
+attributes currently supported are:
+
+@table @samp
+@item @code{Letter}
+@code{Section Attribute}
+
+@item @code{R}
+Read-only sections.
+
+@item @code{W}
+Read/write sections.
+
+@item @code{X}
+Sections containing executable code.
+
+@item @code{A}
+Allocated sections.
+
+@item @code{I}
+Initialized sections.
+
+@item @code{L}
+Same as @code{I}.
+
+@item @code{!}
+Invert the sense of any of the following attributes.
+@end table
@kindex ORIGIN =
@kindex o =
@@ -1862,15 +1930,18 @@ The keyword @code{LENGTH} may be abbreviated to @code{len} or @code{l}.
@end table
For example, to specify that memory has two regions available for
-allocation---one starting at 0 for 256 kilobytes, and the other
-starting at @code{0x40000000} for four megabytes:
+allocation---one starting at 0 for 256 kilobytes, and the other starting
+at @code{0x40000000} for four megabytes. The @code{rom} memory region
+will get all sections without an explicit memory register that are
+either read-only or contain code, while the @code{ram} memory region
+will get the sections.
@smallexample
@group
MEMORY
@{
- rom : ORIGIN = 0, LENGTH = 256K
- ram : org = 0x40000000, l = 4M
+ rom (rx) : ORIGIN = 0, LENGTH = 256K
+ ram (!rx) : org = 0x40000000, l = 4M
@}
@end group
@end smallexample
@@ -1945,9 +2016,10 @@ SECTIONS @{ @dots{}
@noindent
@var{secname} is the name of the output section, and @var{contents} a
specification of what goes there---for example, a list of input files or
-sections of input files (@pxref{Section Placement}). As you might
-assume, the whitespace shown is optional. You do need the colon
-@samp{:} and the braces @samp{@{@}}, however.
+sections of input files (@pxref{Section Placement}). The whitespace
+around @var{secname} is required, so that the section name is
+unambiguous. The other whitespace shown is optional. You do need the
+colon @samp{:} and the braces @samp{@{@}}, however.
@var{secname} must meet the constraints of your output format. In
formats which only support a limited number of sections, such as
@@ -2013,10 +2085,10 @@ statement.
@item @var{filename}( @var{section} )
@itemx @var{filename}( @var{section} , @var{section}, @dots{} )
@itemx @var{filename}( @var{section} @var{section} @dots{} )
-You can name one or more sections from your input files, for
-insertion in the current output section. If you wish to specify a list
-of input-file sections inside the parentheses, you may separate the
-section names by either commas or whitespace.
+You can name one or more sections from your input files, for insertion
+in the current output section. If you wish to specify a list of
+input-file sections inside the parentheses, separate the section names
+with whitespace.
@cindex input sections to output section
@kindex *(@var{section})
@@ -2267,15 +2339,20 @@ same value as @code{abs2}.
@kindex SHORT(@var{expression})
@kindex LONG(@var{expression})
@kindex QUAD(@var{expression})
+@kindex SQUAD(@var{expression})
@cindex direct output
@item BYTE(@var{expression})
@itemx SHORT(@var{expression})
@itemx LONG(@var{expression})
@itemx QUAD(@var{expression})
+@itemx SQUAD(@var{expression})
By including one of these four statements in a section definition, you
-can explicitly place one, two, four, or eight bytes (respectively) at
-the current address of that section. @code{QUAD} is only supported when
-using a 64 bit host or target.
+can explicitly place one, two, four, eight unsigned, or eight signed
+bytes (respectively) at the current address of that section. When using
+a 64 bit host or target, @code{QUAD} and @code{SQUAD} are the same.
+When both host and target are 32 bits, @code{QUAD} uses an unsigned 32
+bit value, and @code{SQUAD} sign extends the value. Both will use the
+correct endianness when writing out the value.
@ifclear SingleFormat
Multiple-byte quantities are represented in whatever byte order is
@@ -2356,10 +2433,13 @@ an expression.
@cindex prevent unnecessary loading
@cindex loading, preventing
@item (NOLOAD)
-Use @samp{(NOLOAD)} to prevent a section from being loaded into memory
-each time it is accessed. For example, in the script sample below, the
-@code{ROM} segment is addressed at memory location @samp{0} and does not
-need to be loaded into each object file:
+The @samp{(NOLOAD)} directive will mark a section to not be loaded at
+run time. The linker will process the section normally, but will mark
+it so that a program loader will not load it into memory. For example,
+in the script sample below, the @code{ROM} section is addressed at
+memory location @samp{0} and does not need to be loaded when the program
+is run. The contents of the @code{ROM} section will appear in the
+linker output file as usual.
@smallexample
@group
@@ -3314,7 +3394,7 @@ individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
distribution.
In any event, we also recommend that you send bug reports for @code{ld}
-to @samp{bug-gnu-utils@@prep.ai.mit.edu}.
+to @samp{bug-gnu-utils@@gnu.org}.
The fundamental principle of reporting bugs usefully is this:
@strong{report all the facts}. If you are not sure whether to state a
diff --git a/contrib/binutils/ld/ldcref.c b/contrib/binutils/ld/ldcref.c
index d9e6ebb..7022daf 100644
--- a/contrib/binutils/ld/ldcref.c
+++ b/contrib/binutils/ld/ldcref.c
@@ -1,5 +1,5 @@
/* ldcref.c -- output a cross reference table
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>
This file is part of GLD, the Gnu Linker.
@@ -256,7 +256,7 @@ output_cref (fp)
csym_fill = csyms;
cref_hash_traverse (&cref_table, cref_fill_array, &csym_fill);
- ASSERT (csym_fill - csyms == cref_symcount);
+ ASSERT ((size_t) (csym_fill - csyms) == cref_symcount);
qsort (csyms, cref_symcount, sizeof (*csyms), cref_sort_array);
@@ -313,7 +313,7 @@ output_one_cref (fp, h)
putc (' ', fp);
++len;
}
- finfo (fp, "%B\n", r->abfd);
+ lfinfo (fp, "%B\n", r->abfd);
len = 0;
}
}
@@ -327,7 +327,7 @@ output_one_cref (fp, h)
putc (' ', fp);
++len;
}
- finfo (fp, "%B\n", r->abfd);
+ lfinfo (fp, "%B\n", r->abfd);
len = 0;
}
}
diff --git a/contrib/binutils/ld/ldctor.c b/contrib/binutils/ld/ldctor.c
index d986f32..6e40938 100644
--- a/contrib/binutils/ld/ldctor.c
+++ b/contrib/binutils/ld/ldctor.c
@@ -139,7 +139,7 @@ ldctor_build_sets ()
{
struct set_element *e;
reloc_howto_type *howto;
- int size;
+ int reloc_size, size;
/* If the symbol is defined, we may have been invoked from
collect, and the sets may already have been built, so we do
@@ -184,12 +184,18 @@ ldctor_build_sets ()
}
}
- switch (bfd_get_reloc_size (howto))
+ reloc_size = bfd_get_reloc_size (howto);
+ switch (reloc_size)
{
case 1: size = BYTE; break;
case 2: size = SHORT; break;
case 4: size = LONG; break;
- case 8: size = QUAD; break;
+ case 8:
+ if (howto->complain_on_overflow == complain_overflow_signed)
+ size = SQUAD;
+ else
+ size = QUAD;
+ break;
default:
einfo ("%P%X: Unsupported size %d for set %s\n",
bfd_get_reloc_size (howto), p->h->root.string);
@@ -197,6 +203,9 @@ ldctor_build_sets ()
break;
}
+ lang_add_assignment (exp_assop ('=', ".",
+ exp_unop (ALIGN_K,
+ exp_intop (reloc_size))));
lang_add_assignment (exp_assop ('=', p->h->root.string,
exp_nameop (NAME, ".")));
lang_add_data (size, exp_intop ((bfd_vma) p->count));
diff --git a/contrib/binutils/ld/ldemul.c b/contrib/binutils/ld/ldemul.c
index c6fe25b..41cc544 100644
--- a/contrib/binutils/ld/ldemul.c
+++ b/contrib/binutils/ld/ldemul.c
@@ -239,7 +239,7 @@ ldemul_choose_mode(target)
}
}
einfo ("%P: unrecognised emulation mode: %s\n", target);
- einfo ("Supported emulations: ", program_name);
+ einfo ("Supported emulations: ");
ldemul_list_emulations (stderr);
einfo ("%F\n");
}
diff --git a/contrib/binutils/ld/ldexp.c b/contrib/binutils/ld/ldexp.c
index f24ce79..3471621 100644
--- a/contrib/binutils/ld/ldexp.c
+++ b/contrib/binutils/ld/ldexp.c
@@ -1,5 +1,5 @@
/* This module handles expression trees.
-Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support (sac@cygnus.com).
This file is part of GLD, the Gnu Linker.
@@ -15,8 +15,9 @@ 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 GLD; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+along with GLD; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
/*
This module is in charge of working out the contents of expressions.
@@ -106,6 +107,7 @@ exp_print_token (code)
{ SEARCH_DIR,"SEARCH_DIR" },
{ MAP,"MAP" },
{ QUAD,"QUAD" },
+ { SQUAD,"SQUAD" },
{ LONG,"LONG" },
{ SHORT,"SHORT" },
{ BYTE,"BYTE" },
@@ -391,16 +393,26 @@ fold_name (tree, current_section, allocation_done, dot)
else if (allocation_done == lang_final_phase_enum
|| allocation_done == lang_allocating_phase_enum)
{
- lang_output_section_statement_type *os;
-
- os = (lang_output_section_statement_lookup
- (h->u.def.section->output_section->name));
-
- /* FIXME: Is this correct if this section is being
- linked with -R? */
- result = new_rel ((h->u.def.value
- + h->u.def.section->output_offset),
- os);
+ asection *output_section;
+
+ output_section = h->u.def.section->output_section;
+ if (output_section == NULL)
+ einfo ("%X%S: unresolvable symbol `%s' referenced in expression\n",
+ tree->name.name);
+ else
+ {
+ lang_output_section_statement_type *os;
+
+ os = (lang_output_section_statement_lookup
+ (bfd_get_section_name (output_bfd,
+ output_section)));
+
+ /* FIXME: Is this correct if this section is
+ being linked with -R? */
+ result = new_rel ((h->u.def.value
+ + h->u.def.section->output_offset),
+ os);
+ }
}
}
else if (allocation_done == lang_final_phase_enum)
diff --git a/contrib/binutils/ld/ldfile.c b/contrib/binutils/ld/ldfile.c
index a1f2b49..3597c4e 100644
--- a/contrib/binutils/ld/ldfile.c
+++ b/contrib/binutils/ld/ldfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 1998 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -13,8 +13,9 @@ 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 GLD; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+along with GLD; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
/*
ldfile.c
@@ -49,8 +50,12 @@ search_dirs_type *search_head;
#ifdef VMS
char *slash = "";
#else
+#if defined (_WIN32) && ! defined (__CYGWIN32__)
+char *slash = "\\";
+#else
char *slash = "/";
#endif
+#endif
#else /* MPW */
/* The MPW path char is a colon. */
char *slash = ":";
@@ -155,7 +160,13 @@ ldfile_open_file_search (arch, entry, lib, suffix)
if (entry->is_archive)
sprintf (string, "%s%s%s%s%s%s", search->name, slash,
lib, entry->filename, arch, suffix);
- else if (entry->filename[0] == '/' || entry->filename[0] == '.')
+ else if (entry->filename[0] == '/' || entry->filename[0] == '.'
+#if defined (__MSDOS__) || defined (_WIN32)
+ || entry->filename[0] == '\\'
+ || (isalpha (entry->filename[0])
+ && entry->filename[1] == ':')
+#endif
+ )
strcpy (string, entry->filename);
else
sprintf (string, "%s%s%s", search->name, slash, entry->filename);
@@ -266,7 +277,7 @@ ldfile_find_command_file (name, extend)
for (search = search_head;
search != (search_dirs_type *)NULL;
search = search->next) {
- sprintf(buffer,"%s/%s", search->name, name);
+ sprintf(buffer,"%s%s%s", search->name, slash, name);
result = try_open(buffer, extend);
if (result)break;
}
@@ -369,10 +380,12 @@ ldfile_add_arch (in_name)
new->name = name;
new->next = (search_arch_type*)NULL;
- while (*name) {
- if (isupper(*name)) *name = tolower(*name);
- name++;
- }
+ while (*name)
+ {
+ if (isupper ((unsigned char) *name))
+ *name = tolower ((unsigned char) *name);
+ name++;
+ }
*search_arch_tail_ptr = new;
search_arch_tail_ptr = &new->next;
diff --git a/contrib/binutils/ld/ldgram.y b/contrib/binutils/ld/ldgram.y
index 87bf928..4023770 100644
--- a/contrib/binutils/ld/ldgram.y
+++ b/contrib/binutils/ld/ldgram.y
@@ -111,7 +111,7 @@ static int error_index;
%right UNARY
%token END
%left <token> '('
-%token <token> ALIGN_K BLOCK BIND QUAD LONG SHORT BYTE
+%token <token> ALIGN_K BLOCK BIND QUAD SQUAD LONG SHORT BYTE
%token SECTIONS PHDRS
%token '{' '}'
%token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH
@@ -132,7 +132,7 @@ static int error_index;
%token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
%token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START
%token <name> VERS_TAG VERS_IDENTIFIER
-%token GLOBAL LOCAL VERSION INPUT_VERSION_SCRIPT
+%token GLOBAL LOCAL VERSIONK INPUT_VERSION_SCRIPT
%type <versyms> vers_defns
%type <versnode> vers_tag
%type <deflist> verdep
@@ -447,6 +447,8 @@ statement_list_opt:
length:
QUAD
{ $$ = $1; }
+ | SQUAD
+ { $$ = $1; }
| LONG
{ $$ = $1; }
| SHORT
@@ -538,7 +540,9 @@ memory_spec: NAME
region->origin =
exp_get_vma($3, 0L,"origin", lang_first_phase_enum);
}
- ; length_spec:
+ ;
+
+length_spec:
LENGTH '=' mustbe_exp
{ region->length = exp_get_vma($3,
~((bfd_vma)0),
@@ -550,7 +554,7 @@ memory_spec: NAME
attributes_opt:
'(' NAME ')'
{
- lang_set_flags(&region->flags, $2);
+ lang_set_flags(region, $2);
}
|
@@ -763,6 +767,7 @@ type:
atype:
'(' type ')'
| /* EMPTY */ { sectype = normal_section; }
+ | '(' ')' { sectype = normal_section; }
;
opt_exp_with_type:
@@ -935,7 +940,7 @@ version:
{
ldlex_version_script ();
}
- VERSION '{' vers_nodes '}'
+ VERSIONK '{' vers_nodes '}'
{
ldlex_popstate ();
}
diff --git a/contrib/binutils/ld/ldlang.c b/contrib/binutils/ld/ldlang.c
index 19aedf4..6cdab2b 100644
--- a/contrib/binutils/ld/ldlang.c
+++ b/contrib/binutils/ld/ldlang.c
@@ -1,5 +1,6 @@
/* Linker command language support.
- Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -128,6 +129,7 @@ static bfd_vma size_input_section
lang_output_section_statement_type *output_section_statement,
fill_type fill, bfd_vma dot, boolean relax));
static void lang_finish PARAMS ((void));
+static void ignore_bfd_errors PARAMS ((const char *, ...));
static void lang_check PARAMS ((void));
static void lang_common PARAMS ((void));
static boolean lang_one_common PARAMS ((struct bfd_link_hash_entry *, PTR));
@@ -412,8 +414,7 @@ lang_memory_region_type *
lang_memory_region_lookup (name)
CONST char *CONST name;
{
-
- lang_memory_region_type *p = lang_memory_region_list;
+ lang_memory_region_type *p;
for (p = lang_memory_region_list;
p != (lang_memory_region_type *) NULL;
@@ -451,6 +452,8 @@ lang_memory_region_lookup (name)
*lang_memory_region_list_tail = new;
lang_memory_region_list_tail = &new->next;
new->origin = 0;
+ new->flags = 0;
+ new->not_flags = 0;
new->length = ~(bfd_size_type)0;
new->current = 0;
new->had_full_message = false;
@@ -460,6 +463,31 @@ lang_memory_region_lookup (name)
}
+lang_memory_region_type *
+lang_memory_default (section)
+ asection *section;
+{
+ lang_memory_region_type *p;
+
+ flagword sec_flags = section->flags;
+
+ /* Override SEC_DATA to mean a writable section. */
+ if ((sec_flags & (SEC_ALLOC | SEC_READONLY | SEC_CODE)) == SEC_ALLOC)
+ sec_flags |= SEC_DATA;
+
+ for (p = lang_memory_region_list;
+ p != (lang_memory_region_type *) NULL;
+ p = p->next)
+ {
+ if ((p->flags & sec_flags) != 0
+ && (p->not_flags & sec_flags) == 0)
+ {
+ return p;
+ }
+ }
+ return lang_memory_region_lookup ("*default*");
+}
+
lang_output_section_statement_type *
lang_output_section_find (name)
CONST char *CONST name;
@@ -518,14 +546,34 @@ lang_output_section_statement_lookup (name)
return lookup;
}
+static void
+lang_map_flags (flag)
+ flagword flag;
+{
+ if (flag & SEC_ALLOC)
+ minfo ("a");
+
+ if (flag & SEC_CODE)
+ minfo ("x");
+
+ if (flag & SEC_READONLY)
+ minfo ("r");
+
+ if (flag & SEC_DATA)
+ minfo ("w");
+
+ if (flag & SEC_LOAD)
+ minfo ("l");
+}
+
void
lang_map ()
{
lang_memory_region_type *m;
minfo ("\nMemory Configuration\n\n");
- fprintf (config.map_file, "%-16s %-18s %-18s\n",
- "Name", "Origin", "Length");
+ fprintf (config.map_file, "%-16s %-18s %-18s %s\n",
+ "Name", "Origin", "Length", "Attributes");
for (m = lang_memory_region_list;
m != (lang_memory_region_type *) NULL;
@@ -545,7 +593,26 @@ lang_map ()
++len;
}
- minfo ("0x%V\n", m->length);
+ minfo ("0x%V", m->length);
+ if (m->flags || m->not_flags)
+ {
+#ifndef BFD64
+ minfo (" ");
+#endif
+ if (m->flags)
+ {
+ print_space ();
+ lang_map_flags (m->flags);
+ }
+
+ if (m->not_flags)
+ {
+ minfo (" !");
+ lang_map_flags (m->not_flags);
+ }
+ }
+
+ print_nl ();
}
fprintf (config.map_file, "\nLinker script and memory map\n\n");
@@ -737,7 +804,11 @@ section_already_linked (abfd, sec, data)
explicit actions, like foo.o(.text), bar.o(.text) and
foo.o(.text, .data). */
-/* Return true if the PATTERN argument is a wildcard pattern. */
+/* Return true if the PATTERN argument is a wildcard pattern.
+ Although backslashes are treated specially if a pattern contains
+ wildcards, we do not consider the mere presence of a backslash to
+ be enough to cause the the pattern to be treated as a wildcard.
+ That lets us handle DOS filenames more naturally. */
static boolean
wildcardp (pattern)
@@ -747,7 +818,6 @@ wildcardp (pattern)
for (s = pattern; *s != '\0'; ++s)
if (*s == '?'
- || *s == '\\'
|| *s == '*'
|| *s == '[')
return true;
@@ -801,10 +871,17 @@ wild_doit (ptr, section, output, file)
if (section->output_section == NULL)
{
+ boolean first;
lang_input_section_type *new;
+ flagword flags;
if (output->bfd_section == NULL)
- init_os (output);
+ {
+ init_os (output);
+ first = true;
+ }
+ else
+ first = false;
/* Add a section reference to the list */
new = new_stat (lang_input_section, ptr);
@@ -813,23 +890,38 @@ wild_doit (ptr, section, output, file)
new->ifile = file;
section->output_section = output->bfd_section;
+ flags = section->flags;
+
/* We don't copy the SEC_NEVER_LOAD flag from an input section
to an output section, because we want to be able to include a
SEC_NEVER_LOAD section in the middle of an otherwise loaded
section (I don't know why we want to do this, but we do).
build_link_order in ldwrite.c handles this case by turning
- the embedded SEC_NEVER_LOAD section into a fill.
+ the embedded SEC_NEVER_LOAD section into a fill. */
+
+ flags &= ~ SEC_NEVER_LOAD;
+
+ /* If final link, don't copy the SEC_LINK_ONCE flags, they've
+ already been processed. One reason to do this is that on pe
+ format targets, .text$foo sections go into .text and it's odd
+ to see .text with SEC_LINK_ONCE set. */
+
+ if (! link_info.relocateable)
+ flags &= ~ (SEC_LINK_ONCE | SEC_LINK_DUPLICATES);
+
+ /* If this is not the first input section, and the SEC_READONLY
+ flag is not currently set, then don't set it just because the
+ input section has it set. */
+
+ if (! first && (section->output_section->flags & SEC_READONLY) == 0)
+ flags &= ~ SEC_READONLY;
- If final link, don't copy the SEC_LINK_ONCE flags, they've already
- been processed. One reason to do this is that on pe format targets,
- .text$foo sections go into .text and it's odd to see .text with
- SEC_LINK_ONCE set. */
+ section->output_section->flags |= flags;
- section->output_section->flags |=
- section->flags & (flagword) (~ (SEC_NEVER_LOAD
- | (! link_info.relocateable
- ? SEC_LINK_ONCE | SEC_LINK_DUPLICATES
- : 0)));
+ /* If SEC_READONLY is not set in the input section, then clear
+ it from the output section. */
+ if ((section->flags & SEC_READONLY) == 0)
+ section->output_section->flags &= ~SEC_READONLY;
switch (output->sectype)
{
@@ -1367,7 +1459,7 @@ lang_place_undefineds ()
h = bfd_link_hash_lookup (link_info.hash, ptr->name, true, false, true);
if (h == (struct bfd_link_hash_entry *) NULL)
- einfo ("%P%F: bfd_link_hash_lookup failed: %E");
+ einfo ("%P%F: bfd_link_hash_lookup failed: %E\n");
if (h->type == bfd_link_hash_new)
{
h->type = bfd_link_hash_undefined;
@@ -1672,6 +1764,10 @@ print_data_statement (data)
size = QUAD_SIZE;
name = "QUAD";
break;
+ case SQUAD:
+ size = QUAD_SIZE;
+ name = "SQUAD";
+ break;
}
minfo ("0x%V %W %s 0x%v", addr, size, name, data->value);
@@ -2047,7 +2143,7 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
if (os->children.head == NULL
|| os->children.head->next != NULL
|| os->children.head->header.type != lang_input_section_enum)
- einfo ("%P%X: Internal error on COFF shared library section %s",
+ einfo ("%P%X: Internal error on COFF shared library section %s\n",
os->name);
input = os->children.head->input_section.section;
@@ -2070,10 +2166,28 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
/* No address specified for this section, get one
from the region specification
*/
- if (os->region == (lang_memory_region_type *) NULL)
+ if (os->region == (lang_memory_region_type *) NULL
+ || (((bfd_get_section_flags (output_bfd, os->bfd_section)
+ & (SEC_ALLOC | SEC_LOAD)) != 0)
+ && os->region->name[0] == '*'
+ && strcmp (os->region->name, "*default*") == 0))
{
- os->region = lang_memory_region_lookup ("*default*");
+ os->region = lang_memory_default (os->bfd_section);
}
+
+ /* If a loadable section is using the default memory
+ region, and some non default memory regions were
+ defined, issue a warning. */
+ if ((bfd_get_section_flags (output_bfd, os->bfd_section)
+ & (SEC_ALLOC | SEC_LOAD)) != 0
+ && ! link_info.relocateable
+ && strcmp (os->region->name, "*default*") == 0
+ && lang_memory_region_list != NULL
+ && (strcmp (lang_memory_region_list->name, "*default*") != 0
+ || lang_memory_region_list->next != NULL))
+ einfo ("%P: warning: no memory region specified for section `%s'\n",
+ bfd_get_section_name (output_bfd, os->bfd_section));
+
dot = os->region->current;
if (os->section_alignment == -1)
{
@@ -2177,21 +2291,22 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
output_section_statement->bfd_section;
switch (s->data_statement.type)
- {
- case QUAD:
- size = QUAD_SIZE;
- break;
- case LONG:
- size = LONG_SIZE;
- break;
- case SHORT:
- size = SHORT_SIZE;
- break;
- case BYTE:
- size = BYTE_SIZE;
- break;
+ {
+ case QUAD:
+ case SQUAD:
+ size = QUAD_SIZE;
+ break;
+ case LONG:
+ size = LONG_SIZE;
+ break;
+ case SHORT:
+ size = SHORT_SIZE;
+ break;
+ case BYTE:
+ size = BYTE_SIZE;
+ break;
+ }
- }
dot += size;
output_section_statement->bfd_section->_raw_size += size;
/* The output section gets contents, and then we inspect for
@@ -2415,6 +2530,7 @@ lang_do_assignments (s, output_section_statement, fill, dot)
switch (s->data_statement.type)
{
case QUAD:
+ case SQUAD:
dot += QUAD_SIZE;
break;
case LONG:
@@ -2599,6 +2715,20 @@ lang_finish ()
}
}
+/* This is a small function used when we want to ignore errors from
+ BFD. */
+
+static void
+#ifdef ANSI_PROTOTYPES
+ignore_bfd_errors (const char *s, ...)
+#else
+ignore_bfd_errors (s)
+ const char *s;
+#endif
+{
+ /* Don't do anything. */
+}
+
/* Check that the architecture of all the input files is compatible
with the output file. Also call the backend to let it do any
other checking that is needed. */
@@ -2618,12 +2748,32 @@ lang_check ()
compatible = bfd_arch_get_compatible (input_bfd,
output_bfd);
if (compatible == NULL)
- einfo ("%P: warning: %s architecture of input file `%B' is incompatible with %s output\n",
- bfd_printable_name (input_bfd), input_bfd,
- bfd_printable_name (output_bfd));
-
+ {
+ if (command_line.warn_mismatch)
+ einfo ("%P: warning: %s architecture of input file `%B' is incompatible with %s output\n",
+ bfd_printable_name (input_bfd), input_bfd,
+ bfd_printable_name (output_bfd));
+ }
else
- bfd_merge_private_bfd_data (input_bfd, output_bfd);
+ {
+ bfd_error_handler_type pfn = NULL;
+
+ /* If we aren't supposed to warn about mismatched input
+ files, temporarily set the BFD error handler to a
+ function which will do nothing. We still want to call
+ bfd_merge_private_bfd_data, since it may set up
+ information which is needed in the output file. */
+ if (! command_line.warn_mismatch)
+ pfn = bfd_set_error_handler (ignore_bfd_errors);
+ if (! bfd_merge_private_bfd_data (input_bfd, output_bfd))
+ {
+ if (command_line.warn_mismatch)
+ einfo ("%E%X: failed to merge target specific data of file %B\n",
+ input_bfd);
+ }
+ if (! command_line.warn_mismatch)
+ bfd_set_error_handler (pfn);
+ }
}
}
@@ -2820,36 +2970,41 @@ lang_place_orphans ()
void
lang_set_flags (ptr, flags)
- int *ptr;
+ lang_memory_region_type *ptr;
CONST char *flags;
{
- boolean state = false;
+ flagword *ptr_flags = &ptr->flags;
- *ptr = 0;
+ ptr->flags = ptr->not_flags = 0;
while (*flags)
{
- if (*flags == '!')
- {
- state = false;
- flags++;
- }
- else
- state = true;
switch (*flags)
{
- case 'R':
- /* ptr->flag_read = state; */
+ case '!':
+ ptr_flags = (ptr_flags == &ptr->flags) ? &ptr->not_flags : &ptr->flags;
+ break;
+
+ case 'A': case 'a':
+ *ptr_flags |= SEC_ALLOC;
+ break;
+
+ case 'R': case 'r':
+ *ptr_flags |= SEC_READONLY;
break;
- case 'W':
- /* ptr->flag_write = state; */
+
+ case 'W': case 'w':
+ *ptr_flags |= SEC_DATA;
break;
- case 'X':
- /* ptr->flag_executable= state;*/
+
+ case 'X': case 'x':
+ *ptr_flags |= SEC_CODE;
break;
- case 'L':
- case 'I':
- /* ptr->flag_loadable= state;*/
+
+ case 'L': case 'l':
+ case 'I': case 'i':
+ *ptr_flags |= SEC_LOAD;
break;
+
default:
einfo ("%P%F: invalid syntax in flags\n");
break;
@@ -3757,7 +3912,7 @@ lang_leave_overlay_section (fill, phdrs)
clean = xmalloc (strlen (name) + 1);
s2 = clean;
for (s1 = name; *s1 != '\0'; s1++)
- if (isalnum (*s1) || *s1 == '_')
+ if (isalnum ((unsigned char) *s1) || *s1 == '_')
*s2++ = *s1;
*s2 = '\0';
@@ -3910,11 +4065,6 @@ lang_register_vers_node (name, version, deps)
{
struct bfd_elf_version_expr *e2;
- for (e2 = t->globals; e2 != NULL; e2 = e2->next)
- if (strcmp (e1->match, e2->match) == 0)
- einfo ("%X%P: duplicate expression `%s' in version information\n",
- e1->match);
-
for (e2 = t->locals; e2 != NULL; e2 = e2->next)
if (strcmp (e1->match, e2->match) == 0)
einfo ("%X%P: duplicate expression `%s' in version information\n",
@@ -3932,11 +4082,6 @@ lang_register_vers_node (name, version, deps)
if (strcmp (e1->match, e2->match) == 0)
einfo ("%X%P: duplicate expression `%s' in version information\n",
e1->match);
-
- for (e2 = t->locals; e2 != NULL; e2 = e2->next)
- if (strcmp (e1->match, e2->match) == 0)
- einfo ("%X%P: duplicate expression `%s' in version information\n",
- e1->match);
}
}
diff --git a/contrib/binutils/ld/ldlang.h b/contrib/binutils/ld/ldlang.h
index 492351d..60edc0f 100644
--- a/contrib/binutils/ld/ldlang.h
+++ b/contrib/binutils/ld/ldlang.h
@@ -47,7 +47,8 @@ typedef struct memory_region_struct
bfd_size_type length;
bfd_vma current;
bfd_size_type old_length;
- int flags;
+ flagword flags;
+ flagword not_flags;
boolean had_full_message;
} lang_memory_region_type ;
@@ -131,7 +132,7 @@ typedef struct lang_output_section_statement_struct
boolean processed;
asection *bfd_section;
- int flags; /* Or together of all input sections */
+ flagword flags; /* Or together of all input sections */
enum section_type sectype;
struct memory_region_struct *region;
size_t block_value;
@@ -375,8 +376,10 @@ extern boolean entry_from_cmdline;
extern void lang_init PARAMS ((void));
extern struct memory_region_struct *lang_memory_region_lookup
PARAMS ((const char *const));
+extern struct memory_region_struct *lang_memory_region_default
+ PARAMS ((asection *));
extern void lang_map PARAMS ((void));
-extern void lang_set_flags PARAMS ((int *, const char *));
+extern void lang_set_flags PARAMS ((lang_memory_region_type *, const char *));
extern void lang_add_output PARAMS ((const char *, int from_script));
extern void lang_enter_output_section_statement
PARAMS ((const char *output_section_statement_name,
diff --git a/contrib/binutils/ld/ldlex.h b/contrib/binutils/ld/ldlex.h
index f824ec8..53444ca 100644
--- a/contrib/binutils/ld/ldlex.h
+++ b/contrib/binutils/ld/ldlex.h
@@ -14,8 +14,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GLD; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with GLD; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#ifndef LDLEX_H
#define LDLEX_H
@@ -33,7 +34,6 @@ typedef enum input_enum {
extern input_type parser_input;
-extern int hex_mode;
extern unsigned int lineno;
extern const char *lex_string;
diff --git a/contrib/binutils/ld/ldlex.l b/contrib/binutils/ld/ldlex.l
index 60089c6..dfdf737 100644
--- a/contrib/binutils/ld/ldlex.l
+++ b/contrib/binutils/ld/ldlex.l
@@ -1,6 +1,7 @@
%{
-/* Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -15,8 +16,9 @@ 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 GLD; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+along with GLD; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
/*
This was written by steve chamberlain
@@ -48,9 +50,6 @@ This was written by steve chamberlain
yylex and yyparse (indirectly) both check this. */
input_type parser_input;
-/* Radix to use for bfd_scan_vma -- 0 (default to base 10) or 16. */
-int hex_mode;
-
/* Line number in the current input file.
(FIXME Actually, it doesn't appear to get reset for each file?) */
unsigned int lineno = 1;
@@ -115,7 +114,7 @@ WHITE [ \t\n\r]+
NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
V_TAG [.$_a-zA-Z][._a-zA-Z0-9]*
-V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
+V_IDENTIFIER [*?.$_a-zA-Z][*?_a-zA-Z0-9]*
%s SCRIPT
%s EXPRESSION
@@ -179,17 +178,18 @@ V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
ibase);
return INT;
}
-<SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>"$"?"0x"?([0-9A-Fa-f])+(M|K|m|k)? {
- yylval.integer = bfd_scan_vma (yytext, 0,
- hex_mode);
- if (yytext[yyleng-1]=='M'
- || yytext[yyleng-1] == 'm') {
- yylval.integer *= 1024*1024;
- }
- if (yytext[yyleng-1]=='K'
- || yytext[yyleng-1]=='k') {
- yylval.integer *= 1024;
- }
+<SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>((("$"|"0x")([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? {
+ char *s = yytext;
+
+ if (*s == '$')
+ ++s;
+ yylval.integer = bfd_scan_vma (s, 0, 0);
+ if (yytext[yyleng-1] == 'M'
+ || yytext[yyleng-1] == 'm')
+ yylval.integer *= 1024 * 1024;
+ if (yytext[yyleng-1] == 'K'
+ || yytext[yyleng-1]=='k')
+ yylval.integer *= 1024;
return INT;
}
<BOTH,SCRIPT,EXPRESSION,MRI>"]" { RTOKEN(']');}
@@ -232,7 +232,7 @@ V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
<BOTH,SCRIPT,EXPRESSION,MRI>";" { RTOKEN(';');}
<BOTH,SCRIPT>"MEMORY" { RTOKEN(MEMORY);}
<BOTH,SCRIPT>"ORIGIN" { RTOKEN(ORIGIN);}
-<BOTH,SCRIPT>"VERSION" { RTOKEN(VERSION);}
+<BOTH,SCRIPT>"VERSION" { RTOKEN(VERSIONK);}
<EXPRESSION,BOTH,SCRIPT>"BLOCK" { RTOKEN(BLOCK);}
<EXPRESSION,BOTH,SCRIPT>"BIND" { RTOKEN(BIND);}
<BOTH,SCRIPT>"LENGTH" { RTOKEN(LENGTH);}
@@ -265,6 +265,7 @@ V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
<BOTH,SCRIPT>"SYSLIB" { RTOKEN(SYSLIB);}
<BOTH,SCRIPT>"FLOAT" { RTOKEN(FLOAT);}
<BOTH,SCRIPT>"QUAD" { RTOKEN( QUAD);}
+<BOTH,SCRIPT>"SQUAD" { RTOKEN( SQUAD);}
<BOTH,SCRIPT>"LONG" { RTOKEN( LONG);}
<BOTH,SCRIPT>"SHORT" { RTOKEN( SHORT);}
<BOTH,SCRIPT>"BYTE" { RTOKEN( BYTE);}
@@ -284,9 +285,8 @@ V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
<BOTH,SCRIPT>"PHDRS" { RTOKEN (PHDRS); }
<EXPRESSION,BOTH,SCRIPT>"AT" { RTOKEN(AT);}
<EXPRESSION,BOTH,SCRIPT>"PROVIDE" { RTOKEN(PROVIDE); }
-<MRI>"#".*\n?\r? { ++ lineno; }
+<MRI>"#".*\n? { ++ lineno; }
<MRI>"\n" { ++ lineno; RTOKEN(NEWLINE); }
-<MRI>"\r" { ++ lineno; RTOKEN(NEWLINE); }
<MRI>"*".* { /* Mri comment line */ }
<MRI>";".* { /* Mri comment line */ }
<MRI>"END" { RTOKEN(ENDWORD); }
@@ -341,7 +341,22 @@ V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
yylval.name = buystring (yytext + 2);
return LNAME;
}
-<SCRIPT>{WILDCHAR}* { yylval.name = buystring(yytext); return NAME; }
+<SCRIPT>{WILDCHAR}* {
+ /* Annoyingly, this pattern can match comments, and we have
+ longest match issues to consider. So if the first two
+ characters are a comment opening, put the input back and
+ try again. */
+ if (yytext[0] == '/' && yytext[1] == '*')
+ {
+ yyless(2);
+ comment ();
+ }
+ else
+ {
+ yylval.name = buystring(yytext);
+ return NAME;
+ }
+ }
<EXPRESSION,BOTH,SCRIPT>"\""[^\"]*"\"" {
/* No matter the state, quotes
@@ -351,8 +366,7 @@ V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
return NAME;
}
<BOTH,SCRIPT,EXPRESSION>"\n" { lineno++;}
-<BOTH,SCRIPT,EXPRESSION>"\r" { lineno++;}
-<MRI,BOTH,SCRIPT,EXPRESSION>[ \t]
+<MRI,BOTH,SCRIPT,EXPRESSION>[ \t\r]+ { }
<VERS_NODE,VERS_SCRIPT>[:,;] { return *yytext; }
@@ -371,11 +385,11 @@ V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
<VERS_SCRIPT>"{" { BEGIN(VERS_NODE); return *yytext; }
<VERS_SCRIPT,VERS_NODE>"}" { BEGIN(VERS_SCRIPT); return *yytext; }
-<VERS_START,VERS_NODE,VERS_SCRIPT>[\n\r] { lineno++; }
+<VERS_START,VERS_NODE,VERS_SCRIPT>[\n] { lineno++; }
<VERS_START,VERS_NODE,VERS_SCRIPT>#.* { /* Eat up comments */ }
-<VERS_START,VERS_NODE,VERS_SCRIPT>[ \t]+ { /* Eat up whitespace */ }
+<VERS_START,VERS_NODE,VERS_SCRIPT>[ \t\r]+ { /* Eat up whitespace */ }
<<EOF>> {
include_stack_ptr--;
@@ -562,7 +576,7 @@ yy_input (buf, result, max_size)
{
*result = read (fileno (yyin), (char *) buf, max_size);
if (*result < 0)
- einfo ("%F%P: read in flex scanner failed");
+ einfo ("%F%P: read in flex scanner failed\n");
}
}
}
@@ -579,7 +593,7 @@ comment ()
c = input();
while (c != '*' && c != EOF)
{
- if (c == '\n' || c == '\r')
+ if (c == '\n')
lineno++;
c = input();
}
@@ -593,7 +607,7 @@ comment ()
break; /* found the end */
}
- if (c == '\n' || c == '\r')
+ if (c == '\n')
lineno++;
if (c == EOF)
diff --git a/contrib/binutils/ld/ldmain.c b/contrib/binutils/ld/ldmain.c
index 94b9b57..97fed9d 100644
--- a/contrib/binutils/ld/ldmain.c
+++ b/contrib/binutils/ld/ldmain.c
@@ -191,6 +191,7 @@ main (argc, argv)
command_line.force_common_definition = false;
command_line.interpreter = NULL;
command_line.rpath = NULL;
+ command_line.warn_mismatch = true;
link_info.callbacks = &link_callbacks;
link_info.relocateable = false;
diff --git a/contrib/binutils/ld/ldmisc.c b/contrib/binutils/ld/ldmisc.c
index 282ce22..a292d40 100644
--- a/contrib/binutils/ld/ldmisc.c
+++ b/contrib/binutils/ld/ldmisc.c
@@ -244,10 +244,10 @@ vfinfo (fp, fmt, arg)
{
arelent *relent = va_arg (arg, arelent *);
- finfo (fp, "%s+0x%v (type %s)",
- (*(relent->sym_ptr_ptr))->name,
- relent->addend,
- relent->howto->name);
+ lfinfo (fp, "%s+0x%v (type %s)",
+ (*(relent->sym_ptr_ptr))->name,
+ relent->addend,
+ relent->howto->name);
}
break;
@@ -305,11 +305,11 @@ vfinfo (fp, fmt, arg)
{
if (functionname != NULL && fmt[-1] == 'G')
{
- finfo (fp, "%B:", abfd);
+ lfinfo (fp, "%B:", abfd);
if (filename != NULL
&& strcmp (filename, bfd_get_filename (abfd)) != 0)
fprintf (fp, "%s:", filename);
- finfo (fp, "%T", functionname);
+ lfinfo (fp, "%T", functionname);
}
else if (functionname != NULL && fmt[-1] == 'C')
{
@@ -326,8 +326,8 @@ vfinfo (fp, fmt, arg)
/* We use abfd->filename in this initial line,
in case filename is a .h file or something
similarly unhelpful. */
- finfo (fp, "%B: In function `%T':\n",
- abfd, functionname);
+ lfinfo (fp, "%B: In function `%T':\n",
+ abfd, functionname);
last_bfd = abfd;
if (last_file != NULL)
@@ -341,24 +341,25 @@ vfinfo (fp, fmt, arg)
if (linenumber != 0)
fprintf (fp, "%s:%u", filename, linenumber);
else
- finfo (fp, "%s(%s+0x%v)", filename, section->name,
- offset);
+ lfinfo (fp, "%s(%s+0x%v)", filename, section->name,
+ offset);
}
else if (filename == NULL
|| strcmp (filename, abfd->filename) == 0)
{
- finfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
+ lfinfo (fp, "%B(%s+0x%v)", abfd, section->name,
+ offset);
if (linenumber != 0)
- finfo (fp, ":%u", linenumber);
+ lfinfo (fp, ":%u", linenumber);
}
else if (linenumber != 0)
- finfo (fp, "%B:%s:%u", abfd, filename, linenumber);
+ lfinfo (fp, "%B:%s:%u", abfd, filename, linenumber);
else
- finfo (fp, "%B(%s+0x%v):%s", abfd, section->name, offset,
- filename);
+ lfinfo (fp, "%B(%s+0x%v):%s", abfd, section->name,
+ offset, filename);
}
else
- finfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
+ lfinfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
if (discard_last)
{
@@ -496,9 +497,9 @@ minfo (va_alist)
void
#if USE_STDARG
-finfo (FILE *file, const char *fmt, ...)
+lfinfo (FILE *file, const char *fmt, ...)
#else
-finfo (va_alist)
+lfinfo (va_alist)
va_dcl
#endif
{
diff --git a/contrib/binutils/ld/ldmisc.h b/contrib/binutils/ld/ldmisc.h
index f0073a7..f5b3b4f 100644
--- a/contrib/binutils/ld/ldmisc.h
+++ b/contrib/binutils/ld/ldmisc.h
@@ -24,7 +24,7 @@
extern void einfo PARAMS ((const char *, ...));
extern void minfo PARAMS ((const char *, ...));
extern void info_msg PARAMS ((const char *, ...));
-extern void finfo PARAMS ((FILE *, const char *, ...));
+extern void lfinfo PARAMS ((FILE *, const char *, ...));
#else
/* VARARGS*/
extern void einfo ();
@@ -33,7 +33,7 @@ extern void minfo ();
/* VARARGS*/
extern void info_msg ();
/*VARARGS*/
-extern void finfo ();
+extern void lfinfo ();
#endif
extern void info_assert PARAMS ((const char *, unsigned int));
diff --git a/contrib/binutils/ld/ldver.c b/contrib/binutils/ld/ldver.c
index e8dc0b8..6a5137b 100644
--- a/contrib/binutils/ld/ldver.c
+++ b/contrib/binutils/ld/ldver.c
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldemul.h"
#include "ldmain.h"
-const char *ld_program_version = "2.8.1";
+const char *ld_program_version = VERSION;
void
ldversion (noisy)
diff --git a/contrib/binutils/ld/ldwrite.c b/contrib/binutils/ld/ldwrite.c
index b4d47a0..0a18476 100644
--- a/contrib/binutils/ld/ldwrite.c
+++ b/contrib/binutils/ld/ldwrite.c
@@ -1,5 +1,6 @@
/* ldwrite.c -- write out the linked file
- Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
Written by Steve Chamberlain sac@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -48,6 +49,7 @@ build_link_order (statement)
asection *output_section;
struct bfd_link_order *link_order;
bfd_vma value;
+ boolean big_endian = false;
output_section = statement->data_statement.output_section;
ASSERT (output_section->owner == output_bfd);
@@ -67,25 +69,39 @@ build_link_order (statement)
By convention, the bfd_put routines for an unknown
endianness are big endian, so we must swap here if the
input file is little endian. */
- if (! bfd_big_endian (output_bfd)
- && ! bfd_little_endian (output_bfd))
+ if (bfd_big_endian (output_bfd))
+ big_endian = true;
+ else if (bfd_little_endian (output_bfd))
+ big_endian = false;
+ else
{
boolean swap;
swap = false;
- if (command_line.endian == ENDIAN_LITTLE)
- swap = true;
+ if (command_line.endian == ENDIAN_BIG)
+ big_endian = true;
+ else if (command_line.endian == ENDIAN_LITTLE)
+ {
+ big_endian = false;
+ swap = true;
+ }
else if (command_line.endian == ENDIAN_UNSET)
{
- LANG_FOR_EACH_INPUT_STATEMENT (s)
- {
- if (s->the_bfd != NULL)
- {
- if (bfd_little_endian (s->the_bfd))
- swap = true;
- break;
- }
- }
+ big_endian = true;
+ {
+ LANG_FOR_EACH_INPUT_STATEMENT (s)
+ {
+ if (s->the_bfd != NULL)
+ {
+ if (bfd_little_endian (s->the_bfd))
+ {
+ big_endian = false;
+ swap = true;
+ }
+ break;
+ }
+ }
+ }
}
if (swap)
@@ -95,9 +111,14 @@ build_link_order (statement)
switch (statement->data_statement.type)
{
case QUAD:
- bfd_putl64 (value, buffer);
- value = bfd_getb64 (buffer);
- break;
+ case SQUAD:
+ if (sizeof (bfd_vma) >= QUAD_SIZE)
+ {
+ bfd_putl64 (value, buffer);
+ value = bfd_getb64 (buffer);
+ break;
+ }
+ /* Fall through. */
case LONG:
bfd_putl32 (value, buffer);
value = bfd_getb32 (buffer);
@@ -118,7 +139,26 @@ build_link_order (statement)
switch (statement->data_statement.type)
{
case QUAD:
- bfd_put_64 (output_bfd, value, link_order->u.data.contents);
+ case SQUAD:
+ if (sizeof (bfd_vma) >= QUAD_SIZE)
+ bfd_put_64 (output_bfd, value, link_order->u.data.contents);
+ else
+ {
+ bfd_vma high;
+
+ if (statement->data_statement.type == QUAD)
+ high = 0;
+ else if ((value & 0x80000000) == 0)
+ high = 0;
+ else
+ high = (bfd_vma) -1;
+ bfd_put_32 (output_bfd, high,
+ (link_order->u.data.contents
+ + (big_endian ? 0 : 4)));
+ bfd_put_32 (output_bfd, value,
+ (link_order->u.data.contents
+ + (big_endian ? 4 : 0)));
+ }
link_order->size = QUAD_SIZE;
break;
case LONG:
diff --git a/contrib/binutils/ld/lexsup.c b/contrib/binutils/ld/lexsup.c
index 2ca3d23..257c2f8 100644
--- a/contrib/binutils/ld/lexsup.c
+++ b/contrib/binutils/ld/lexsup.c
@@ -1,5 +1,6 @@
/* Parse options for the GNU linker.
- Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
+ Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -14,8 +15,9 @@ 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 GLD; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+along with GLD; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -36,6 +38,14 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307
#include "ldver.h"
#include "ldemul.h"
+#ifndef PATH_SEPARATOR
+#if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN32__))
+#define PATH_SEPARATOR ';'
+#else
+#define PATH_SEPARATOR ':'
+#endif
+#endif
+
/* Somewhere above, sys/stat.h got included . . . . */
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
@@ -68,7 +78,8 @@ int parsing_defsym = 0;
#define OPTION_IGNORE (OPTION_HELP + 1)
#define OPTION_MAP (OPTION_IGNORE + 1)
#define OPTION_NO_KEEP_MEMORY (OPTION_MAP + 1)
-#define OPTION_NOINHIBIT_EXEC (OPTION_NO_KEEP_MEMORY + 1)
+#define OPTION_NO_WARN_MISMATCH (OPTION_NO_KEEP_MEMORY + 1)
+#define OPTION_NOINHIBIT_EXEC (OPTION_NO_WARN_MISMATCH + 1)
#define OPTION_NON_SHARED (OPTION_NOINHIBIT_EXEC + 1)
#define OPTION_NO_WHOLE_ARCHIVE (OPTION_NON_SHARED + 1)
#define OPTION_OFORMAT (OPTION_NO_WHOLE_ARCHIVE + 1)
@@ -81,7 +92,8 @@ int parsing_defsym = 0;
#define OPTION_SORT_COMMON (OPTION_SONAME + 1)
#define OPTION_STATS (OPTION_SORT_COMMON + 1)
#define OPTION_SYMBOLIC (OPTION_STATS + 1)
-#define OPTION_TBSS (OPTION_SYMBOLIC + 1)
+#define OPTION_TASK_LINK (OPTION_SYMBOLIC + 1)
+#define OPTION_TBSS (OPTION_TASK_LINK + 1)
#define OPTION_TDATA (OPTION_TBSS + 1)
#define OPTION_TTEXT (OPTION_TDATA + 1)
#define OPTION_TRADITIONAL_FORMAT (OPTION_TTEXT + 1)
@@ -246,6 +258,8 @@ static const struct ld_option ld_options[] =
'\0', "FILE", "Write a map file", ONE_DASH },
{ {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY},
'\0', NULL, "Use less memory and more disk I/O", TWO_DASHES },
+ { {"no-warn-mismatch", no_argument, NULL, OPTION_NO_WARN_MISMATCH},
+ '\0', NULL, "Don't warn about mismatched input files", TWO_DASHES},
{ {"no-whole-archive", no_argument, NULL, OPTION_NO_WHOLE_ARCHIVE},
'\0', NULL, "Turn off --whole-archive", TWO_DASHES },
{ {"noinhibit-exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
@@ -281,6 +295,8 @@ static const struct ld_option ld_options[] =
'\0', "COUNT", "Split output sections every COUNT relocs", TWO_DASHES },
{ {"stats", no_argument, NULL, OPTION_STATS},
'\0', NULL, "Print memory usage statistics", TWO_DASHES },
+ { {"task-link", required_argument, NULL, OPTION_TASK_LINK},
+ '\0', "SYMBOL", "Do task level linking", TWO_DASHES },
{ {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
'\0', NULL, "Use same format as native linker", TWO_DASHES },
{ {"Tbss", required_argument, NULL, OPTION_TBSS},
@@ -315,7 +331,7 @@ static const struct ld_option ld_options[] =
'\0', "SYMBOL", "Use wrapper functions for SYMBOL", TWO_DASHES }
};
-#define OPTION_COUNT (sizeof ld_options / sizeof ld_options[0])
+#define OPTION_COUNT ((int) (sizeof ld_options / sizeof ld_options[0]))
void
parse_args (argc, argv)
@@ -327,6 +343,7 @@ parse_args (argc, argv)
char *default_dirlist = NULL;
char shortopts[OPTION_COUNT * 3 + 2];
struct option longopts[OPTION_COUNT + 1];
+ int last_optind;
/* Starting the short option string with '-' is for programs that
expect options and other ARGV-elements in any order and that care about
@@ -376,9 +393,10 @@ parse_args (argc, argv)
for (i = 1; i < argc; i++)
if (strcmp (argv[i], "-G") == 0
&& (i + 1 >= argc
- || ! isdigit (argv[i + 1][0])))
+ || ! isdigit ((unsigned char) argv[i + 1][0])))
argv[i] = (char *) "--shared";
+ last_optind = -1;
while (1)
{
/* getopt_long_only is like getopt_long, but '-' as well as '--' can
@@ -386,8 +404,18 @@ parse_args (argc, argv)
int longind;
int optc;
- if (ldemul_parse_args (argc, argv))
- continue;
+ /* Using last_optind lets us avoid calling ldemul_parse_args
+ multiple times on a single option, which would lead to
+ confusion in the internal static variables maintained by
+ getopt. This could otherwise happen for an argument like
+ -nx, in which the -n is parsed as a single option, and we
+ loop around to pick up the -x. */
+ if (optind != last_optind)
+ {
+ if (ldemul_parse_args (argc, argv))
+ continue;
+ last_optind = optind;
+ }
optc = getopt_long_only (argc, argv, shortopts, longopts, &longind);
@@ -553,6 +581,9 @@ parse_args (argc, argv)
case OPTION_NO_KEEP_MEMORY:
link_info.keep_memory = false;
break;
+ case OPTION_NO_WARN_MISMATCH:
+ command_line.warn_mismatch = false;
+ break;
case OPTION_NOINHIBIT_EXEC:
force_make_executable = true;
break;
@@ -679,6 +710,9 @@ parse_args (argc, argv)
case OPTION_TRADITIONAL_FORMAT:
link_info.traditional_format = true;
break;
+ case OPTION_TASK_LINK:
+ link_info.task_link = true;
+ /* Fall through - do an implied -r option. */
case OPTION_UR:
link_info.relocateable = true;
config.build_constructors = true;
@@ -826,7 +860,7 @@ set_default_dirlist (dirlist_ptr)
while (1)
{
- p = strchr (dirlist_ptr, ':');
+ p = strchr (dirlist_ptr, PATH_SEPARATOR);
if (p != NULL)
*p = '\0';
if (*dirlist_ptr != '\0')
@@ -944,5 +978,5 @@ help ()
printf ("%s: supported emulations: ", program_name);
ldemul_list_emulations (stdout);
printf ("\n");
- printf ("\nReport bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+ printf ("\nReport bugs to bug-gnu-utils@gnu.org\n");
}
diff --git a/contrib/binutils/ld/scripttempl/elf.sc b/contrib/binutils/ld/scripttempl/elf.sc
index 27f2e9d..83e589a 100644
--- a/contrib/binutils/ld/scripttempl/elf.sc
+++ b/contrib/binutils/ld/scripttempl/elf.sc
@@ -2,8 +2,10 @@
# Unusual variables checked by this code:
# NOP - two byte opcode for no-op (defaults to 0)
# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
+# INITIAL_READONLY_SECTIONS - at start of text segment
# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
# (e.g., .PARISC.milli)
+# OTHER_TEXT_SECTIONS - these get put in .text when relocating
# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
# (e.g., .PARISC.global)
# OTHER_SECTIONS - at the end
@@ -13,21 +15,29 @@
# .text section.
# DATA_START_SYMBOLS - symbols that appear at the start of the
# .data section.
+# OTHER_GOT_SYMBOLS - symbols defined just before .got.
+# OTHER_GOT_SECTIONS - sections just after .got and .sdata.
# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
# .bss section besides __bss_start.
# DATA_PLT - .plt should be in data segment, not text segment.
+# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
# EMBEDDED - whether this is for an embedded system.
+# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
+# start address of shared library.
#
# When adding sections, do note that the names of some sections are used
# when specifying the start address of the next.
#
+
test -z "$ENTRY" && ENTRY=_start
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
+test -z "${ELFSIZE}" && ELFSIZE=32
test "$LD_FLAG" = "N" && DATA_ADDR=.
INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
+DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
# if this is for an embedded system, don't add SIZEOF_HEADERS.
if [ -z "$EMBEDDED" ]; then
@@ -54,8 +64,10 @@ SECTIONS
{
/* Read-only sections, merged into text segment: */
${CREATE_SHLIB-${RELOCATING+. = ${TEXT_BASE_ADDRESS};}}
- ${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
${CREATE_SHLIB-${INTERP}}
+ ${INITIAL_READONLY_SECTIONS}
+ ${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) }
@@ -63,17 +75,17 @@ SECTIONS
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
.rel.text ${RELOCATING-0} :
- { *(.rel.text) *(.rel.gnu.linkonce.t*) }
+ { *(.rel.text) ${RELOCATING+*(.rel.gnu.linkonce.t*)} }
.rela.text ${RELOCATING-0} :
- { *(.rela.text) *(.rela.gnu.linkonce.t*) }
+ { *(.rela.text) ${RELOCATING+*(.rela.gnu.linkonce.t*)} }
.rel.data ${RELOCATING-0} :
- { *(.rel.data) *(.rel.gnu.linkonce.d*) }
+ { *(.rel.data) ${RELOCATING+*(.rel.gnu.linkonce.d*)} }
.rela.data ${RELOCATING-0} :
- { *(.rela.data) *(.rela.gnu.linkonce.d*) }
+ { *(.rela.data) ${RELOCATING+*(.rela.gnu.linkonce.d*)} }
.rel.rodata ${RELOCATING-0} :
- { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
+ { *(.rel.rodata) ${RELOCATING+*(.rel.gnu.linkonce.r*)} }
.rela.rodata ${RELOCATING-0} :
- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
+ { *(.rela.rodata) ${RELOCATING+*(.rela.gnu.linkonce.r*)} }
.rel.got ${RELOCATING-0} : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
@@ -94,26 +106,29 @@ SECTIONS
{
${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text)
+ *(.stub)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
- *(.gnu.linkonce.t*)
+ ${RELOCATING+*(.gnu.linkonce.t*)}
+ ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} =${NOP-0}
${RELOCATING+_etext = .;}
${RELOCATING+PROVIDE (etext = .);}
.fini ${RELOCATING-0} : { *(.fini) } =${NOP-0}
- .rodata ${RELOCATING-0} : { *(.rodata) *(.gnu.linkonce.r*) }
+ .rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.gnu.linkonce.r*)} }
.rodata1 ${RELOCATING-0} : { *(.rodata1) }
${RELOCATING+${OTHER_READONLY_SECTIONS}}
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
- ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};}
+ ${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
+ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};}}
.data ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}
*(.data)
- *(.gnu.linkonce.d*)
+ ${RELOCATING+*(.gnu.linkonce.d*)}
${CONSTRUCTING+CONSTRUCTORS}
}
.data1 ${RELOCATING-0} : { *(.data1) }
@@ -131,12 +146,14 @@ SECTIONS
${CONSTRUCTING+${DTOR_END}}
}
${DATA_PLT+${PLT}}
+ ${RELOCATING+${OTHER_GOT_SYMBOLS}}
.got ${RELOCATING-0} : { *(.got.plt) *(.got) }
- .dynamic ${RELOCATING-0} : { *(.dynamic) }
+ ${TEXT_DYNAMIC-${DYNAMIC}}
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : { *(.sdata) }
+ ${RELOCATING+${OTHER_GOT_SECTIONS}}
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;}
@@ -148,6 +165,7 @@ SECTIONS
*(.bss)
*(COMMON)
}
+ ${RELOCATING+. = ALIGN(${ELFSIZE} / 8);}
${RELOCATING+_end = . ;}
${RELOCATING+PROVIDE (end = .);}
diff --git a/contrib/binutils/ld/scripttempl/pe.sc b/contrib/binutils/ld/scripttempl/pe.sc
index 2adc3db..f5cfc70 100644
--- a/contrib/binutils/ld/scripttempl/pe.sc
+++ b/contrib/binutils/ld/scripttempl/pe.sc
@@ -1,7 +1,39 @@
# Linker script for PE.
+if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
+ RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+fi
+
+# We can't easily and portably get an unquoted $ in a shell
+# substitution, so we do this instead.
+if test "${RELOCATING}"; then
+ R_TEXT='*(.text$*)'
+ R_DATA='*(.data$*)'
+ R_RDATA='*(.rdata$*)'
+ R_IDATA='
+ *(.idata$2)
+ *(.idata$3)
+ /* These zeroes mark the end of the import list. */
+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
+ *(.idata$4)
+ *(.idata$5)
+ *(.idata$6)
+ *(.idata$7)'
+ R_CRT='*(.CRT$*)'
+ R_RSRC='*(.rsrc$*)'
+else
+ R_TEXT=
+ R_DATA=
+ R_RDATA=
+ R_IDATA=
+ R_CRT=
+ R_RSRC=
+fi
+
cat <<EOF
-OUTPUT_FORMAT(${OUTPUT_FORMAT})
+${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
+${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
+
${LIB_SEARCH_DIRS}
ENTRY(_mainCRTStartup)
@@ -12,6 +44,9 @@ SECTIONS
{
${RELOCATING+ *(.init)}
*(.text)
+ ${R_TEXT}
+ *(.glue_7t)
+ *(.glue_7)
${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
LONG (-1); *(.ctors); *(.ctor); LONG (0); }
${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
@@ -20,44 +55,46 @@ SECTIONS
/* ??? Why is .gcc_exc here? */
${RELOCATING+ *(.gcc_exc)}
${RELOCATING+ etext = .;}
- /* Grouped section support currently must be explicitly provided for
- in the linker script. */
- *(.text\$)
*(.gcc_except_table)
}
- .bss BLOCK(__section_alignment__) :
- {
- __bss_start__ = . ;
- *(.bss)
- *(COMMON)
- __bss_end__ = . ;
- }
- .data BLOCK(__section_alignment__) :
+ /* The Cygwin32 library uses a section to avoid copying certain data
+ on fork. This used to be named ".data$nocopy". The linker used
+ to include this between __data_start__ and __data_end__, but that
+ breaks building the cygwin32 dll. Instead, we name the section
+ ".data_cygwin_nocopy" and explictly include it after __data_end__. */
+
+ .data ${RELOCATING+BLOCK(__section_alignment__)} :
{
- __data_start__ = . ;
+ ${RELOCATING+__data_start__ = . ;}
*(.data)
*(.data2)
- __data_end__ = . ;
- /* Grouped section support currently must be explicitly provided for
- in the linker script. */
- *(.data\$)
+ ${R_DATA}
+ ${RELOCATING+__data_end__ = . ;}
+ ${RELOCATING+*(.data_cygwin_nocopy)}
+ }
+
+ .bss ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ ${RELOCATING+__bss_start__ = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+__bss_end__ = . ;}
}
- .rdata BLOCK(__section_alignment__) :
+ .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
{
*(.rdata)
- /* Grouped section support currently must be explicitly provided for
- in the linker script. */
- *(.rdata\$)
+ ${R_RDATA}
+ *(.eh_frame)
}
- .edata BLOCK(__section_alignment__) :
+ .edata ${RELOCATING+BLOCK(__section_alignment__)} :
{
*(.edata)
}
- /DISCARD/ BLOCK(__section_alignment__) :
+ /DISCARD/ :
{
*(.debug\$S)
*(.debug\$T)
@@ -65,48 +102,44 @@ SECTIONS
*(.drectve)
}
- .idata BLOCK(__section_alignment__) :
+ .idata ${RELOCATING+BLOCK(__section_alignment__)} :
{
/* This cannot currently be handled with grouped sections.
See pe.em:sort_sections. */
- *(.idata\$2)
- *(.idata\$3)
- *(.idata\$4)
- *(.idata\$5)
- *(.idata\$6)
- *(.idata\$7)
+ ${R_IDATA}
}
- .CRT BLOCK(__section_alignment__) :
+ .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
{
- /* Grouped sections are used to handle .CRT\$foo. */
- *(.CRT\$)
- }
- .rsrc BLOCK(__section_alignment__) :
- {
- /* Grouped sections are used to handle .rsrc\$0[12]. */
- *(.rsrc\$)
+ ${R_CRT}
}
- .endjunk BLOCK(__section_alignment__) :
+ .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
{
/* end is deprecated, don't use it */
${RELOCATING+ end = .;}
${RELOCATING+ __end__ = .;}
}
- .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ *(.reloc)
+ }
+
+ .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ *(.rsrc)
+ ${R_RSRC}
+ }
+
+ .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
{
[ .stab ]
}
- .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
{
[ .stabstr ]
}
- .reloc BLOCK(__section_alignment__) :
- {
- *(.reloc)
- }
}
EOF
diff --git a/contrib/binutils/ld/scripttempl/tic30aout.sc b/contrib/binutils/ld/scripttempl/tic30aout.sc
new file mode 100644
index 0000000..28baed3
--- /dev/null
+++ b/contrib/binutils/ld/scripttempl/tic30aout.sc
@@ -0,0 +1,34 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+${STACKZERO+${RELOCATING+${STACKZERO}}}
+${RELOCATING+PROVIDE (__stack = 0);}
+SECTIONS
+{
+ ${RELOCATING+. = ${TEXT_START_ADDR};}
+ .text :
+ {
+ CREATE_OBJECT_SYMBOLS
+ *(.text)
+ ${RELOCATING+_etext = .;}
+ ${RELOCATING+__etext = .;}
+ ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
+ }
+ ${RELOCATING+. = ${DATA_ALIGNMENT};}
+ .data :
+ {
+ *(.data)
+ ${RELOCATING+_edata = .;}
+ ${RELOCATING+__edata = .;}
+ }
+ .bss :
+ {
+ ${RELOCATING+ __bss_start = .};
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+_end = ALIGN(4) };
+ ${RELOCATING+__end = ALIGN(4) };
+ }
+}
+EOF
diff --git a/contrib/binutils/ld/scripttempl/tic30coff.sc b/contrib/binutils/ld/scripttempl/tic30coff.sc
new file mode 100644
index 0000000..df2d4f7
--- /dev/null
+++ b/contrib/binutils/ld/scripttempl/tic30coff.sc
@@ -0,0 +1,58 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH("${OUTPUT_ARCH}")
+
+MEMORY
+{
+ rom : ORIGIN = 0x00000300, LENGTH = 16k
+ ram : ORIGIN = 0x00000300 + 16k, LENGTH = 16k
+ ramblk0 : ORIGIN = 0x02026000, LENGTH = 0x1000
+ ramblk1 : ORIGIN = 0x02027000, LENGTH = 0x1000
+}
+
+SECTIONS
+{
+.vectors 0x00000000 :
+{
+ *(vectors)
+}
+
+.text :
+{
+ *(.text)
+} > rom
+
+.const :
+{
+ *(.const)
+ __etext = . ;
+} > rom
+
+.mdata : AT( ADDR(.const) + SIZEOF(.const) )
+{
+ __data = . ;
+ *(.data);
+ __edata = . ;
+} > ram
+
+.bss :
+{
+ __bss = . ;
+ *(.bss);
+ *(COMMON);
+ __ebss = . ;
+} > ram
+
+.ram0 :
+{
+ *(ram0)
+} > ramblk0
+
+.ram1 :
+{
+ *(ram1)
+} > ramblk1
+
+}
+
+EOF
diff --git a/contrib/binutils/ld/scripttempl/v850.sc b/contrib/binutils/ld/scripttempl/v850.sc
new file mode 100644
index 0000000..6f3844e
--- /dev/null
+++ b/contrib/binutils/ld/scripttempl/v850.sc
@@ -0,0 +1,183 @@
+cat << EOF
+OUTPUT_FORMAT("elf32-v850", "elf32-v850",
+ "elf32-v850")
+OUTPUT_ARCH(v850)
+ENTRY(_start)
+SEARCH_DIR(.);
+/*/critters/slug/grossman/install/sun4/v850-elf/lib*/
+SECTIONS
+{
+ /* This saves a little space in the ELF file, since the zda starts
+ at a higher location that the ELF headers take up. */
+
+ .zdata ${ZDATA_START_ADDR} : {
+ *(.zdata)
+ *(.zbss)
+ *(reszdata)
+ *(.zcommon)
+ }
+
+ /* This is the read only part of the zero data area.
+ Having it as a seperate section prevents its
+ attributes from being inherited by the zdata
+ section. Specifically it prevents the zdata
+ section from being marked READONLY. */
+
+ .rozdata ${ROZDATA_START_ADDR} : {
+ *(.rozdata)
+ *(romzdata)
+ *(romzbss)
+ }
+
+ /* Read-only sections, merged into text segment: */
+ . = ${TEXT_START_ADDR};
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .rel.text : { *(.rel.text) }
+ .rela.text : { *(.rela.text) }
+ .rel.data : { *(.rel.data) }
+ .rela.data : { *(.rela.data) }
+ .rel.rodata : { *(.rel.rodata) }
+ .rela.rodata : { *(.rela.rodata) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.bss : { *(.rel.bss) }
+ .rela.bss : { *(.rela.bss) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init : { *(.init) } =0
+ .plt : { *(.plt) }
+
+ .text : {
+ *(.text)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.gnu.linkonce.t*)
+ } =0
+
+ ${RELOCATING+_etext = .;}
+ ${RELOCATING+PROVIDE (etext = .);}
+
+
+ .fini : { *(.fini) } =0
+ .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
+ .rodata1 : { *(.rodata1) }
+
+ .data : {
+ *(.data)
+ *(.gnu.linkonce.d*)
+ CONSTRUCTORS
+ }
+ .data1 : { *(.data1) }
+ .ctors : {
+ ${RELOCATING+___ctors = .;}
+ *(.ctors)
+ ${RELOCATING+___ctors_end = .;}
+ }
+
+ .dtors : {
+ ${RELOCATING+___dtors = .;}
+ *(.dtors)
+ ${RELOCATING+___dtors_end = .;}
+ }
+
+ .got : { *(.got.plt) *(.got) }
+ .dynamic : { *(.dynamic) }
+
+ .tdata ${TDATA_START_ADDR} : {
+ ${RELOCATING+PROVIDE (__ep = .);}
+ *(.tbyte)
+ *(.tcommon_byte)
+ *(.tdata)
+ *(.tbss)
+ *(.tcommon)
+ }
+
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata ${SDATA_START_ADDR} : {
+ ${RELOCATING+PROVIDE (__gp = . + 0x8000);}
+ *(.sdata)
+ ${RELOCATING+__sbss_start = .;}
+ *(.sbss)
+ *(.scommon)
+ }
+
+ /* See comment about .rozdata */
+ .rosdata ${ROSDATA_START_ADDR} : {
+ *(.rosdata)
+ }
+
+ ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
+ ${RELOCATING+PROVIDE (edata = _edata);}
+
+ .bss :
+ {
+ ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+
+ ${RELOCATING+_end = . ;}
+ ${RELOCATING+PROVIDE (end = .);}
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+
+ /* User stack */
+ .stack 0x200000 : {
+ ${RELOCATING+__stack = .;}
+ *(.stack)
+ }
+ /* These must appear regardless of . */
+}
+EOF
diff --git a/contrib/binutils/ld/stamp-h.in b/contrib/binutils/ld/stamp-h.in
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/contrib/binutils/ld/stamp-h.in
@@ -0,0 +1 @@
+timestamp
diff --git a/contrib/binutils/libiberty/ChangeLog b/contrib/binutils/libiberty/ChangeLog
index a4aaa91..e3f0773 100644
--- a/contrib/binutils/libiberty/ChangeLog
+++ b/contrib/binutils/libiberty/ChangeLog
@@ -1,12 +1,246 @@
+Mon Feb 23 14:33:15 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * choose-temp.c: Fix handling of sys/file.h to work in libiberty.
+
+Sun Feb 22 18:03:23 1998 Jeffrey A Law (law@cygnus.com)
+
+ * choose-temp.c: Sync with copy in gcc.
+
+Thu Feb 12 16:29:49 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * getopt.c: Update to latest FSF version.
+ * getopt1.c: Likewise.
+
+Tue Feb 10 16:58:33 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ * cplus-dem.c (gnu_special): Don't get confused by .<digits>
+ strings that are not actually lengths.
+
+Thu Feb 5 18:48:56 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mh-cygwin32: remove vasprintf.o from EXTRA_OFILES
+ since it gets built automatically
+
+Sun Feb 1 02:52:32 1998 Mike Stump <mrs@wrs.com>
+
+ * config.table (vxworks configs): Default to VxWorks 5.x, as that is
+ the currently shipping OS.
+
+Tue Jan 27 16:08:20 1998 Pat Rankin <rankin@eql.caltech.edu>
+
+ * vmsbuild.com [REQUIRE_OFILES]: Synchronized with Makefile.in:
+ Add fnmatch.o and objalloc.o; remove vasprintf.o.
+ [config.h]: Define NEED_strsignal.
+
+Mon Jan 19 12:20:01 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * functions.def: Correct argument types for strerror and
+ strsignal. Reported by Alex Gutman <agutman@emc.com>.
+
+Sun Jan 18 15:57:28 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * vasprintf.c (int_vasprintf): Increase buffer size for float/double
+ values.
+
+Sat Jan 17 22:28:38 1997 Mumit Khan <khan@xraylith.wisc.edu>
+ J.J. VanderHeijden <J.J.vanderHeijden@student.utwente.nl>
+
+ Add mingw32 support.
+ * pexecute.c (pexecute): New function for mingw32. Supports pipes.
+ (pwait): New function for mingw32.
+
+ * config.table (i[3456]86-*-mingw32*): Support for i386-mingw32.
+ * config/mt-mingw32: New file.
+ * xmalloc.c (first_break): Not used for mingw32.
+ (xmalloc_set_program_name): Don't use sbrk on mingw32.
+ (xmalloc): Likewise.
+ (xrealloc): Likewise.
+
+Sat Jan 17 22:28:05 1998 Jeffrey A Law (law@cygnus.com)
+
+ * choose-temp.c: Sync with gcc version.
+
+Tue Jan 13 18:34:39 1998 Jim Wilson <wilson@cygnus.com>
+
+ * Makefile.in (install_to_libdir, install_to_tooldir): Add MULTISUBDIR
+ to all filenames in libdir and tooldir.
+ (distclean): Do MULTICLEAN before deleting Makefile.
+ (stamp-needed, stamp-config): Add MULTISRCTOP to
+ pathname for move-if-change.
+
+Thu Dec 4 17:25:19 1997 Jeffrey A Law (law@cygnus.com)
+
+ * strsignal.c (sys_nsig): Try NSIG and _NSIG.
+
+Wed Nov 19 13:37:06 1997 Michael Meissner <meissner@cygnus.com>
+
+ * alloca-norm.h (alloca, GCC case): Don't redefine alloca if it
+ was already defined previously.
+
+Mon Nov 10 12:48:03 1997 Philippe De Muyter <phdm@macqel.be>
+
+ * Makefile.in (INSTALL): Use ../install-sh, not install.
+
+Tue Oct 28 23:41:15 1997 Judy Goldberg <jodyg@idt.net>
+
+ * Makefile.in (CFILES): Add pexecute.c.
+
+Wed Oct 15 19:13:48 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * asprintf.c: Consistently use either stdarg or varargs.
+
+Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net>
+
+ * cplus-dem.c (demangle_signature): Don't look for return types on
+ constructors. Handle member template constructors.
+
+Fri Oct 3 17:53:30 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * README: Fix configuration instructions.
+
+Mon Sep 29 12:28:41 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * pexecute.c: Update to current version from /gd/gnu/lib:
+
+ Mon Sep 29 12:27:59 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * pexecute.c: Use spawn if __CYGWIN32__.
+
+ 1997-08-08 Paul Eggert <eggert@twinsun.com>
+
+ * pexecute.c: Include "config.h" first, as per autoconf manual.
+
+ Fri Jun 27 15:20:29 1997 Scott Christley <scottc@net-community.com>
+
+ * pexecute.c (fix_argv): New function.
+ (pexecute): Win32 but not Cygwin32 needs its arguments fixed.
+ Add underscore to cwait function call.
+
+Sun Sep 28 12:00:52 1997 Mark Mitchell <mmitchell@usa.net>
+
+ * cplus-dem.c (demangle_template): Add new parameter. Handle new
+ template-function mangling.
+ (consume_count_with_underscores): New function.
+ (demangle_signature): Handle new name-mangling scheme.
+
+Wed Sep 24 00:31:59 1997 Felix Lee <flee@yin.cygnus.com>
+
+ * asprintf.c: stdarg.h when ALMOST_STDC
+ * config/mh-windows (EXTRA_OFILES): add asprintf.o and
+ strncasecmp.o.
+
+Thu Aug 28 14:27:15 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * vasprintf.c (vasprintf): Allow for _BSD_VA_LIST_.
+
+ * config.table: Add case for FreeBSD 2.1 and 2.2, needs mh-fbsd21.
+
+ * config/mh-fbsd21 (EXTRA_OFILES): Force vasprintf.o
+
+Wed Sep 10 12:43:10 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cplus-dem.c (demangle_fund_type): Change "complex" to "__complex".
+
+Fri Sep 5 16:34:42 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * asprintf.c (asprintf): New file.
+ * Makefile.in (CFILES): Add asprintf.c
+ * functions.def: Ditto.
+
+Thu Aug 28 18:53:34 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * argv.c (dupargv): New function, duplicate an argument vector.
+
+Tue Aug 19 20:28:45 1997 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mh-cygwin32: also build random.o
+
+Tue Aug 19 17:10:56 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cplus-dem.c: Add 'extern' to prepends_underscore.
+
+Wed Jul 30 11:42:19 1997 Per Bothner <bothner@cygnus.com>
+
+ * cplus-dem.c: Various changes to produce Java output when passed
+ DMGL_JAVA. Thus "::" becomes "." and "JArray<Foo>" becomes "Foo[]".
+ (main): Support --java and -j flags to set DMGL_JAVA.
+
+Tue Jul 22 19:05:23 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * config/mh-go32 (CC, AR, RANLIB): Don't define.
+
+Tue Jul 22 17:49:54 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (REQUIRED_OFILES): Add pexecute.o.
+ (pexecute.o): New target.
+
+ * Makefile.in (stamp-needed): New target, replacing needed-list.
+ (needed-list): Just depend upon stamp-needed.
+ (stamp-config): New target, replacing config.h.
+ (config.h): Just depend upon stamp-config.
+ (mostlyclean): Remove stamp-*.
+
+Thu Jun 12 11:00:18 1997 Angela Marie Thomas (angela@cygnus.com)
+
+ * Makefile.in (FLAGS_TO_PASS): pass INSTALL, INSTALL_PROGRAM and
+ INSTALL_DATA for multilibbed installs
+
+Tue Jun 3 13:21:05 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ Tue Dec 10 09:44:57 1996 Paul Eggert <eggert@twinsun.com>
+
+ * choose-temp.c (choose_temp_base): Don't dump core if TMPDIR is empty.
+
+ * choose-temp.c (try): Insist that temp dir be searchable.
+
+ Wed Oct 23 17:36:39 1996 Doug Rupp (rupp@gnat.com)
+
+ * choose-temp.c (choose_temp_base): On VMS, use proper syntax
+ for current directory.
+
+ Sat Feb 15 19:03:48 1997 Geoffrey Noer (noer@cygnus.com)
+
+ * pexecute.c: Remove special cases for cygwin32.
+ (pwait): Remove local definition of `pid'.
+
+ Tue Nov 12 18:26:15 1996 Doug Rupp (rupp@gnat.com)
+
+ * pexecute.c (vfork): Supply new definition for VMS.
+ (pwait): Use waitpid instead of wait for VMS.
+
+Tue May 20 14:02:20 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * cplus-dem.c (do_type): Handle `J'.
+ (demangle_fund_type): Print "complex" for it.
+
+Wed Apr 30 12:15:45 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * configure.in: Don't turn on multilib here.
+
+Mon Apr 28 19:04:31 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * obstack.c: move _obstack_memory_used outside of ifdef. Cannot be
+ elided; needed by gdb and not present in libc.
+
Thu Apr 24 19:33:47 1997 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (clean): Remove tmpmulti.out.
+Tue Apr 22 10:25:15 1997 Fred Fish <fnf@cygnus.com>
+
+ * floatformat.c (floatformat_ieee_double_littlebyte_bigword):
+ Add new floatformat, mainly for ARM doubles.
+
Mon Apr 14 12:11:16 1997 Ian Lance Taylor <ian@cygnus.com>
* config.table: Use ${config_shell} with ${moveifchange}. From
Thomas Graichen <graichen@rzpd.de>.
+Fri Apr 4 03:09:24 1997 Ulrich Drepper <drepper@cygnus.com>
+
+ * configure.in: Enable multilibing by default.
+ Update multilib template to read config-ml.in.
+
Tue Apr 1 16:26:39 1997 Klaus Kaempf <kkaempf@progis.de>
* makefile.vms: Add objalloc.
diff --git a/contrib/binutils/libiberty/Makefile.in b/contrib/binutils/libiberty/Makefile.in
index b7f6392..58fabd5 100644
--- a/contrib/binutils/libiberty/Makefile.in
+++ b/contrib/binutils/libiberty/Makefile.in
@@ -59,7 +59,7 @@ MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
-INSTALL = install -c
+INSTALL = $(SHELL) $(srcdir)/../install-sh -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
@@ -106,6 +106,9 @@ FLAGS_TO_PASS = \
"LIBCFLAGS=$(LIBCFLAGS)" \
"EXTRA_OFILES=$(EXTRA_OFILES)" \
"HDEFINES=$(HDEFINES)" \
+ "INSTALL=$(INSTALL)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"LDFLAGS=$(LDFLAGS)" \
"LOADLIBES=$(LOADLIBES)" \
"PICFLAG=$(PICFLAG)" \
@@ -143,12 +146,12 @@ HFILES =
# NOTE: If you add new files to the library, add them to this list
# (alphabetical), and add them to REQUIRED_OFILES or 'functions.def'.
-CFILES = alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c bzero.c \
+CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c bzero.c \
choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c fnmatch.c \
getcwd.c getopt.c getopt1.c getpagesize.c getruntime.c \
floatformat.c hex.c index.c insque.c \
memchr.c memcmp.c memcpy.c memmove.c memset.c objalloc.c \
- obstack.c random.c rename.c rindex.c sigsetmask.c spaces.c \
+ obstack.c pexecute.c random.c rename.c rindex.c sigsetmask.c spaces.c \
strcasecmp.c strncasecmp.c \
strchr.c strdup.c strerror.c strrchr.c strsignal.c \
strstr.c strtod.c strtol.c strtoul.c tmpnam.c \
@@ -157,8 +160,8 @@ CFILES = alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c bzero.c \
# These are always included in the library.
REQUIRED_OFILES = argv.o basename.o choose-temp.o concat.o cplus-dem.o \
fdmatch.o fnmatch.o getopt.o getopt1.o getruntime.o hex.o \
- floatformat.o objalloc.o obstack.o spaces.o strerror.o strsignal.o \
- xatexit.o xexit.o xmalloc.o xstrdup.o xstrerror.o
+ floatformat.o objalloc.o obstack.o pexecute.o spaces.o strerror.o \
+ strsignal.o xatexit.o xexit.o xmalloc.o xstrdup.o xstrerror.o
# Do we want/need any config overrides?
#
@@ -169,15 +172,15 @@ INSTALL_DEST = libdir
install: install_to_$(INSTALL_DEST)
install_to_libdir: all
- $(INSTALL_DATA) $(TARGETLIB) $(libdir)/$(TARGETLIB).n
- ( cd $(libdir) ; $(RANLIB) $(libdir)/$(TARGETLIB).n )
- mv -f $(libdir)/$(TARGETLIB).n $(libdir)$(MULTISUBDIR)/$(TARGETLIB)
+ $(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n
+ ( cd $(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB).n )
+ mv -f $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n $(libdir)$(MULTISUBDIR)/$(TARGETLIB)
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
install_to_tooldir: all
- $(INSTALL_DATA) $(TARGETLIB) $(tooldir)/lib/$(TARGETLIB).n
- ( cd $(tooldir) ; $(RANLIB) $(tooldir)/lib/$(TARGETLIB).n )
- mv -f $(tooldir)/lib/$(TARGETLIB).n $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)
+ $(INSTALL_DATA) $(TARGETLIB) $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB).n
+ ( cd $(tooldir)/lib$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB).n )
+ mv -f $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB).n $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
# The default configuration adds to libiberty all those functions that are
@@ -185,8 +188,12 @@ install_to_tooldir: all
# Then a sed+awk combination translates the ld error messages into
# a list of .o files.
-needed-list: stamp-picdir $(NEEDED_LIST)
- cp $(NEEDED_LIST) needed-list
+stamp-needed: stamp-picdir $(NEEDED_LIST)
+ cp $(NEEDED_LIST) needed-tmp
+ $(SHELL) $(srcdir)/$(MULTISRCTOP)../move-if-change needed-tmp needed-list
+ touch stamp-needed
+
+needed-list: stamp-needed ; @true
lneeded-list: $(EXTRA_OFILES) needed.awk errors
rm -f lneeded-list
@@ -211,8 +218,12 @@ needed.awk: $(srcdir)/functions.def Makefile
| sed -e '/DEF/s|DEF.\([^,]*\).*|/\1/ { printf "\1.o " }|' \
>>needed.awk
-config.h: $(CONFIG_H)
- cp $(CONFIG_H) config.h
+stamp-config: $(CONFIG_H)
+ cp $(CONFIG_H) config.tmp
+ $(SHELL) $(srcdir)/$(MULTISRCTOP)../move-if-change config.tmp config.h
+ touch stamp-config
+
+config.h: stamp-config ; @true
lconfig.h: needed2.awk errors
echo "/* !Automatically generated from $(srcdir)/functions.def"\
@@ -285,15 +296,15 @@ ls:
mostlyclean:
rm -rf *.o pic core errs \#* *.E a.out
- rm -f needed.awk needed2.awk errors dummy needed-list config.h
+ rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-*
rm -f $(CONFIG_H) $(NEEDED_LIST) stamp-picdir
@$(MULTICLEAN) multi-clean DO=mostlyclean
clean: mostlyclean
rm -f *.a required-list tmpmulti.out
@$(MULTICLEAN) multi-clean DO=clean
distclean: clean
- rm -f *~ Makefile config.status alloca-conf.h xhost-mkfrag TAGS multilib.out
@$(MULTICLEAN) multi-clean DO=distclean
+ rm -f *~ Makefile config.status alloca-conf.h xhost-mkfrag TAGS multilib.out
maintainer-clean realclean: distclean
force:
@@ -314,6 +325,7 @@ hex.o: $(INCDIR)/libiberty.h
floatformat.o: $(INCDIR)/floatformat.h
objalloc.o: $(INCDIR)/objalloc.h
obstack.o: $(INCDIR)/obstack.h
+pexecute.o: $(INCDIR)/libiberty.h
spaces.o: $(INCDIR)/libiberty.h
strerror.o: $(INCDIR)/libiberty.h
strsignal.o: $(INCDIR)/libiberty.h
diff --git a/contrib/binutils/libiberty/README b/contrib/binutils/libiberty/README
index 5081bba..92dc202 100644
--- a/contrib/binutils/libiberty/README
+++ b/contrib/binutils/libiberty/README
@@ -11,10 +11,9 @@ Current members include:
We expect many of the GNU subroutines that are floating around to
eventually arrive here.
-To build the library, do:
-
- ./configure HOSTTYPE
- make
+The library must be configured from the top source directory. Don't
+try to run configure in this directory. Follow the configuration
+instructions in ../README.
Please report bugs and fixes to "bug-gnu-utils@prep.ai.mit.edu". Thank you.
diff --git a/contrib/binutils/libiberty/alloca-norm.h b/contrib/binutils/libiberty/alloca-norm.h
index 394a653..bda4fc0 100644
--- a/contrib/binutils/libiberty/alloca-norm.h
+++ b/contrib/binutils/libiberty/alloca-norm.h
@@ -1,7 +1,9 @@
/* "Normal" configuration for alloca. */
#ifdef __GNUC__
+#ifndef alloca
#define alloca __builtin_alloca
+#endif
#else /* ! defined (__GNUC__) */
#if defined (sparc) && defined (sun)
#include <alloca.h>
diff --git a/contrib/binutils/libiberty/argv.c b/contrib/binutils/libiberty/argv.c
index 60694f9..824a029 100644
--- a/contrib/binutils/libiberty/argv.c
+++ b/contrib/binutils/libiberty/argv.c
@@ -72,6 +72,63 @@ extern char *strdup (); /* Duplicate a string */
NAME
+ dupargv -- duplicate an argument vector
+
+SYNOPSIS
+
+ char **dupargv (vector)
+ char **vector;
+
+DESCRIPTION
+
+ Duplicate an argument vector. Simply scans through the
+ vector, duplicating each argument argument until the
+ terminating NULL is found.
+
+RETURNS
+
+ Returns a pointer to the argument vector if
+ successful. Returns NULL if there is insufficient memory to
+ complete building the argument vector.
+
+*/
+
+char **
+dupargv (argv)
+ char **argv;
+{
+ int argc;
+ char **copy;
+
+ if (argv == NULL)
+ return NULL;
+
+ /* the vector */
+ for (argc = 0; argv[argc] != NULL; argc++);
+ copy = (char **) malloc ((argc + 1) * sizeof (char *));
+ if (copy == NULL)
+ return NULL;
+
+ /* the strings */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ {
+ int len = strlen (argv[argc]);
+ copy[argc] = malloc (sizeof (char *) * (len + 1));
+ if (copy[argc] == NULL)
+ {
+ freeargv (copy);
+ return NULL;
+ }
+ strcpy (copy[argc], argv[argc]);
+ }
+ copy[argc] = NULL;
+ return copy;
+}
+
+/*
+
+NAME
+
freeargv -- free an argument vector
SYNOPSIS
diff --git a/contrib/binutils/libiberty/asprintf.c b/contrib/binutils/libiberty/asprintf.c
new file mode 100644
index 0000000..5aaf320
--- /dev/null
+++ b/contrib/binutils/libiberty/asprintf.c
@@ -0,0 +1,57 @@
+/* Like sprintf but provides a pointer to malloc'd storage, which must
+ be freed by the caller.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libiberty; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include "ansidecl.h"
+#include "libiberty.h"
+
+#if defined (ANSI_PROTOTYPES) || defined (ALMOST_STDC)
+#define USE_STDARG
+#endif
+
+#ifdef USE_STDARG
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
+/* VARARGS */
+#ifdef USE_STDARG
+int
+asprintf (char **buf, const char *fmt, ...)
+#else
+int
+asprintf (buf, fmt, va_alist)
+ char **buf;
+ const char *fmt;
+ va_dcl
+#endif
+{
+ int status;
+ va_list ap;
+#ifdef USE_STDARG
+ va_start (ap, fmt);
+#else
+ va_start (ap);
+#endif
+ status = vasprintf (buf, fmt, ap);
+ va_end (ap);
+ return status;
+}
diff --git a/contrib/binutils/libiberty/choose-temp.c b/contrib/binutils/libiberty/choose-temp.c
index 0383832..5668f74 100644
--- a/contrib/binutils/libiberty/choose-temp.c
+++ b/contrib/binutils/libiberty/choose-temp.c
@@ -1,5 +1,5 @@
/* Utility to pick a temporary filename prefix.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
@@ -22,7 +22,16 @@ Boston, MA 02111-1307, USA. */
/* This file lives in at least two places: libiberty and gcc.
Don't change one without the other. */
-#ifndef NO_SYS_FILE_H
+#if defined (IN_GCC) || defined (HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+/* If we are in gcc, or we have a config.h, we assume that
+ HAVE_SYS_FILE_H tells us whether to include sys/file.h. However,
+ libiberty does not have a config.h, and instead arranges to define
+ NO_SYS_FILE_H on the command line when there is no sys/file.h. */
+
+#if (defined (IN_GCC) || defined (HAVE_CONFIG_H)) ? defined (HAVE_SYS_FILE_H) : ! defined (NO_SYS_FILE_H)
#include <sys/types.h>
#include <sys/file.h> /* May get R_OK, etc. on some systems. */
#endif
@@ -36,7 +45,6 @@ Boston, MA 02111-1307, USA. */
#include <stdio.h> /* May get P_tmpdir. */
#ifdef IN_GCC
-#include "config.h"
#include "gansidecl.h"
extern char *xmalloc ();
#else
@@ -54,7 +62,7 @@ extern char *xmalloc ();
/* On MSDOS, write temp files in current dir
because there's no place else we can expect to use. */
/* ??? Although the current directory is tried as a last resort,
- this is left in so that on MSDOS it is prefered to /tmp on the
+ this is left in so that on MSDOS it is preferred to /tmp on the
off chance that someone requires this, since that was the previous
behaviour. */
#ifdef __MSDOS__
@@ -68,7 +76,7 @@ extern char *xmalloc ();
#define TEMP_FILE "ccXXXXXX"
/* Subroutine of choose_temp_base.
- If BASE is non-NULL, returh it.
+ If BASE is non-NULL, return it.
Otherwise it checks if DIR is a usable directory.
If success, DIR is returned.
Otherwise NULL is returned. */
@@ -80,7 +88,7 @@ try (dir, base)
if (base != 0)
return base;
if (dir != 0
- && access (dir, R_OK | W_OK) == 0)
+ && access (dir, R_OK | W_OK | X_OK) == 0)
return dir;
return 0;
}
@@ -121,14 +129,13 @@ choose_temp_base ()
#endif
len = strlen (base);
- if (len == 0)
- abort ();
temp_filename = xmalloc (len + 1 /*DIR_SEPARATOR*/
+ strlen (TEMP_FILE) + 1);
strcpy (temp_filename, base);
#ifndef MPW
- if (temp_filename[len-1] != '/'
+ if (len != 0
+ && temp_filename[len-1] != '/'
&& temp_filename[len-1] != DIR_SEPARATOR)
temp_filename[len++] = DIR_SEPARATOR;
#else /* MPW */
diff --git a/contrib/binutils/libiberty/config.table b/contrib/binutils/libiberty/config.table
index dba783b..e367e1b 100644
--- a/contrib/binutils/libiberty/config.table
+++ b/contrib/binutils/libiberty/config.table
@@ -10,6 +10,8 @@ case "${host}" in
*-*-cxux7*) frag=mh-cxux7 ;;
*-*-cygwin32) frag=mh-cygwin32 ;;
*-*-dgux*) frag=mh-sysv ;;
+ *-*-freebsd2.1.*) frag=mh-fbsd21 ;;
+ *-*-freebsd2.2.*) frag=mh-fbsd21 ;;
hppa*-hp-bsd*) frag=mh-hpbsd ;;
*-*-hpux*) frag=mh-hpux ;;
*-*-hiux*) frag=mh-hpux ;;
@@ -22,11 +24,18 @@ case "${host}" in
*-*-go32) frag=mh-go32 ;;
i[345]86-*-windows*) frag=mh-windows ;;
- *-*-vxworks5*)
+ *-*-vxworks5* | *-*-vxworks)
# VxWorks 5 needs special action, because the usual
# autoconfiguration scheme does not work.
frag=mt-vxworks5
;;
+
+ i[3456]86-*-mingw32*)
+ # Mingw32 does not require strerror.o from REQUIRED_OFILES.
+ # Worse: it will not compile it because of an incompatible sys_errlist
+ # definition.
+ frag=mt-mingw32
+ ;;
esac
# Try to handle funky case of solaris 2 -> sun 4.
diff --git a/contrib/binutils/libiberty/config/mh-fbsd21 b/contrib/binutils/libiberty/config/mh-fbsd21
new file mode 100644
index 0000000..1375a78
--- /dev/null
+++ b/contrib/binutils/libiberty/config/mh-fbsd21
@@ -0,0 +1 @@
+EXTRA_OFILES=vasprintf.o
diff --git a/contrib/binutils/libiberty/config/mt-mingw32 b/contrib/binutils/libiberty/config/mt-mingw32
new file mode 100644
index 0000000..2fb17d7
--- /dev/null
+++ b/contrib/binutils/libiberty/config/mt-mingw32
@@ -0,0 +1,27 @@
+# Mingw32 target Makefile fragment.
+# The autoconfiguration fails for a Mingw32 target, because of an
+# incompatible definition of sys_errlist, which is imported from a DLL.
+# Therefore, we compute the dependencies by hand.
+
+HDEFINES = -DNO_SYS_PARAM_H -DNO_SYS_FILE_H
+CONFIG_H = mgconfig.h
+NEEDED_LIST = mgneeded-list
+
+mgconfig.h: Makefile
+ if [ -f ../newlib/Makefile ]; then \
+ $(MAKE) $(FLAGS_TO_PASS) xconfig.h; \
+ cp xconfig.h mgconfig.h; \
+ else \
+ echo "#define NEED_sys_siglist 1" >>mgconfig.h; \
+ echo "#define NEED_strsignal 1" >>mgconfig.h; \
+ echo "#define NEED_psignal 1" >>mgconfig.h; \
+ echo "#define NEED_basename 1" >>mgconfig.h; \
+ fi
+
+mgneeded-list: Makefile
+ if [ -f ../newlib/Makefile ]; then \
+ $(MAKE) $(FLAGS_TO_PASS) xneeded-list; \
+ cp xneeded-list mgneeded-list; \
+ else \
+ echo getopt.o vasprintf.o >mgneeded-list; \
+ fi
diff --git a/contrib/binutils/libiberty/configure.in b/contrib/binutils/libiberty/configure.in
index b8fe5fe..b0020d8 100644
--- a/contrib/binutils/libiberty/configure.in
+++ b/contrib/binutils/libiberty/configure.in
@@ -54,25 +54,13 @@ fi
# We need multilib support, but only if configuring for the target.
if [ -n "${with_target_subdir}" ] ; then
- case ${srcdir} in
- .)
+ if [ "${srcdir}" = "." ] ; then
if [ "${with_target_subdir}" != "." ] ; then
-
- # Set MULTISRCTOP to the value we need if we are not doing
- # multilib. This will be overridden if --enable-multilib was
- # used.
- sed -e "s:^MULTISRCTOP[ ]*=.*$:MULTISRCTOP = ../:" \
- ${Makefile} > Makefile.tem
- rm -f ${Makefile}
- mv Makefile.tem ${Makefile}
-
- . ${srcdir}/${with_multisrctop}../../config-ml.in
+ . ${with_multisrctop}../../config-ml.in
else
- . ${srcdir}/${with_multisrctop}../config-ml.in
+ . ${with_multisrctop}../config-ml.in
fi
- ;;
- *)
+ else
. ${srcdir}/../config-ml.in
- ;;
- esac
+ fi
fi
diff --git a/contrib/binutils/libiberty/cplus-dem.c b/contrib/binutils/libiberty/cplus-dem.c
index 9579021..f4d7123 100644
--- a/contrib/binutils/libiberty/cplus-dem.c
+++ b/contrib/binutils/libiberty/cplus-dem.c
@@ -102,6 +102,8 @@ struct work_stuff
int destructor;
int static_type; /* A static member function */
int const_type; /* A const member function */
+ char **tmpl_argvec; /* Template function arguments. */
+ int ntmpl_args; /* The number of template function arguments. */
};
#define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI)
@@ -222,7 +224,7 @@ demangle_method_args PARAMS ((struct work_stuff *work, const char **, string *))
static int
demangle_template PARAMS ((struct work_stuff *work, const char **, string *,
- string *));
+ string *, int));
static int
arm_pt PARAMS ((struct work_stuff *, const char *, int, const char **,
@@ -294,6 +296,9 @@ get_count PARAMS ((const char **, int *));
static int
consume_count PARAMS ((const char **));
+static int
+consume_count_with_underscores PARAMS ((const char**));
+
static int
demangle_args PARAMS ((struct work_stuff *, const char **, string *));
@@ -336,6 +341,42 @@ consume_count (type)
return (count);
}
+
+/* Like consume_count, but for counts that are preceeded and followed
+ by '_' if they are greater than 10. Also, -1 is returned for
+ failure, since 0 can be a valid value. */
+
+static int
+consume_count_with_underscores (mangled)
+ const char **mangled;
+{
+ int idx;
+
+ if (**mangled == '_')
+ {
+ (*mangled)++;
+ if (!isdigit (**mangled))
+ return -1;
+
+ idx = consume_count (mangled);
+ if (**mangled != '_')
+ /* The trailing underscore was missing. */
+ return -1;
+
+ (*mangled)++;
+ }
+ else
+ {
+ if (**mangled < '0' || **mangled > '9')
+ return -1;
+
+ idx = **mangled - '0';
+ (*mangled)++;
+ }
+
+ return idx;
+}
+
int
cplus_demangle_opname (opname, result, options)
const char *opname;
@@ -580,7 +621,17 @@ mop_up (work, declp, success)
{
free ((char *) work -> typevec);
}
-
+ if (work->tmpl_argvec)
+ {
+ int i;
+
+ for (i = 0; i < work->ntmpl_args; i++)
+ if (work->tmpl_argvec[i])
+ free ((char*) work->tmpl_argvec[i]);
+
+ free ((char*) work->tmpl_argvec);
+ }
+
/* If demangling was successful, ensure that the demangled string is null
terminated and return it. Otherwise, free the demangling decl. */
@@ -635,6 +686,7 @@ demangle_signature (work, mangled, declp)
int success = 1;
int func_done = 0;
int expect_func = 0;
+ int expect_return_type = 0;
const char *oldmangled = NULL;
string trawname;
string tname;
@@ -726,12 +778,12 @@ demangle_signature (work, mangled, declp)
{
oldmangled = *mangled;
}
- success = demangle_template (work, mangled, &tname, &trawname);
+ success = demangle_template (work, mangled, &tname, &trawname, 1);
if (success)
{
remember_type (work, oldmangled, *mangled - oldmangled);
}
- string_append(&tname, "::");
+ string_append(&tname, (work -> options & DMGL_JAVA) ? "." : "::");
string_prepends(declp, &tname);
if (work -> destructor & 1)
{
@@ -751,14 +803,43 @@ demangle_signature (work, mangled, declp)
break;
case '_':
- /* At the outermost level, we cannot have a return type specified,
- so if we run into another '_' at this point we are dealing with
- a mangled name that is either bogus, or has been mangled by
- some algorithm we don't know how to deal with. So just
- reject the entire demangling. */
- success = 0;
+ if (GNU_DEMANGLING && expect_return_type)
+ {
+ /* Read the return type. */
+ string return_type;
+ string_init (&return_type);
+
+ (*mangled)++;
+ success = do_type (work, mangled, &return_type);
+ APPEND_BLANK (&return_type);
+
+ string_prepends (declp, &return_type);
+ string_delete (&return_type);
+ break;
+ }
+ else
+ /* At the outermost level, we cannot have a return type specified,
+ so if we run into another '_' at this point we are dealing with
+ a mangled name that is either bogus, or has been mangled by
+ some algorithm we don't know how to deal with. So just
+ reject the entire demangling. */
+ success = 0;
break;
+ case 'H':
+ if (GNU_DEMANGLING)
+ {
+ /* A G++ template function. Read the template arguments. */
+ success = demangle_template (work, mangled, declp, 0, 0);
+ if (!(work->constructor & 1))
+ expect_return_type = 1;
+ (*mangled)++;
+ break;
+ }
+ else
+ /* fall through */
+ ;
+
default:
if (AUTO_DEMANGLING || GNU_DEMANGLING)
{
@@ -785,6 +866,10 @@ demangle_signature (work, mangled, declp)
{
func_done = 1;
success = demangle_args (work, mangled, declp);
+ /* Since template include the mangling of their return types,
+ we must set expect_func to 0 so that we don't try do
+ demangle more arguments the next time we get here. */
+ expect_func = 0;
}
}
}
@@ -838,11 +923,12 @@ demangle_method_args (work, mangled, declp)
#endif
static int
-demangle_template (work, mangled, tname, trawname)
+demangle_template (work, mangled, tname, trawname, is_type)
struct work_stuff *work;
const char **mangled;
string *tname;
string *trawname;
+ int is_type;
{
int i;
int is_pointer;
@@ -857,25 +943,43 @@ demangle_template (work, mangled, tname, trawname)
const char *old_p;
const char *start;
int symbol_len;
+ int is_java_array = 0;
string temp;
(*mangled)++;
- start = *mangled;
- /* get template name */
- if ((r = consume_count (mangled)) == 0 || strlen (*mangled) < r)
+ if (is_type)
{
- return (0);
+ start = *mangled;
+ /* get template name */
+ if ((r = consume_count (mangled)) == 0 || strlen (*mangled) < r)
+ {
+ return (0);
+ }
+ if (trawname)
+ string_appendn (trawname, *mangled, r);
+ is_java_array = (work -> options & DMGL_JAVA)
+ && strncmp (*mangled, "JArray1Z", 8) == 0;
+ if (! is_java_array)
+ {
+ string_appendn (tname, *mangled, r);
+ }
+ *mangled += r;
}
- if (trawname)
- string_appendn (trawname, *mangled, r);
- string_appendn (tname, *mangled, r);
- *mangled += r;
- string_append (tname, "<");
+ if (!is_java_array)
+ string_append (tname, "<");
/* get size of template parameter list */
if (!get_count (mangled, &r))
{
return (0);
}
+ if (!is_type)
+ {
+ /* Create an array for saving the template argument values. */
+ work->tmpl_argvec = (char**) xmalloc (r * sizeof (char *));
+ work->ntmpl_args = r;
+ for (i = 0; i < r; i++)
+ work->tmpl_argvec[i] = 0;
+ }
for (i = 0; i < r; i++)
{
if (need_comma)
@@ -891,6 +995,15 @@ demangle_template (work, mangled, tname, trawname)
if (success)
{
string_appends (tname, &temp);
+
+ if (!is_type)
+ {
+ /* Save the template argument. */
+ int len = temp.p - temp.b;
+ work->tmpl_argvec[i] = xmalloc (len + 1);
+ memcpy (work->tmpl_argvec[i], temp.b, len);
+ work->tmpl_argvec[i][len] = '\0';
+ }
}
string_delete(&temp);
if (!success)
@@ -900,6 +1013,9 @@ demangle_template (work, mangled, tname, trawname)
}
else
{
+ string param;
+ string* s;
+
/* otherwise, value parameter */
old_p = *mangled;
is_pointer = 0;
@@ -913,7 +1029,7 @@ demangle_template (work, mangled, tname, trawname)
/*
if (success)
{
- string_appends (tname, &temp);
+ string_appends (s, &temp);
}
*/
string_delete(&temp);
@@ -922,8 +1038,17 @@ demangle_template (work, mangled, tname, trawname)
break;
}
/*
- string_append (tname, "=");
+ string_append (s, "=");
*/
+
+ if (!is_type)
+ {
+ s = &param;
+ string_init (s);
+ }
+ else
+ s = tname;
+
while (*old_p && !done)
{
switch (*old_p)
@@ -940,6 +1065,7 @@ demangle_template (work, mangled, tname, trawname)
case 'F': /* function */
case 'M': /* member function */
case 'O': /* ??? */
+ case 'J': /* complex */
old_p++;
continue;
case 'Q': /* qualified name */
@@ -976,16 +1102,41 @@ demangle_template (work, mangled, tname, trawname)
done = is_integral = 1;
}
}
- if (is_integral)
+ if (**mangled == 'Y')
+ {
+ /* The next argument is a template parameter. */
+ int idx;
+
+ (*mangled)++;
+ idx = consume_count_with_underscores (mangled);
+ if (idx == -1
+ || (work->tmpl_argvec && idx >= work->ntmpl_args)
+ || consume_count_with_underscores (mangled) == -1)
+ {
+ success = 0;
+ if (!is_type)
+ string_delete (s);
+ break;
+ }
+ if (work->tmpl_argvec)
+ string_append (s, work->tmpl_argvec[idx]);
+ else
+ {
+ char buf[10];
+ sprintf(buf, "T%d", idx);
+ string_append (s, buf);
+ }
+ }
+ else if (is_integral)
{
if (**mangled == 'm')
{
- string_appendn (tname, "-", 1);
+ string_appendn (s, "-", 1);
(*mangled)++;
}
while (isdigit (**mangled))
{
- string_appendn (tname, *mangled, 1);
+ string_appendn (s, *mangled, 1);
(*mangled)++;
}
}
@@ -995,28 +1146,30 @@ demangle_template (work, mangled, tname, trawname)
int val;
if (**mangled == 'm')
{
- string_appendn (tname, "-", 1);
+ string_appendn (s, "-", 1);
(*mangled)++;
}
- string_appendn (tname, "'", 1);
+ string_appendn (s, "'", 1);
val = consume_count(mangled);
if (val == 0)
{
success = 0;
+ if (!is_type)
+ string_delete (s);
break;
}
tmp[0] = (char)val;
tmp[1] = '\0';
- string_appendn (tname, &tmp[0], 1);
- string_appendn (tname, "'", 1);
+ string_appendn (s, &tmp[0], 1);
+ string_appendn (s, "'", 1);
}
else if (is_bool)
{
int val = consume_count (mangled);
if (val == 0)
- string_appendn (tname, "false", 5);
+ string_appendn (s, "false", 5);
else if (val == 1)
- string_appendn (tname, "true", 4);
+ string_appendn (s, "true", 4);
else
success = 0;
}
@@ -1024,31 +1177,31 @@ demangle_template (work, mangled, tname, trawname)
{
if (**mangled == 'm')
{
- string_appendn (tname, "-", 1);
+ string_appendn (s, "-", 1);
(*mangled)++;
}
while (isdigit (**mangled))
{
- string_appendn (tname, *mangled, 1);
+ string_appendn (s, *mangled, 1);
(*mangled)++;
}
if (**mangled == '.') /* fraction */
{
- string_appendn (tname, ".", 1);
+ string_appendn (s, ".", 1);
(*mangled)++;
while (isdigit (**mangled))
{
- string_appendn (tname, *mangled, 1);
+ string_appendn (s, *mangled, 1);
(*mangled)++;
}
}
if (**mangled == 'e') /* exponent */
{
- string_appendn (tname, "e", 1);
+ string_appendn (s, "e", 1);
(*mangled)++;
while (isdigit (**mangled))
{
- string_appendn (tname, *mangled, 1);
+ string_appendn (s, *mangled, 1);
(*mangled)++;
}
}
@@ -1059,34 +1212,53 @@ demangle_template (work, mangled, tname, trawname)
if (symbol_len == 0)
{
success = 0;
+ if (!is_type)
+ string_delete (s);
break;
}
if (symbol_len == 0)
- string_appendn (tname, "0", 1);
+ string_appendn (s, "0", 1);
else
{
char *p = xmalloc (symbol_len + 1), *q;
strncpy (p, *mangled, symbol_len);
p [symbol_len] = '\0';
q = cplus_demangle (p, work->options);
- string_appendn (tname, "&", 1);
+ string_appendn (s, "&", 1);
if (q)
{
- string_append (tname, q);
+ string_append (s, q);
free (q);
}
else
- string_append (tname, p);
+ string_append (s, p);
free (p);
}
*mangled += symbol_len;
}
+ if (!is_type)
+ {
+ int len = s->p - s->b;
+ work->tmpl_argvec[i] = xmalloc (len + 1);
+ memcpy (work->tmpl_argvec[i], s->b, len);
+ work->tmpl_argvec[i][len] = '\0';
+
+ string_appends (tname, s);
+ string_delete (s);
+ }
}
need_comma = 1;
}
- if (tname->p[-1] == '>')
- string_append (tname, " ");
- string_append (tname, ">");
+ if (is_java_array)
+ {
+ string_append (tname, "[]");
+ }
+ else
+ {
+ if (tname->p[-1] == '>')
+ string_append (tname, " ");
+ string_append (tname, ">");
+ }
/*
if (work -> static_type)
@@ -1241,7 +1413,7 @@ demangle_class (work, mangled, declp)
work -> constructor -= 1;
}
}
- string_prepend (declp, "::");
+ string_prepend (declp, (work -> options & DMGL_JAVA) ? "." : "::");
string_prepends (declp, &class_name);
success = 1;
}
@@ -1362,8 +1534,9 @@ demangle_prefix (work, mangled, declp)
success = 0;
}
}
- else if ((scan == *mangled) &&
- (isdigit (scan[2]) || (scan[2] == 'Q') || (scan[2] == 't')))
+ else if ((scan == *mangled)
+ && (isdigit (scan[2]) || (scan[2] == 'Q') || (scan[2] == 't')
+ || (scan[2] == 'H')))
{
/* The ARM says nothing about the mangling of local variables.
But cfront mangles local variables by prepending __<nesting_level>
@@ -1380,7 +1553,8 @@ demangle_prefix (work, mangled, declp)
{
/* A GNU style constructor starts with __[0-9Qt]. But cfront uses
names like __Q2_3foo3bar for nested type names. So don't accept
- this style of constructor for cfront demangling. */
+ this style of constructor for cfront demangling. A GNU
+ style member-template constructor starts with 'H'. */
if (!(LUCID_DEMANGLING || ARM_DEMANGLING))
work -> constructor += 1;
*mangled = scan + 2;
@@ -1512,12 +1686,21 @@ gnu_special (work, mangled, declp)
success = demangle_qualified (work, mangled, declp, 0, 1);
break;
case 't':
- success = demangle_template (work, mangled, declp, 0);
+ success = demangle_template (work, mangled, declp, 0, 1);
break;
default:
if (isdigit(*mangled[0]))
{
n = consume_count(mangled);
+ /* We may be seeing a too-large size, or else a
+ ".<digits>" indicating a static local symbol. In
+ any case, declare victory and move on; *don't* try
+ to use n to allocate. */
+ if (n >= strlen (*mangled))
+ {
+ success = 1;
+ break;
+ }
}
else
{
@@ -1531,7 +1714,8 @@ gnu_special (work, mangled, declp)
{
if (p != NULL)
{
- string_append (declp, "::");
+ string_append (declp,
+ (work -> options & DMGL_JAVA) ? "." : "::");
(*mangled)++;
}
}
@@ -1556,7 +1740,7 @@ gnu_special (work, mangled, declp)
success = demangle_qualified (work, mangled, declp, 0, 1);
break;
case 't':
- success = demangle_template (work, mangled, declp, 0);
+ success = demangle_template (work, mangled, declp, 0, 1);
break;
default:
n = consume_count (mangled);
@@ -1568,7 +1752,7 @@ gnu_special (work, mangled, declp)
/* Consumed everything up to the cplus_marker, append the
variable name. */
(*mangled)++;
- string_append (declp, "::");
+ string_append (declp, (work -> options & DMGL_JAVA) ? "." : "::");
n = strlen (*mangled);
string_appendn (declp, *mangled, n);
(*mangled) += n;
@@ -1608,7 +1792,7 @@ gnu_special (work, mangled, declp)
success = demangle_qualified (work, mangled, declp, 0, 1);
break;
case 't':
- success = demangle_template (work, mangled, declp, 0);
+ success = demangle_template (work, mangled, declp, 0, 1);
break;
default:
success = demangle_fund_type (work, mangled, declp);
@@ -1810,7 +1994,12 @@ demangle_qualified (work, mangled, result, isfuncname, append)
*mangled = *mangled + 1;
if (*mangled[0] == 't')
{
- success = demangle_template(work, mangled, &temp, 0);
+ success = demangle_template(work, mangled, &temp, 0, 1);
+ if (!success) break;
+ }
+ else if (*mangled[0] == 'X')
+ {
+ success = do_type (work, mangled, &temp);
if (!success) break;
}
else
@@ -1827,7 +2016,7 @@ demangle_qualified (work, mangled, result, isfuncname, append)
}
if (qualifiers > 0)
{
- string_appendn (&temp, "::", 2);
+ string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
}
}
@@ -1838,7 +2027,7 @@ demangle_qualified (work, mangled, result, isfuncname, append)
if (isfuncname && (work->constructor & 1 || work->destructor & 1))
{
- string_appendn (&temp, "::", 2);
+ string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
if (work -> destructor & 1)
{
string_append (&temp, "~");
@@ -1857,7 +2046,7 @@ demangle_qualified (work, mangled, result, isfuncname, append)
{
if (!STRING_EMPTY (result))
{
- string_appendn (&temp, "::", 2);
+ string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
}
string_prepends (result, &temp);
}
@@ -1950,7 +2139,8 @@ do_type (work, mangled, result)
case 'P':
case 'p':
(*mangled)++;
- string_prepend (&decl, "*");
+ if (! (work -> options & DMGL_JAVA))
+ string_prepend (&decl, "*");
break;
/* A reference type */
@@ -2032,7 +2222,7 @@ do_type (work, mangled, result)
}
string_append (&decl, ")");
- string_prepend (&decl, "::");
+ string_prepend (&decl, (work -> options & DMGL_JAVA) ? "." : "::");
if (isdigit (**mangled))
{
n = consume_count (mangled);
@@ -2048,7 +2238,7 @@ do_type (work, mangled, result)
{
string temp;
string_init (&temp);
- success = demangle_template (work, mangled, &temp, NULL);
+ success = demangle_template (work, mangled, &temp, NULL, 1);
if (success)
{
string_prependn (&decl, temp.b, temp.p - temp.b);
@@ -2136,6 +2326,37 @@ do_type (work, mangled, result)
success = demangle_qualified (work, mangled, result, 0, 1);
break;
+ case 'X':
+ case 'Y':
+ /* A template parm. We substitute the corresponding argument. */
+ {
+ int idx;
+ int lvl;
+
+ (*mangled)++;
+ idx = consume_count_with_underscores (mangled);
+
+ if (idx == -1
+ || (work->tmpl_argvec && idx >= work->ntmpl_args)
+ || consume_count_with_underscores (mangled) == -1)
+ {
+ success = 0;
+ break;
+ }
+
+ if (work->tmpl_argvec)
+ string_append (result, work->tmpl_argvec[idx]);
+ else
+ {
+ char buf[10];
+ sprintf(buf, "T%d", idx);
+ string_append (result, buf);
+ }
+
+ success = 1;
+ }
+ break;
+
default:
success = demangle_fund_type (work, mangled, result);
break;
@@ -2211,6 +2432,11 @@ demangle_fund_type (work, mangled, result)
string_append (result, "volatile");
}
break;
+ case 'J':
+ (*mangled)++;
+ APPEND_BLANK (result);
+ string_append (result, "__complex");
+ break;
default:
done = 1;
break;
@@ -2305,7 +2531,7 @@ demangle_fund_type (work, mangled, result)
}
break;
case 't':
- success = demangle_template(work,mangled, result, 0);
+ success = demangle_template(work,mangled, result, 0, 1);
break;
default:
success = 0;
@@ -2349,15 +2575,15 @@ remember_type (work, start, len)
if (work -> typevec_size == 0)
{
work -> typevec_size = 3;
- work -> typevec =
- (char **) xmalloc (sizeof (char *) * work -> typevec_size);
+ work -> typevec
+ = (char **) xmalloc (sizeof (char *) * work -> typevec_size);
}
else
{
work -> typevec_size *= 2;
- work -> typevec =
- (char **) xrealloc ((char *)work -> typevec,
- sizeof (char *) * work -> typevec_size);
+ work -> typevec
+ = (char **) xrealloc ((char *)work -> typevec,
+ sizeof (char *) * work -> typevec_size);
}
}
tem = xmalloc (len + 1);
@@ -2860,6 +3086,12 @@ string_prependn (p, s, n)
#ifdef MAIN
+#include "getopt.h"
+
+static char *program_name;
+static char *program_version = VERSION;
+static int flags = DMGL_PARAMS | DMGL_ANSI;
+
static void demangle_it PARAMS ((char *));
static void usage PARAMS ((FILE *, int));
static void fatal PARAMS ((char *));
@@ -2870,7 +3102,7 @@ demangle_it (mangled_name)
{
char *result;
- result = cplus_demangle (mangled_name, DMGL_PARAMS | DMGL_ANSI);
+ result = cplus_demangle (mangled_name, flags);
if (result == NULL)
{
printf ("%s\n", mangled_name);
@@ -2882,11 +3114,6 @@ demangle_it (mangled_name)
}
}
-#include "getopt.h"
-
-static char *program_name;
-static char *program_version = VERSION;
-
static void
usage (stream, status)
FILE *stream;
@@ -2894,8 +3121,8 @@ usage (stream, status)
{
fprintf (stream, "\
Usage: %s [-_] [-n] [-s {gnu,lucid,arm}] [--strip-underscores]\n\
-[--no-strip-underscores] [--format={gnu,lucid,arm}]\n\
-[--help] [--version] [arg...]\n",
+ [--no-strip-underscores] [--format={gnu,lucid,arm}]\n\
+ [--help] [--version] [arg...]\n",
program_name);
exit (status);
}
@@ -2912,6 +3139,7 @@ static struct option long_options[] = {
{"strip-underscores", no_argument, 0, '_'},
{"format", required_argument, 0, 's'},
{"help", no_argument, 0, 'h'},
+ {"java", no_argument, 0, 'j'},
{"no-strip-underscores", no_argument, 0, 'n'},
{"version", no_argument, 0, 'v'},
{0, no_argument, 0, 0}
@@ -2929,7 +3157,7 @@ main (argc, argv)
strip_underscore = prepends_underscore;
- while ((c = getopt_long (argc, argv, "_ns:", long_options, (int *) 0)) != EOF)
+ while ((c = getopt_long (argc, argv, "_ns:j", long_options, (int *) 0)) != EOF)
{
switch (c)
{
@@ -2947,6 +3175,9 @@ main (argc, argv)
case '_':
strip_underscore = 1;
break;
+ case 'j':
+ flags |= DMGL_JAVA;
+ break;
case 's':
if (strcmp (optarg, "gnu") == 0)
{
@@ -3005,8 +3236,7 @@ main (argc, argv)
mbuffer[i] = 0;
- result = cplus_demangle (mbuffer + skip_first,
- DMGL_PARAMS | DMGL_ANSI);
+ result = cplus_demangle (mbuffer + skip_first, flags);
if (result)
{
if (mbuffer[0] == '.')
diff --git a/contrib/binutils/libiberty/floatformat.c b/contrib/binutils/libiberty/floatformat.c
index a012064..7f6086f 100644
--- a/contrib/binutils/libiberty/floatformat.c
+++ b/contrib/binutils/libiberty/floatformat.c
@@ -51,6 +51,14 @@ const struct floatformat floatformat_ieee_double_little =
floatformat_little, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no
};
+/* floatformat for IEEE double, little endian byte order, with big endian word
+ ordering, as on the ARM. */
+
+const struct floatformat floatformat_ieee_double_littlebyte_bigword =
+{
+ floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no
+};
+
const struct floatformat floatformat_i387_ext =
{
floatformat_little, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
diff --git a/contrib/binutils/libiberty/functions.def b/contrib/binutils/libiberty/functions.def
index aeed4c6..0f13f10 100644
--- a/contrib/binutils/libiberty/functions.def
+++ b/contrib/binutils/libiberty/functions.def
@@ -9,6 +9,7 @@
* the corresponding function in libc.
*/
+DEF(asprintf, int, (), NOTHING)
DEF(atexit, int, (f), void (*f)())
DEF(bcmp, int, (s1, s2, length), char *s1 AND char *s2 AND int length )
DEF(bcopy, void, (s1, s2, length), char *s1 AND char *s2 AND int length )
@@ -62,8 +63,8 @@ DEFVAR(sys_siglist, char *sys_siglist[], sys_siglist[0] = 0)
environment, and to generate an entry NEED_<funcname> in config.h
if they are not found. */
-DEFFUNC(strerror, char*, (), NOTHING)
+DEFFUNC(strerror, char*, (errnoval), int errnoval)
DEFFUNC(psignal, void, (signo, message), unsigned signo AND char *message)
DEFFUNC(basename, char *, (name), CONST char *name)
DEFFUNC(on_exit, void, (f, arg), void (*f)() AND char *arg)
-DEFFUNC(strsignal, char *, (), NOTHING)
+DEFFUNC(strsignal, const char *, (signo), int signo)
diff --git a/contrib/binutils/libiberty/getopt.c b/contrib/binutils/libiberty/getopt.c
index 79080aa..fc87ce6 100644
--- a/contrib/binutils/libiberty/getopt.c
+++ b/contrib/binutils/libiberty/getopt.c
@@ -3,29 +3,26 @@
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
before changing it!
- Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97
Free Software Foundation, Inc.
-This file is part of the libiberty library. This library is free
-software; you can redistribute it and/or modify it under the
-terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-This library 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 GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-As a special exception, if you link this library with files
-compiled with a GNU compiler to produce an executable, this does not cause
-the resulting executable to be covered by the GNU General Public License.
-This exception does not however invalidate any other reasons why
-the executable file might be covered by the GNU General Public License. */
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
@@ -34,17 +31,10 @@ the executable file might be covered by the GNU General Public License. */
#endif
#ifdef HAVE_CONFIG_H
-#if defined (emacs) || defined (CONFIG_BROKETS)
-/* We use <config.h> instead of "config.h" so that a compilation
- using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
- (which it would do because it found this file in $srcdir). */
#include <config.h>
-#else
-#include "config.h"
-#endif
#endif
-#ifndef __STDC__
+#if !defined (__STDC__) || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
@@ -61,11 +51,16 @@ the executable file might be covered by the GNU General Public License. */
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
-/* Many versions of the Linux C library include older, broken versions
- of these routines, which will break the linker's command-line
- parsing. */
-#if defined (_LIBC) || !defined (__GNU_LIBRARY__) || defined (__linux__)
+#define GETOPT_INTERFACE_VERSION 2
+#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#include <gnu-versions.h>
+#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+#define ELIDE_CODE
+#endif
+#endif
+
+#ifndef ELIDE_CODE
/* This needs to come after some library #include
@@ -74,8 +69,27 @@ the executable file might be covered by the GNU General Public License. */
/* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */
#include <stdlib.h>
+#include <unistd.h>
#endif /* GNU C library. */
+#ifdef VMS
+#include <unixlib.h>
+#if HAVE_STRING_H - 0
+#include <string.h>
+#endif
+#endif
+
+#ifndef _
+/* This is for other GNU distributions with internationalized messages.
+ When compiling libc, the _ macro is predefined. */
+#ifdef HAVE_LIBINTL_H
+# include <libintl.h>
+# define _(msgid) gettext (msgid)
+#else
+# define _(msgid) (msgid)
+#endif
+#endif
+
/* This version of `getopt' appears to the caller like standard Unix `getopt'
but it behaves differently for the user, since it allows the user
to intersperse the options with the other arguments.
@@ -106,14 +120,20 @@ char *optarg = NULL;
On entry to `getopt', zero means this is the first call; initialize.
- When `getopt' returns EOF, this is the index of the first of the
+ When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
-/* XXX 1003.2 says this must be 1 before any call. */
-int optind = 0;
+/* 1003.2 says this must be 1 before any call. */
+int optind = 1;
+
+/* Formerly, initialization of getopt depended on optind==0, which
+ causes problems with re-calling getopt as programs generally don't
+ know that. */
+
+int __getopt_initialized = 0;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
@@ -162,12 +182,15 @@ int optopt = '?';
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return EOF with `optind' != ARGC. */
+ `--' can cause `getopt' to return -1 with `optind' != ARGC. */
static enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;
+
+/* Value of POSIXLY_CORRECT environment variable. */
+static char *posixly_correct;
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
@@ -202,7 +225,7 @@ my_index (str, chr)
#ifdef __GNUC__
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
That was relevant to code that was here before. */
-#ifndef __STDC__
+#if !defined (__STDC__) || !__STDC__
/* gcc with -traditional declares the built-in strlen to return int,
and has done so at least since version 2.4.5. -- rms. */
extern int strlen (const char *);
@@ -220,6 +243,46 @@ extern int strlen (const char *);
static int first_nonopt;
static int last_nonopt;
+#ifdef _LIBC
+/* Bash 2.0 gives us an environment variable containing flags
+ indicating ARGV elements that should not be considered arguments. */
+
+/* Defined in getopt_init.c */
+extern char *__getopt_nonoption_flags;
+
+static int nonoption_flags_max_len;
+static int nonoption_flags_len;
+
+static int original_argc;
+static char *const *original_argv;
+
+/* Make sure the environment variable bash 2.0 puts in the environment
+ is valid for the getopt call we must make sure that the ARGV passed
+ to getopt is that one passed to the process. */
+static void
+__attribute__ ((unused))
+store_args_and_env (int argc, char *const *argv)
+{
+ /* XXX This is no good solution. We should rather copy the args so
+ that we can compare them later. But we must not use malloc(3). */
+ original_argc = argc;
+ original_argv = argv;
+}
+# ifdef text_set_element
+text_set_element (__libc_subinit, store_args_and_env);
+# endif /* text_set_element */
+
+# define SWAP_FLAGS(ch1, ch2) \
+ if (nonoption_flags_len > 0) \
+ { \
+ char __tmp = __getopt_nonoption_flags[ch1]; \
+ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
+ __getopt_nonoption_flags[ch2] = __tmp; \
+ }
+#else /* !_LIBC */
+# define SWAP_FLAGS(ch1, ch2)
+#endif /* _LIBC */
+
/* Exchange two adjacent subsequences of ARGV.
One subsequence is elements [first_nonopt,last_nonopt)
which contains all the non-options that have been skipped so far.
@@ -229,6 +292,10 @@ static int last_nonopt;
`first_nonopt' and `last_nonopt' are relocated so that they describe
the new indices of the non-options in ARGV after they are moved. */
+#if defined (__STDC__) && __STDC__
+static void exchange (char **);
+#endif
+
static void
exchange (argv)
char **argv;
@@ -243,6 +310,28 @@ exchange (argv)
It leaves the longer segment in the right place overall,
but it consists of two parts that need to be swapped next. */
+#ifdef _LIBC
+ /* First make sure the handling of the `__getopt_nonoption_flags'
+ string can work normally. Our top argument must be in the range
+ of the string. */
+ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
+ {
+ /* We must extend the array. The user plays games with us and
+ presents new arguments. */
+ char *new_str = malloc (top + 1);
+ if (new_str == NULL)
+ nonoption_flags_len = nonoption_flags_max_len = 0;
+ else
+ {
+ memset (__mempcpy (new_str, __getopt_nonoption_flags,
+ nonoption_flags_max_len),
+ '\0', top + 1 - nonoption_flags_max_len);
+ nonoption_flags_max_len = top + 1;
+ __getopt_nonoption_flags = new_str;
+ }
+ }
+#endif
+
while (top > middle && middle > bottom)
{
if (top - middle > middle - bottom)
@@ -257,6 +346,7 @@ exchange (argv)
tem = argv[bottom + i];
argv[bottom + i] = argv[top - (middle - bottom) + i];
argv[top - (middle - bottom) + i] = tem;
+ SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
}
/* Exclude the moved bottom segment from further swapping. */
top -= len;
@@ -273,6 +363,7 @@ exchange (argv)
tem = argv[bottom + i];
argv[bottom + i] = argv[middle + i];
argv[middle + i] = tem;
+ SWAP_FLAGS (bottom + i, middle + i);
}
/* Exclude the moved top segment from further swapping. */
bottom += len;
@@ -287,18 +378,25 @@ exchange (argv)
/* Initialize the internal data when the first call is made. */
+#if defined (__STDC__) && __STDC__
+static const char *_getopt_initialize (int, char *const *, const char *);
+#endif
static const char *
-_getopt_initialize (optstring)
+_getopt_initialize (argc, argv, optstring)
+ int argc;
+ char *const *argv;
const char *optstring;
{
/* Start processing options with ARGV-element 1 (since ARGV-element 0
is the program name); the sequence of previously skipped
non-option ARGV-elements is empty. */
- first_nonopt = last_nonopt = optind = 1;
+ first_nonopt = last_nonopt = optind;
nextchar = NULL;
+ posixly_correct = getenv ("POSIXLY_CORRECT");
+
/* Determine how to handle the ordering of options and nonoptions. */
if (optstring[0] == '-')
@@ -311,11 +409,41 @@ _getopt_initialize (optstring)
ordering = REQUIRE_ORDER;
++optstring;
}
- else if (getenv ("POSIXLY_CORRECT") != NULL)
+ else if (posixly_correct != NULL)
ordering = REQUIRE_ORDER;
else
ordering = PERMUTE;
+#ifdef _LIBC
+ if (posixly_correct == NULL
+ && argc == original_argc && argv == original_argv)
+ {
+ if (nonoption_flags_max_len == 0)
+ {
+ if (__getopt_nonoption_flags == NULL
+ || __getopt_nonoption_flags[0] == '\0')
+ nonoption_flags_max_len = -1;
+ else
+ {
+ const char *orig_str = __getopt_nonoption_flags;
+ int len = nonoption_flags_max_len = strlen (orig_str);
+ if (nonoption_flags_max_len < argc)
+ nonoption_flags_max_len = argc;
+ __getopt_nonoption_flags =
+ (char *) malloc (nonoption_flags_max_len);
+ if (__getopt_nonoption_flags == NULL)
+ nonoption_flags_max_len = -1;
+ else
+ memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
+ '\0', nonoption_flags_max_len - len);
+ }
+ }
+ nonoption_flags_len = nonoption_flags_max_len;
+ }
+ else
+ nonoption_flags_len = 0;
+#endif
+
return optstring;
}
@@ -332,7 +460,7 @@ _getopt_initialize (optstring)
updating `optind' and `nextchar' so that the next call to `getopt' can
resume the scan with the following option character or ARGV-element.
- If there are no more option characters, `getopt' returns `EOF'.
+ If there are no more option characters, `getopt' returns -1.
Then `optind' is the index in ARGV of the first ARGV-element
that is not an option. (The ARGV-elements have been permuted
so that those that are not options now come last.)
@@ -386,16 +514,37 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
optarg = NULL;
- if (optind == 0)
- optstring = _getopt_initialize (optstring);
+ if (optind == 0 || !__getopt_initialized)
+ {
+ if (optind == 0)
+ optind = 1; /* Don't scan ARGV[0], the program name. */
+ optstring = _getopt_initialize (argc, argv, optstring);
+ __getopt_initialized = 1;
+ }
- if (argc == 0)
- return EOF;
+ /* Test whether ARGV[optind] points to a non-option argument.
+ Either it does not have option syntax, or there is an environment flag
+ from the shell indicating it is not an option. The later information
+ is only used when the used in the GNU libc. */
+#ifdef _LIBC
+#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
+ || (optind < nonoption_flags_len \
+ && __getopt_nonoption_flags[optind] == '1'))
+#else
+#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
+#endif
if (nextchar == NULL || *nextchar == '\0')
{
/* Advance to the next ARGV-element. */
+ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
+ moved back by the user (who may also have changed the arguments). */
+ if (last_nonopt > optind)
+ last_nonopt = optind;
+ if (first_nonopt > optind)
+ first_nonopt = optind;
+
if (ordering == PERMUTE)
{
/* If we have just processed some options following some non-options,
@@ -409,8 +558,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
/* Skip any additional non-options
and extend the range of non-options previously skipped. */
- while (optind < argc
- && (argv[optind][0] != '-' || argv[optind][1] == '\0'))
+ while (optind < argc && NONOPTION_P)
optind++;
last_nonopt = optind;
}
@@ -442,16 +590,16 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
that we previously skipped, so the caller will digest them. */
if (first_nonopt != last_nonopt)
optind = first_nonopt;
- return EOF;
+ return -1;
}
/* If we have come to a non-option and did not permute it,
either stop the scan or describe it to the caller and pass it by. */
- if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
+ if (NONOPTION_P)
{
if (ordering == REQUIRE_ORDER)
- return EOF;
+ return -1;
optarg = argv[optind++];
return 1;
}
@@ -487,7 +635,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
- int indfound;
+ int indfound = -1;
int option_index;
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
@@ -498,7 +646,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
- if (nameend - nextchar == strlen (p->name))
+ if ((unsigned int) (nameend - nextchar)
+ == (unsigned int) strlen (p->name))
{
/* Exact match found. */
pfound = p;
@@ -520,10 +669,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (ambig && !exact)
{
if (opterr)
- fprintf (stderr, "%s: option `%s' is ambiguous\n",
+ fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
+ optopt = 0;
return '?';
}
@@ -540,19 +690,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else
{
if (opterr)
- {
- if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- "%s: option `--%s' doesn't allow an argument\n",
- argv[0], pfound->name);
- else
- /* +option or -option */
- fprintf (stderr,
- "%s: option `%c%s' doesn't allow an argument\n",
- argv[0], argv[optind - 1][0], pfound->name);
- }
+ if (argv[optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ _("%s: option `--%s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ _("%s: option `%c%s' doesn't allow an argument\n"),
+ argv[0], argv[optind - 1][0], pfound->name);
+
nextchar += strlen (nextchar);
+
+ optopt = pfound->val;
return '?';
}
}
@@ -563,9 +714,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else
{
if (opterr)
- fprintf (stderr, "%s: option `%s' requires an argument\n",
- argv[0], argv[optind - 1]);
+ fprintf (stderr,
+ _("%s: option `%s' requires an argument\n"),
+ argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
+ optopt = pfound->val;
return optstring[0] == ':' ? ':' : '?';
}
}
@@ -591,15 +744,16 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (argv[optind][1] == '-')
/* --option */
- fprintf (stderr, "%s: unrecognized option `--%s'\n",
+ fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
argv[0], nextchar);
else
/* +option or -option */
- fprintf (stderr, "%s: unrecognized option `%c%s'\n",
+ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
argv[0], argv[optind][0], nextchar);
}
nextchar = (char *) "";
optind++;
+ optopt = 0;
return '?';
}
}
@@ -618,12 +772,141 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (opterr)
{
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
+ if (posixly_correct)
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, _("%s: illegal option -- %c\n"),
+ argv[0], c);
+ else
+ fprintf (stderr, _("%s: invalid option -- %c\n"),
+ argv[0], c);
}
optopt = c;
return '?';
}
+ /* Convenience. Treat POSIX -W foo same as long option --foo */
+ if (temp[0] == 'W' && temp[1] == ';')
+ {
+ char *nameend;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int exact = 0;
+ int ambig = 0;
+ int indfound = 0;
+ int option_index;
+
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ optind++;
+ }
+ else if (optind == argc)
+ {
+ if (opterr)
+ {
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ return c;
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ optarg = argv[optind++];
+
+ /* optarg is now the argument, see if it's in the
+ table of longopts. */
+
+ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
+ {
+ if ((unsigned int) (nameend - nextchar) == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second or later nonexact match found. */
+ ambig = 1;
+ }
+ if (ambig && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
+ argv[0], argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ return '?';
+ }
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ optarg = nameend + 1;
+ else
+ {
+ if (opterr)
+ fprintf (stderr, _("\
+%s: option `-W %s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+
+ nextchar += strlen (nextchar);
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (optind < argc)
+ optarg = argv[optind++];
+ else
+ {
+ if (opterr)
+ fprintf (stderr,
+ _("%s: option `%s' requires an argument\n"),
+ argv[0], argv[optind - 1]);
+ nextchar += strlen (nextchar);
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+ nextchar = NULL;
+ return 'W'; /* Let the application handle it. */
+ }
if (temp[1] == ':')
{
if (temp[2] == ':')
@@ -653,8 +936,9 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (opterr)
{
/* 1003.2 specifies the format of this message. */
- fprintf (stderr, "%s: option requires an argument -- %c\n",
- argv[0], c);
+ fprintf (stderr,
+ _("%s: option requires an argument -- %c\n"),
+ argv[0], c);
}
optopt = c;
if (optstring[0] == ':')
@@ -685,7 +969,7 @@ getopt (argc, argv, optstring)
0);
}
-#endif /* _LIBC or not __GNU_LIBRARY__. */
+#endif /* Not ELIDE_CODE. */
#ifdef TEST
@@ -705,7 +989,7 @@ main (argc, argv)
int this_option_optind = optind ? optind : 1;
c = getopt (argc, argv, "abc:d:0123456789");
- if (c == EOF)
+ if (c == -1)
break;
switch (c)
diff --git a/contrib/binutils/libiberty/getopt1.c b/contrib/binutils/libiberty/getopt1.c
index c3400e5..af8e681 100644
--- a/contrib/binutils/libiberty/getopt1.c
+++ b/contrib/binutils/libiberty/getopt1.c
@@ -1,35 +1,31 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
- Free Software Foundation, Inc.
+ Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License
- as published by the Free Software Foundation; either version 2, or
- (at your option) any later version.
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Library General Public License for more details.
+ GNU General Public License for more details.
- You should have received a copy of the GNU Library General Public License
+ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifdef HAVE_CONFIG_H
-#if defined (emacs) || defined (CONFIG_BROKETS)
-/* We use <config.h> instead of "config.h" so that a compilation
- using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
- (which it would do because it found this file in $srcdir). */
#include <config.h>
-#else
-#include "config.h"
-#endif
#endif
#include "getopt.h"
-#ifndef __STDC__
+#if !defined (__STDC__) || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
@@ -46,19 +42,22 @@
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
-/* Many versions of the Linux C library include older, broken versions
- of these routines, which will break the linker's command-line
- parsing. */
-#if defined (_LIBC) || !defined (__GNU_LIBRARY__) || defined (__linux__)
+#define GETOPT_INTERFACE_VERSION 2
+#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#include <gnu-versions.h>
+#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+#define ELIDE_CODE
+#endif
+#endif
+
+#ifndef ELIDE_CODE
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
-#else
-char *getenv ();
#endif
#ifndef NULL
@@ -93,7 +92,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index)
}
-#endif /* _LIBC or not __GNU_LIBRARY__. */
+#endif /* Not ELIDE_CODE. */
#ifdef TEST
@@ -124,7 +123,7 @@ main (argc, argv)
c = getopt_long (argc, argv, "abc:d:0123456789",
long_options, &option_index);
- if (c == EOF)
+ if (c == -1)
break;
switch (c)
diff --git a/contrib/binutils/libiberty/obstack.c b/contrib/binutils/libiberty/obstack.c
index 2ccf590..a6880ca 100644
--- a/contrib/binutils/libiberty/obstack.c
+++ b/contrib/binutils/libiberty/obstack.c
@@ -39,6 +39,23 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif
#endif
+/* CYGNUS LOCAL (not to be elided!) */
+
+int
+_obstack_memory_used (h)
+ struct obstack *h;
+{
+ register struct _obstack_chunk* lp;
+ register int nbytes = 0;
+
+ for (lp = h->chunk; lp != 0; lp = lp->prev)
+ {
+ nbytes += lp->limit - (char *) lp;
+ }
+ return nbytes;
+}
+
+/* END CYGNUS LOCAL */
#ifndef ELIDE_CODE
@@ -379,24 +396,6 @@ obstack_free (h, obj)
abort ();
}
-/* CYGNUS LOCAL */
-
-int
-_obstack_memory_used (h)
- struct obstack *h;
-{
- register struct _obstack_chunk* lp;
- register int nbytes = 0;
-
- for (lp = h->chunk; lp != 0; lp = lp->prev)
- {
- nbytes += lp->limit - (char *) lp;
- }
- return nbytes;
-}
-
-/* END CYGNUS LOCAL */
-
#if 0
/* These are now turned off because the applications do not use it
and it uses bcopy via obstack_grow, which causes trouble on sysV. */
diff --git a/contrib/binutils/libiberty/pexecute.c b/contrib/binutils/libiberty/pexecute.c
index 7ffe9ca..fbbea40 100644
--- a/contrib/binutils/libiberty/pexecute.c
+++ b/contrib/binutils/libiberty/pexecute.c
@@ -1,6 +1,6 @@
/* Utilities to execute a program in a subprocess (possibly linked by pipes
with other subprocesses), and wait for it.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
@@ -23,11 +23,14 @@ Boston, MA 02111-1307, USA. */
/* This file lives in at least two places: libiberty and gcc.
Don't change one without the other. */
+#ifdef IN_GCC
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <errno.h>
#ifdef IN_GCC
-#include "config.h"
#include "gansidecl.h"
/* ??? Need to find a suitable header file. */
#define PEXECUTE_FIRST 1
@@ -217,12 +220,16 @@ pwait (pid, status, flags)
#endif /* MSDOS */
-#if defined (_WIN32) && !defined (__CYGWIN32__)
+#if defined (_WIN32)
#include <process.h>
-/* ??? Why are these __spawnv{,p} and not _spawnv{,p}? */
-extern int __spawnv ();
-extern int __spawnvp ();
+
+#ifdef __CYGWIN32__
+
+#define fix_argv(argvec) (argvec)
+
+extern int _spawnv ();
+extern int _spawnvp ();
int
pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
@@ -237,29 +244,204 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
abort ();
- pid = (flags & PEXECUTE_SEARCH ? __spawnvp : __spawnv) (_P_NOWAIT, program, argv);
+ pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv)
+ (_P_NOWAIT, program, fix_argv(argv));
+ if (pid == -1)
+ {
+ *errmsg_fmt = install_error_msg;
+ *errmsg_arg = program;
+ return -1;
+ }
+ return pid;
+}
+
+int
+pwait (pid, status, flags)
+ int pid;
+ int *status;
+ int flags;
+{
+ /* ??? Here's an opportunity to canonicalize the values in STATUS.
+ Needed? */
+ return cwait (status, pid, WAIT_CHILD);
+}
+
+#else /* ! __CYGWIN32__ */
+
+/* This is a kludge to get around the Microsoft C spawn functions' propensity
+ to remove the outermost set of double quotes from all arguments. */
+
+const char * const *
+fix_argv (argvec)
+ char **argvec;
+{
+ int i;
+
+ for (i = 1; argvec[i] != 0; i++)
+ {
+ int len, j;
+ char *temp, *newtemp;
+
+ temp = argvec[i];
+ len = strlen (temp);
+ for (j = 0; j < len; j++)
+ {
+ if (temp[j] == '"')
+ {
+ newtemp = xmalloc (len + 2);
+ strncpy (newtemp, temp, j);
+ newtemp [j] = '\\';
+ strncpy (&newtemp [j+1], &temp [j], len-j);
+ newtemp [len+1] = 0;
+ temp = newtemp;
+ len++;
+ j++;
+ }
+ }
+
+ argvec[i] = temp;
+ }
+
+ return (const char * const *) argvec;
+}
+
+#include <io.h>
+#include <fcntl.h>
+#include <signal.h>
+
+/* mingw32 headers may not define the following. */
+
+#ifndef _P_WAIT
+# define _P_WAIT 0
+# define _P_NOWAIT 1
+# define _P_OVERLAY 2
+# define _P_NOWAITO 3
+# define _P_DETACH 4
+
+# define WAIT_CHILD 0
+# define WAIT_GRANDCHILD 1
+#endif
+
+/* Win32 supports pipes */
+int
+pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
+ const char *program;
+ char * const *argv;
+ const char *this_pname;
+ const char *temp_base;
+ char **errmsg_fmt, **errmsg_arg;
+ int flags;
+{
+ int pid;
+ int pdes[2], org_stdin, org_stdout;
+ int input_desc, output_desc;
+ int retries, sleep_interval;
+
+ /* Pipe waiting from last process, to be used as input for the next one.
+ Value is STDIN_FILE_NO if no pipe is waiting
+ (i.e. the next command is the first of a group). */
+ static int last_pipe_input;
+
+ /* If this is the first process, initialize. */
+ if (flags & PEXECUTE_FIRST)
+ last_pipe_input = STDIN_FILE_NO;
+
+ input_desc = last_pipe_input;
+
+ /* If this isn't the last process, make a pipe for its output,
+ and record it as waiting to be the input to the next process. */
+ if (! (flags & PEXECUTE_LAST))
+ {
+ if (_pipe (pdes, 256, O_BINARY) < 0)
+ {
+ *errmsg_fmt = "pipe";
+ *errmsg_arg = NULL;
+ return -1;
+ }
+ output_desc = pdes[WRITE_PORT];
+ last_pipe_input = pdes[READ_PORT];
+ }
+ else
+ {
+ /* Last process. */
+ output_desc = STDOUT_FILE_NO;
+ last_pipe_input = STDIN_FILE_NO;
+ }
+
+ if (input_desc != STDIN_FILE_NO)
+ {
+ org_stdin = dup (STDIN_FILE_NO);
+ dup2 (input_desc, STDIN_FILE_NO);
+ close (input_desc);
+ }
+
+ if (output_desc != STDOUT_FILE_NO)
+ {
+ org_stdout = dup (STDOUT_FILE_NO);
+ dup2 (output_desc, STDOUT_FILE_NO);
+ close (output_desc);
+ }
+
+ pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv)
+ (_P_NOWAIT, program, fix_argv(argv));
+
+ if (input_desc != STDIN_FILE_NO)
+ {
+ dup2 (org_stdin, STDIN_FILE_NO);
+ close (org_stdin);
+ }
+
+ if (output_desc != STDOUT_FILE_NO)
+ {
+ dup2 (org_stdout, STDOUT_FILE_NO);
+ close (org_stdout);
+ }
+
if (pid == -1)
{
*errmsg_fmt = install_error_msg;
*errmsg_arg = program;
return -1;
}
+
return pid;
}
+/* MS CRTDLL doesn't return enough information in status to decide if the
+ child exited due to a signal or not, rather it simply returns an
+ integer with the exit code of the child; eg., if the child exited with
+ an abort() call and didn't have a handler for SIGABRT, it simply returns
+ with status = 3. We fix the status code to conform to the usual WIF*
+ macros. Note that WIFSIGNALED will never be true under CRTDLL. */
+
int
pwait (pid, status, flags)
int pid;
int *status;
int flags;
{
+ int termstat;
+
+ pid = _cwait (&termstat, pid, WAIT_CHILD);
+
/* ??? Here's an opportunity to canonicalize the values in STATUS.
Needed? */
- int pid = cwait (status, pid, WAIT_CHILD);
+
+ /* cwait returns the child process exit code in termstat.
+ A value of 3 indicates that the child caught a signal, but not
+ which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we
+ report SIGABRT. */
+ if (termstat == 3)
+ *status = SIGABRT;
+ else
+ *status = (((termstat) & 0xff) << 8);
+
return pid;
}
-#endif /* WIN32 */
+#endif /* ! defined (__CYGWIN32__) */
+
+#endif /* _WIN32 */
#ifdef OS2
@@ -433,11 +615,16 @@ pfinish ()
/* include for Unix-like environments but not for Dos-like environments */
#if ! defined (__MSDOS__) && ! defined (OS2) && ! defined (MPW) \
- && (defined (__CYGWIN32__) || ! defined (_WIN32))
+ && ! defined (_WIN32)
+#ifdef VMS
+#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \
+ lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1)
+#else
#ifdef USG
#define vfork fork
#endif
+#endif
extern int execv ();
extern int execvp ();
@@ -566,8 +753,12 @@ pwait (pid, status, flags)
{
/* ??? Here's an opportunity to canonicalize the values in STATUS.
Needed? */
+#ifdef VMS
+ pid = waitpid (-1, status, 0);
+#else
pid = wait (status);
+#endif
return pid;
}
-#endif /* ! __MSDOS__ && ! OS2 && ! MPW && (__CYGWIN32___ || ! _WIN32) */
+#endif /* ! __MSDOS__ && ! OS2 && ! MPW && ! _WIN32 */
diff --git a/contrib/binutils/libiberty/strsignal.c b/contrib/binutils/libiberty/strsignal.c
index 7d40b4c..d517eed 100644
--- a/contrib/binutils/libiberty/strsignal.c
+++ b/contrib/binutils/libiberty/strsignal.c
@@ -243,7 +243,13 @@ static const char **sys_siglist;
#else
+#ifdef NSIG
static int sys_nsig = NSIG;
+#else
+#ifdef _NSIG
+static int sys_nsig = _NSIG;
+#endif
+#endif
extern const char * const sys_siglist[];
#endif
diff --git a/contrib/binutils/libiberty/vasprintf.c b/contrib/binutils/libiberty/vasprintf.c
index 3794cbd..da83db2 100644
--- a/contrib/binutils/libiberty/vasprintf.c
+++ b/contrib/binutils/libiberty/vasprintf.c
@@ -74,7 +74,7 @@ int_vasprintf (result, format, args)
}
while (strchr ("hlL", *p))
++p;
- /* Should be big enough for any format specifier except %s. */
+ /* Should be big enough for any format specifier except %s and floats. */
total_width += 30;
switch (*p)
{
@@ -93,6 +93,9 @@ int_vasprintf (result, format, args)
case 'g':
case 'G':
(void) va_arg (ap, double);
+ /* Since an ieee double can have an exponent of 307, we'll
+ make the buffer wide enough to cover the gross case. */
+ total_width += 307;
break;
case 's':
total_width += strlen (va_arg (ap, char *));
@@ -118,7 +121,11 @@ int
vasprintf (result, format, args)
char **result;
const char *format;
+#if defined (_BSD_VA_LIST_) && defined (__FreeBSD__)
+ _BSD_VA_LIST_ args;
+#else
va_list args;
+#endif
{
return int_vasprintf (result, format, &args);
}
diff --git a/contrib/binutils/libiberty/xmalloc.c b/contrib/binutils/libiberty/xmalloc.c
index c479b1f..b88105a 100644
--- a/contrib/binutils/libiberty/xmalloc.c
+++ b/contrib/binutils/libiberty/xmalloc.c
@@ -42,16 +42,22 @@ PTR sbrk PARAMS ((ptrdiff_t));
/* The program name if set. */
static const char *name = "";
-/* The initial sbrk, set when the program name is set. */
+#if ! defined (_WIN32) || defined (__CYGWIN32__)
+/* The initial sbrk, set when the program name is set. Not used for win32
+ ports other than cygwin32. */
static char *first_break = NULL;
+#endif
void
xmalloc_set_program_name (s)
const char *s;
{
name = s;
+#if ! defined (_WIN32) || defined (__CYGWIN32__)
+ /* Win32 ports other than cygwin32 don't have brk() */
if (first_break == NULL)
first_break = (char *) sbrk (0);
+#endif /* ! _WIN32 || __CYGWIN32 __ */
}
PTR
@@ -65,6 +71,7 @@ xmalloc (size)
newmem = malloc (size);
if (!newmem)
{
+#if ! defined (_WIN32) || defined (__CYGWIN32__)
extern char **environ;
size_t allocated;
@@ -76,6 +83,12 @@ xmalloc (size)
"\n%s%sCan not allocate %lu bytes after allocating %lu bytes\n",
name, *name ? ": " : "",
(unsigned long) size, (unsigned long) allocated);
+#else
+ fprintf (stderr,
+ "\n%s%sCan not allocate %lu bytes\n",
+ name, *name ? ": " : "",
+ (unsigned long) size);
+#endif /* ! _WIN32 || __CYGWIN32 __ */
xexit (1);
}
return (newmem);
@@ -96,6 +109,7 @@ xrealloc (oldmem, size)
newmem = realloc (oldmem, size);
if (!newmem)
{
+#ifndef __MINGW32__
extern char **environ;
size_t allocated;
@@ -107,6 +121,12 @@ xrealloc (oldmem, size)
"\n%s%sCan not reallocate %lu bytes after allocating %lu bytes\n",
name, *name ? ": " : "",
(unsigned long) size, (unsigned long) allocated);
+#else
+ fprintf (stderr,
+ "\n%s%sCan not reallocate %lu bytes\n",
+ name, *name ? ": " : "",
+ (unsigned long) size);
+#endif /* __MINGW32__ */
xexit (1);
}
return (newmem);
diff --git a/contrib/binutils/ltconfig b/contrib/binutils/ltconfig
new file mode 100755
index 0000000..fe78498
--- /dev/null
+++ b/contrib/binutils/ltconfig
@@ -0,0 +1,1512 @@
+#! /bin/sh
+
+# ltconfig - Create a system-specific libtool.
+# Copyright (C) 1996-1998 Free Software Foundation, Inc.
+# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A lot of this script is taken from autoconf-2.10.
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
+
+echo=echo
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
+else
+ # The Solaris and AIX default echo program unquotes backslashes.
+ # This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ # So, we emulate echo with printf '%s\n'
+ echo="printf %s\\n"
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
+ else
+ # Oops. We have no working printf. Try to find a not-so-buggy echo.
+ echo=echo
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
+ for dir in $PATH /usr/ucb; do
+ if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+fi
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# The name of this program.
+progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
+
+# Constants:
+PROGRAM=ltconfig
+PACKAGE=libtool
+VERSION=1.2
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
+rm="rm -f"
+
+help="Try \`$progname --help' for more information."
+
+# Global variables:
+can_build_shared=yes
+enable_shared=yes
+# All known linkers require a `.a' archive for static linking.
+enable_static=yes
+ltmain=
+silent=
+srcdir=
+ac_config_guess=
+ac_config_sub=
+host=
+nonopt=
+verify_host=yes
+with_gcc=no
+with_gnu_ld=no
+
+old_AR="$AR"
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+old_CPPFLAGS="$CPPFLAGS"
+old_LD="$LD"
+old_LN_S="$LN_S"
+old_NM="$NM"
+old_RANLIB="$RANLIB"
+
+# Parse the command line options.
+args=
+prev=
+for option
+do
+ case "$option" in
+ -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ eval "$prev=\$option"
+ prev=
+ continue
+ fi
+
+ case "$option" in
+ --help) cat <<EOM
+Usage: $progname [OPTION]... LTMAIN [HOST]
+
+Generate a system-specific libtool script.
+
+ --disable-shared do not build shared libraries
+ --disable-static do not build static libraries
+ --help display this help and exit
+ --no-verify do not verify that HOST is a valid host type
+ --quiet same as \`--silent'
+ --silent do not print informational messages
+ --srcdir=DIR find \`config.guess' in DIR
+ --version output version information and exit
+ --with-gcc assume that the GNU C compiler will be used
+ --with-gnu-ld assume that the C compiler uses the GNU linker
+
+LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
+functionality.
+
+HOST is the canonical host system name [default=guessed].
+EOM
+ exit 0
+ ;;
+
+ --disable-shared) enable_shared=no ;;
+
+ --disable-static) enable_static=no ;;
+
+ --quiet | --silent) silent=yes ;;
+
+ --srcdir) prev=srcdir ;;
+ --srcdir=*) srcdir="$optarg" ;;
+
+ --no-verify) verify_host=no ;;
+
+ --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
+
+ --with-gcc) with_gcc=yes ;;
+ --with-gnu-ld) with_gnu_ld=yes ;;
+
+ -*)
+ echo "$progname: unrecognized option \`$option'" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *)
+ if test -z "$ltmain"; then
+ ltmain="$option"
+ elif test -z "$host"; then
+# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
+# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
+# echo "$progname: warning \`$option' is not a valid host type" 1>&2
+# fi
+ host="$option"
+ else
+ echo "$progname: too many arguments" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi ;;
+ esac
+done
+
+if test -z "$ltmain"; then
+ echo "$progname: you must specify a LTMAIN file" 1>&2
+ echo "$help" 1>&2
+ exit 1
+fi
+
+if test -f "$ltmain"; then :
+else
+ echo "$progname: \`$ltmain' does not exist" 1>&2
+ echo "$help" 1>&2
+ exit 1
+fi
+
+# Quote any args containing shell metacharacters.
+ltconfig_args=
+for arg
+do
+ case "$arg" in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ltconfig_args="$ltconfig_args '$arg'" ;;
+ *) ltconfig_args="$ltconfig_args $arg" ;;
+ esac
+done
+
+# A relevant subset of AC_INIT.
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 5 compiler messages saved in config.log
+# 6 checking for... messages and results
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>>./config.log
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+if test -z "$srcdir"; then
+ # Assume the source directory is the same one as the path to ltmain.sh.
+ srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
+ test "$srcdir" = "$ltmain" && srcdir=.
+fi
+
+trap "$rm conftest*; exit 1" 1 2 15
+if test "$verify_host" = yes; then
+ # Check for config.guess and config.sub.
+ ac_aux_dir=
+ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/config.guess; then
+ ac_aux_dir=$ac_dir
+ break
+ fi
+ done
+ if test -z "$ac_aux_dir"; then
+ echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi
+ ac_config_guess=$ac_aux_dir/config.guess
+ ac_config_sub=$ac_aux_dir/config.sub
+
+ # Make sure we can run config.sub.
+ if $ac_config_sub sun4 >/dev/null 2>&1; then :
+ else
+ echo "$progname: cannot run $ac_config_sub" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi
+
+ echo $ac_n "checking host system type""... $ac_c" 1>&6
+
+ host_alias=$host
+ case "$host_alias" in
+ "")
+ if host_alias=`$ac_config_guess`; then :
+ else
+ echo "$progname: cannot guess host type; you must specify one" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi ;;
+ esac
+ host=`$ac_config_sub $host_alias`
+ echo "$ac_t$host" 1>&6
+
+ # Make sure the host verified.
+ test -z "$host" && exit 1
+
+elif test -z "$host"; then
+ echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
+ echo "$help" 1>&2
+ exit 1
+else
+ host_alias=$host
+fi
+
+# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+case "$host_os" in
+linux-gnu*) ;;
+linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+esac
+
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+case "$host_os" in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "${COLLECT_NAMES+set}" != set; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR cru $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+# Set a sane default for `AR'.
+test -z "$AR" && AR=ar
+
+# If RANLIB is not set, then run the test.
+if test "${RANLIB+set}" != "set"; then
+ result=no
+
+ echo $ac_n "checking for ranlib... $ac_c" 1>&6
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ if test -f $dir/ranlib; then
+ RANLIB="ranlib"
+ result="ranlib"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+
+ echo "$ac_t$result" 1>&6
+fi
+
+if test -n "$RANLIB"; then
+ old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
+ old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
+fi
+
+# Check to see if we are using GCC.
+if test "$with_gcc" != yes || test -z "$CC"; then
+ # If CC is not set, then try to find GCC or a usable CC.
+ if test -z "$CC"; then
+ echo $ac_n "checking for gcc... $ac_c" 1>&6
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
+ for dir in $PATH; do
+ IFS="$save_ifs"
+ test -z "$dir" && dir=.
+ if test -f $dir/gcc; then
+ CC="gcc"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+
+ if test -n "$CC"; then
+ echo "$ac_t$CC" 1>&6
+ else
+ echo "$ac_t"no 1>&6
+ fi
+ fi
+
+ # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
+ if test -z "$CC"; then
+ echo $ac_n "checking for cc... $ac_c" 1>&6
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
+ cc_rejected=no
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ if test -f $dir/cc; then
+ if test "$dir/cc" = "/usr/ucb/cc"; then
+ cc_rejected=yes
+ continue
+ fi
+ CC="cc"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test $cc_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same name, so the bogon will be chosen
+ # first if we set CC to just the name; use the full file name.
+ shift
+ set dummy "$dir/cc" "$@"
+ shift
+ CC="$@"
+ fi
+ fi
+
+ if test -n "$CC"; then
+ echo "$ac_t$CC" 1>&6
+ else
+ echo "$ac_t"no 1>&6
+ fi
+
+ if test -z "$CC"; then
+ echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
+ exit 1
+ fi
+ fi
+
+ # Now see if the compiler is really GCC.
+ with_gcc=no
+ echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
+ echo "$progname:424: checking whether we are using GNU C" >&5
+
+ $rm conftest.c
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+ if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ with_gcc=yes
+ fi
+ $rm conftest.c
+ echo "$ac_t$with_gcc" 1>&6
+fi
+
+# Allow CC to be a program name with arguments.
+set dummy $CC
+compiler="$2"
+
+echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
+pic_flag=
+special_shlib_compile_flags=
+wl=
+link_static_flag=
+no_builtin_flag=
+
+if test "$with_gcc" = yes; then
+ wl='-Wl,'
+ link_static_flag='-static'
+ no_builtin_flag=' -fno-builtin'
+
+ case "$host_os" in
+ aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
+ # PIC is the default for these OSes.
+ ;;
+ os2*)
+ # We can build DLLs from non-PIC.
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ pic_flag='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ *)
+ pic_flag='-fPIC'
+ ;;
+ esac
+else
+ # PORTME Check for PIC flags for the system compiler.
+ case "$host_os" in
+ aix3* | aix4*)
+ # All AIX code is PIC.
+ link_static_flag='-bnso -bI:/lib/syscalls.exp'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ # Is there a better link_static_flag that works with the bundled CC?
+ wl='-Wl,'
+ link_static_flag="${wl}-a ${wl}archive"
+ pic_flag='+Z'
+ ;;
+
+ irix5* | irix6*)
+ wl='-Wl,'
+ link_static_flag='-non_shared'
+ # PIC (with -KPIC) is the default.
+ ;;
+
+ os2*)
+ # We can build DLLs from non-PIC.
+ ;;
+
+ osf3* | osf4*)
+ # All OSF/1 code is PIC.
+ wl='-Wl,'
+ link_static_flag='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ pic_flag='-Kpic'
+ link_static_flag='-dn'
+ special_shlib_compile_flags='-belf'
+ ;;
+
+ solaris2*)
+ pic_flag='-KPIC'
+ link_static_flag='-Bstatic'
+ wl='-Wl,'
+ ;;
+
+ sunos4*)
+ pic_flag='-PIC'
+ link_static_flag='-Bstatic'
+ wl='-Qoption ld '
+ ;;
+
+ sysv4.2uw2*)
+ pic_flag='-KPIC'
+ link_static_flag='-Bstatic'
+ wl='-Wl,'
+ ;;
+
+ uts4*)
+ pic_flag='-pic'
+ link_static_flag='-Bstatic'
+ ;;
+
+ *)
+ can_build_shared=no
+ ;;
+ esac
+fi
+
+if test -n "$pic_flag"; then
+ echo "$ac_t$pic_flag" 1>&6
+
+ # Check to make sure the pic_flag actually works.
+ echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
+ $rm conftest*
+ echo > conftest.c
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $pic_flag -DPIC"
+ echo "$progname:547: checking if $compiler PIC flag $pic_flag works" >&5
+ if { (eval echo $progname:548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
+ # Append any warnings to the config.log.
+ cat conftest.err 1>&5
+
+ # On HP-UX, both CC and GCC only warn that PIC is supported... then they
+ # create non-PIC objects. So, if there were any warnings, we assume that
+ # PIC is not supported.
+ if test -s conftest.err; then
+ echo "$ac_t"no 1>&6
+ can_build_shared=no
+ pic_flag=
+ else
+ echo "$ac_t"yes 1>&6
+ pic_flag=" $pic_flag"
+ fi
+ else
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ can_build_shared=no
+ pic_flag=
+ echo "$ac_t"no 1>&6
+ fi
+ CFLAGS="$save_CFLAGS"
+ $rm conftest*
+else
+ echo "$ac_t"none 1>&6
+fi
+
+# Check for any special shared library compilation flags.
+if test -n "$special_shlib_compile_flags"; then
+ echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
+ if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
+ else
+ echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
+ can_build_shared=no
+ fi
+fi
+
+echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
+$rm conftest*
+echo 'main(){return(0);}' > conftest.c
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $link_static_flag"
+echo "$progname:591: checking if $compiler static flag $link_static_flag works" >&5
+if { (eval echo $progname:592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ echo "$ac_t$link_static_flag" 1>&6
+else
+ echo "$ac_t"none 1>&6
+ link_static_flag=
+fi
+LDFLAGS="$save_LDFLAGS"
+$rm conftest*
+
+if test -z "$LN_S"; then
+ # Check to see if we can use ln -s, or we need hard links.
+ echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
+ $rm conftestdata
+ if ln -s X conftestdata 2>/dev/null; then
+ $rm conftestdata
+ LN_S="ln -s"
+ else
+ LN_S=ln
+ fi
+ if test "$LN_S" = "ln -s"; then
+ echo "$ac_t"yes 1>&6
+ else
+ echo "$ac_t"no 1>&6
+ fi
+fi
+
+# Make sure LD is an absolute path.
+if test -z "$LD"; then
+ ac_prog=ld
+ if test "$with_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
+ echo "$progname:624: checking for ld used by GCC" >&5
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+ /* | [A-Za-z]:\\*)
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we are not using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+ elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld... $ac_c" 1>&6
+ echo "$progname:642: checking for GNU ld" >&5
+ else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+ echo "$progname:645: checking for non-GNU ld" >&5
+ fi
+
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ fi
+
+ if test -n "$LD"; then
+ echo "$ac_t$LD" 1>&6
+ else
+ echo "$ac_t"no 1>&6
+ fi
+
+ if test -z "$LD"; then
+ echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
+ exit 1
+ fi
+fi
+
+# Check to see if it really is or is not GNU ld.
+echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
+# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+echo "$ac_t$with_gnu_ld" 1>&6
+
+# See if the linker supports building shared libraries.
+echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
+
+allow_undefined_flag=
+no_undefined_flag=
+archive_cmds=
+old_archive_from_new_cmds=
+export_dynamic_flag_spec=
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+hardcode_shlibpath_var=unsupported
+runpath_var=
+
+case "$host_os" in
+amigaos* | sunos4*)
+ # On these operating systems, we should treat GNU ld like the system ld.
+ gnu_ld_acts_native=yes
+ ;;
+*)
+ gnu_ld_acts_native=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
+
+ # See if GNU ld supports shared libraries.
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
+ runpath_var=LD_RUN_PATH
+ ld_shlibs=yes
+ else
+ ld_shlibs=no
+ fi
+
+ if test "$ld_shlibs" = yes; then
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ fi
+else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case "$host_os" in
+ aix3*)
+ allow_undefined_flag=unsupported
+ archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$with_gcc" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix4*)
+ allow_undefined_flag=unsupported
+ archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR cru $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib$libobjs'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
+ freebsd3*)
+ archive_cmds='$CC -shared -o $lib$libobjs'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ irix5* | irix6*)
+ archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ ;;
+
+ netbsd*)
+ # Tested with NetBSD 1.2 ld
+ archive_cmds='$LD -Bshareable -o $lib$libobjs'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ openbsd*)
+ archive_cmds='$LD -Bshareable -o $lib$libobjs'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def;$echo DATA >> $objdir/$libname.def;$echo " SINGLE NONSHARED" >> $objdir/$libname.def;$echo EXPORTS >> $objdir/$libname.def;emxexp$libobjs >> $objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib$libobjs $objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
+ ;;
+
+ osf3* | osf4*)
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds='$LD -G -o $lib$libobjs'
+ hardcode_direct=yes
+ ;;
+
+ solaris2*)
+ no_undefined_flag=' -z text'
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+
+ # Solaris 2 before 2.5 hardcodes -L paths.
+ case "$host_os" in
+ solaris2.[0-4]*)
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ if test "$with_gcc" = yes; then
+ archive_cmds='$CC -shared -o $lib$libobjs'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
+ fi
+
+ if test "$with_gnu_ld" = yes; then
+ export_dynamic_flag_spec='${wl}-export-dynamic'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib$libobjs'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=no
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ can_build_shared=no
+ ;;
+ esac
+fi
+echo "$ac_t$ld_shlibs" 1>&6
+
+if test -z "$NM"; then
+ echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
+ case "$NM" in
+ /* | [A-Za-z]:\\*) ;; # Let the user override the test with a path.
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ NM="$ac_dir/nm -p"
+ else
+ NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$NM" && NM=nm
+ ;;
+ esac
+ echo "$ac_t$NM" 1>&6
+fi
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRSTU]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \1'
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+ symcode='[BCDTU]'
+ ;;
+irix*)
+ # Cannot use undefined symbols on IRIX because inlined functions mess us up.
+ symcode='[BCDEGRST]'
+ ;;
+solaris2*)
+ symcode='[BDTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ symcode='[ABCDGISTUW]'
+fi
+
+# Write the raw and C identifiers.
+global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
+
+# Check to see that the pipe works correctly.
+pipe_works=no
+$rm conftest*
+cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+echo "$progname:971: checking if global_symbol_pipe works" >&5
+if { (eval echo $progname:972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { echo "$progname:975: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
+
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ wcout=`wc "$nlist" 2>/dev/null`
+ count=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
+ (test "$count" -ge 0) 2>/dev/null || count=-1
+ else
+ rm -f "$nlist"T
+ count=-1
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
+
+ cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define __ptr_t void *
+#else
+# define __ptr_t char *
+#endif
+
+/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
+int dld_preloaded_symbol_count = $count;
+
+/* The mapping between symbol names and symbols. */
+struct {
+ char *name;
+ __ptr_t address;
+}
+dld_preloaded_symbols[] =
+{
+EOF
+ sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
+ cat <<\EOF >> conftest.c
+ {0, (__ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.o conftestm.o
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS='conftestm.o'
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if { (eval echo $progname:1033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ pipe_works=yes
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ LIBS="$save_LIBS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $global_symbol_pipe" >&5
+ fi
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+fi
+$rm conftest*
+
+# Do not use the global_symbol_pipe unless it works.
+echo "$ac_t$pipe_works" 1>&6
+test "$pipe_works" = yes || global_symbol_pipe=
+
+# Check hardcoding attributes.
+echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var"; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct" != no && \
+ test "$hardcode_minus_L" != no && \
+ test "$hardcode_shlibpath_var" != no; then
+
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+elif test "$hardcode_direct" != yes && \
+ test "$hardcode_minus_L" != yes && \
+ test "$hardcode_shlibpath_var" != yes; then
+ # We cannot hardcode anything.
+ hardcode_action=unsupported
+else
+ # We can only hardcode existing directories.
+ hardcode_action=relink
+fi
+echo "$ac_t$hardcode_action" 1>&6
+test "$hardcode_action" = unsupported && can_build_shared=no
+
+
+reload_flag=
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
+# PORTME Some linker may need a different reload flag.
+reload_flag='-r'
+echo "$ac_t$reload_flag"
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+# PORTME Fill in your ld.so characteristics
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+version_type=none
+dynamic_linker="$host_os ld.so"
+
+echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
+case "$host_os" in
+aix3* | aix4*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so.$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}.so.$major'
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
+
+freebsd2* | freebsd3*)
+ version_type=sunos
+ library_names_spec='${libname}${release}.so.$versuffix $libname.so'
+ finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+gnu*)
+ version_type=sunos
+ library_names_spec='${libname}${release}.so.$versuffix'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ dynamic_linker="$host_os dld.sl"
+ version_type=sunos
+ shlibpath_var=SHLIB_PATH
+ library_names_spec='${libname}${release}.sl.$versuffix ${libname}${release}.sl.$major $libname.sl'
+ soname_spec='${libname}${release}.sl.$major'
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6*)
+ version_type=osf
+ soname_spec='${libname}${release}.so'
+ library_names_spec='${libname}${release}.so.$versuffix $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
+ soname_spec='${libname}${release}.so.$major'
+ finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+
+ if test -f /lib/ld.so.1; then
+ dynamic_linker='GNU ld.so'
+ else
+ # Only the GNU ld.so supports shared libraries on MkLinux.
+ case "$host_cpu" in
+ powerpc*) dynamic_linker=no ;;
+ *) dynamic_linker='Linux ld.so' ;;
+ esac
+ fi
+ ;;
+
+netbsd* | openbsd*)
+ version_type=sunos
+ library_names_spec='${libname}${release}.so.$versuffix'
+ finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+os2*)
+ libname_spec='$name'
+ library_names_spec='$libname.dll $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4*)
+ version_type=osf
+ soname_spec='${libname}${release}.so'
+ library_names_spec='${libname}${release}.so.$versuffix $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}.so.$major'
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris2*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
+ soname_spec='${libname}${release}.so.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}.so.$versuffix'
+ finish_cmds='PATH="$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+sysv4.2uw2*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
+ soname_spec='${libname}${release}.so.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
+ soname_spec='${libname}${release}.so.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$ac_t$dynamic_linker"
+test "$dynamic_linker" = no && can_build_shared=no
+
+# Report the final consequences.
+echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
+
+echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds;\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+esac
+
+echo "$ac_t$enable_shared" 1>&6
+
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+
+echo "checking whether to build static libraries... $enable_static" 1>&6
+
+echo $ac_n "checking for objdir... $ac_c" 1>&6
+rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+echo "$ac_t$objdir" 1>&6
+
+# Copy echo and quote the copy, instead of the original, because it is
+# used later.
+ltecho="$echo"
+
+# Now quote all the things that may contain metacharacters.
+for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
+ old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
+ link_static_flag no_builtin_flag export_dynamic_flag_spec \
+ libname_spec library_names_spec soname_spec RANLIB \
+ old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
+ old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \
+ allow_undefined_flag no_undefined_flag \
+ finish_cmds finish_eval global_symbol_pipe \
+ hardcode_libdir_flag_spec hardcode_libdir_separator; do
+
+ case "$var" in
+ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
+ postinstall_cmds | postuninstall_cmds | finish_cmds)
+ # Double-quote double-evaled strings.
+ eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
+ ;;
+ *)
+ eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
+ ;;
+ esac
+done
+
+ofile=libtool
+trap "$rm $ofile; exit 1" 1 2 15
+echo creating $ofile
+$rm $ofile
+cat <<EOF > $ofile
+#! /bin/sh
+
+# libtool - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
+# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
+#
+# Copyright (C) 1996-1998 Free Software Foundation, Inc.
+# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This program was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
+# LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
+# $0$ltconfig_args
+#
+# Compiler and other test output produced by $progname, useful for
+# debugging $progname, is in ./config.log if it exists.
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="sed -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
+
+# An echo program that does not interpret backslashes.
+echo="$ltecho"
+
+# The version of $progname that generated this script.
+LTCONFIG_VERSION="$VERSION"
+
+# Shell to use when invoking shell scripts.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Whether or not to build libtool libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build old-style libraries.
+build_old_libs=$enable_static
+
+# The host system.
+host_alias="$host_alias"
+host="$host"
+
+# The archiver.
+AR="$AR"
+
+# The default C compiler.
+CC="$CC"
+
+# The linker used to build libraries.
+LD="$LD"
+
+# Whether we need hard or soft links.
+LN_S="$LN_S"
+
+# A BSD-compatible nm program.
+NM="$NM"
+
+# The name of the directory that contains temporary libtool files.
+objdir="$objdir"
+
+# How to create reloadable object files.
+reload_flag="$reload_flag"
+reload_cmds="$reload_cmds"
+
+# How to pass a linker flag through the compiler.
+wl="$wl"
+
+# Additional compiler flags for building library objects.
+pic_flag="$pic_flag"
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="$link_static_flag"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag="$no_builtin_flag"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="$export_dynamic_flag_spec"
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec="$libname_spec"
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec="$library_names_spec"
+
+# The coded name of the library, if different from the real name.
+soname_spec="$soname_spec"
+
+# Commands used to build and install an old-style archive.
+RANLIB="$RANLIB"
+old_archive_cmds="$old_archive_cmds"
+old_postinstall_cmds="$old_postinstall_cmds"
+old_postuninstall_cmds="$old_postuninstall_cmds"
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds="$old_archive_from_new_cmds"
+
+# Commands used to build and install a shared archive.
+archive_cmds="$archive_cmds"
+postinstall_cmds="$postinstall_cmds"
+postuninstall_cmds="$postuninstall_cmds"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag="$allow_undefined_flag"
+
+# Flag that forces no undefined symbols.
+no_undefined_flag="$no_undefined_flag"
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="$finish_cmds"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval="$finish_eval"
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="$global_symbol_pipe"
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+EOF
+
+case "$host_os" in
+aix3*)
+ cat <<\EOF >> $ofile
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "${COLLECT_NAMES+set}" != set; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+
+EOF
+ ;;
+esac
+
+# Append the ltmain.sh script.
+cat "$ltmain" >> $ofile || (rm -f $ofile; exit 1)
+
+chmod +x $ofile
+exit 0
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/contrib/binutils/ltmain.sh b/contrib/binutils/ltmain.sh
new file mode 100644
index 0000000..e9350b3
--- /dev/null
+++ b/contrib/binutils/ltmain.sh
@@ -0,0 +1,2453 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun ltconfig.
+#
+# Copyright (C) 1996-1998 Free Software Foundation, Inc.
+# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# The name of this program.
+progname=`$echo "$0" | sed 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.2
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+
+if test "$LTCONFIG_VERSION" != "$VERSION"; then
+ echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+fi
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ echo "$modename: not configured to build any kind of library" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+
+# Parse our command line options once, thoroughly.
+while test $# -gt 0
+do
+ arg="$1"
+ shift
+
+ case "$arg" in
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case "$prev" in
+ execute_dlfiles)
+ eval "$prev=\"\$$prev \$arg\""
+ ;;
+ *)
+ eval "$prev=\$arg"
+ ;;
+ esac
+
+ prev=
+ prevopt=
+ continue
+ fi
+
+ # Have we seen a non-optional argument yet?
+ case "$arg" in
+ --help)
+ show_help=yes
+ ;;
+
+ --version)
+ echo "$PROGRAM (GNU $PACKAGE) $VERSION"
+ exit 0
+ ;;
+
+ --dry-run | -n)
+ run=:
+ ;;
+
+ --features)
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+ exit 0
+ ;;
+
+ --finish) mode="finish" ;;
+
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
+ --quiet | --silent)
+ show=:
+ ;;
+
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
+
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
+
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+fi
+
+if test -z "$show_help"; then
+
+ # Infer the operation mode.
+ if test -z "$mode"; then
+ case "$nonopt" in
+ *cc | *++ | gcc* | *-gcc*)
+ mode=link
+ for arg
+ do
+ case "$arg" in
+ -c)
+ mode=compile
+ break
+ ;;
+ esac
+ done
+ ;;
+ *db | *dbx)
+ mode=execute
+ ;;
+ *install*|cp|mv)
+ mode=install
+ ;;
+ *rm)
+ mode=uninstall
+ ;;
+ *)
+ # If we have no mode, but dlfiles were specified, then do execute mode.
+ test -n "$execute_dlfiles" && mode=execute
+
+ # Just use the default operation mode.
+ if test -z "$mode"; then
+ if test -n "$nonopt"; then
+ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+ else
+ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+ fi
+ fi
+ ;;
+ esac
+ fi
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$modename --help --mode=$mode' for more information."
+
+ # These modes are in order of execution frequency so that they run quickly.
+ case "$mode" in
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+ lastarg=
+ srcfile="$nonopt"
+ suppress_output=
+
+ for arg
+ do
+ # Accept any command-line options.
+ case "$arg" in
+ -o)
+ $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+ esac
+
+ # Accept the current argument as the source file.
+ lastarg="$srcfile"
+ srcfile="$arg"
+
+ # Aesthetically quote the previous argument.
+
+ # Backslashify any backslashes, double quotes, and dollar signs.
+ # These are the only characters that are still specially
+ # interpreted inside of double-quoted scrings.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly in scan
+ # sets, so we specify it separately.
+ case "$lastarg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ # Add the previous argument to base_compile.
+ if test -z "$base_compile"; then
+ base_compile="$lastarg"
+ else
+ base_compile="$base_compile $lastarg"
+ fi
+ done
+
+ # Get the name of the library object.
+ libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+
+ # Recognize several different file suffixes.
+ xform='[cCFSfms]'
+ case "$libobj" in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform=for ;;
+ esac
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+ case "$libobj" in
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
+ *)
+ $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ $run $rm $obj $libobj
+ trap "$run $rm $obj $libobj; exit 1" 1 2 15
+ else
+ $run $rm $libobj
+ trap "$run $rm $libobj; exit 1" 1 2 15
+ fi
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ # All platforms use -DPIC, to notify preprocessed assembler code.
+ $show "$base_compile$pic_flag -DPIC $srcfile"
+ if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
+ else
+ test -n "$obj" && $run $rm $obj
+ exit 1
+ fi
+
+ # If we have no pic_flag, then copy the object into place and finish.
+ if test -z "$pic_flag"; then
+ $show "$LN_S $obj $libobj"
+ $run $LN_S $obj $libobj
+ exit $?
+ fi
+
+ # Just move the object, then go on to compile the next one
+ $show "$mv $obj $libobj"
+ $run $mv $obj $libobj || exit 1
+
+ # Allow error messages only from the first compilation.
+ suppress_output=' >/dev/null 2>&1'
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ # Suppress compiler output if we already did a PIC compilation.
+ $show "$base_compile $srcfile$suppress_output"
+ if $run eval "$base_compile \$srcfile$suppress_output"; then :
+ else
+ $run $rm $obj $libobj
+ exit 1
+ fi
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we do not
+ # accidentally link it into a program.
+ if test "$build_libtool_libs" != yes; then
+ $show "echo timestamp > $libobj"
+ $run eval "echo timestamp > \$libobj" || exit $?
+ fi
+
+ exit 0
+ ;;
+
+ # libtool link mode
+ link)
+ modename="$modename: link"
+ CC="$nonopt"
+ allow_undefined=yes
+ compile_command="$CC"
+ finalize_command="$CC"
+
+ compile_shlibpath=
+ finalize_shlibpath=
+ deplibs=
+ dlfiles=
+ dlprefiles=
+ export_dynamic=no
+ hardcode_libdirs=
+ libobjs=
+ link_against_libtool_libs=
+ ltlibs=
+ objs=
+ prev=
+ prevarg=
+ release=
+ rpath=
+ perm_rpath=
+ temp_rpath=
+ vinfo=
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case "$arg" in
+ -all-static | -static)
+ if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ for arg
+ do
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case "$prev" in
+ output)
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
+ ;;
+ esac
+
+ case "$prev" in
+ dlfiles|dlprefiles)
+ case "$arg" in
+ *.la | *.lo) ;; # We handle these cases below.
+ *)
+ dlprefiles="$dlprefiles $arg"
+ test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
+ prev=
+ ;;
+ esac
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath)
+ rpath="$rpath $arg"
+ prev=
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi
+
+ prevarg="$arg"
+
+ case "$arg" in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ if test "$export_dynamic" != yes; then
+ export_dynamic=yes
+ if test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ else
+ arg=
+ fi
+
+ # Add the symbol object into the linking commands.
+ compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
+ fi
+ ;;
+
+ -L*)
+ dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
+ case "$dir" in
+ /* | [A-Za-z]:\\*)
+ # Add the corresponding hardcode_libdir_flag, if it is not identical.
+ ;;
+ *)
+ $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
+ exit 1
+ ;;
+ esac
+ deplibs="$deplibs $arg"
+ ;;
+
+ -l*) deplibs="$deplibs $arg" ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -static)
+ # If we have no pic_flag, then this is the same as -all-static.
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+
+ *.o | *.a)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A library object.
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ if test "$build_libtool_libs" = yes; then
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/\.o/'`
+ prev=
+ fi
+ libobjs="$libobjs $arg"
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ dlname=
+ libdir=
+ library_names=
+ old_library=
+
+ # Check to see that this really is a libtool archive.
+ if (sed -e '2q' $arg | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+
+ # If there is no directory component, then add one.
+ case "$arg" in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$libdir"; then
+ $echo "$modename: \`$arg' contains no -rpath information" 1>&2
+ exit 1
+ fi
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+
+ if test -z "$linklib"; then
+ $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Find the relevant object directory and library name.
+ name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
+ dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$arg"; then
+ dir="$objdir"
+ else
+ dir="$dir/$objdir"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ if test -z "$dlname"; then
+ # If there is no dlname, we need to preload.
+ prev=dlprefiles
+ else
+ # We should not create a dependency on this library, but we
+ # may need any libraries it requires.
+ compile_command="$compile_command$dependency_libs"
+ finalize_command="$finalize_command$dependency_libs"
+ prev=
+ continue
+ fi
+ fi
+
+ # The library was specified with -dlpreopen.
+ if test "$prev" = dlprefiles; then
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ dlprefiles="$dlprefiles $dir/$old_library"
+ else
+ dlprefiles="$dlprefiles $dir/$linklib"
+ fi
+ prev=
+ fi
+
+ if test "$build_libtool_libs" = yes && test -n "$library_names"; then
+ link_against_libtool_libs="$link_against_libtool_libs $arg"
+ if test -n "$shlibpath_var"; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *) temp_rpath="$temp_rpath $dir" ;;
+ esac
+ fi
+
+ # This is the magic to use -rpath.
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ # Put the magic libdir with the hardcode flag.
+ hardcode_libdirs="$libdir"
+ libdir="@HARDCODE_LIBDIRS@"
+ else
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ libdir=
+ fi
+ fi
+
+ if test -n "$libdir"; then
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ compile_command="$compile_command $flag"
+ finalize_command="$finalize_command $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ # Do the same for the permanent run path.
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+
+
+ case "$hardcode_action" in
+ immediate)
+ if test "$hardcode_direct" = no; then
+ compile_command="$compile_command $dir/$linklib"
+ elif test "$hardcode_minus_L" = no; then
+ compile_command="$compile_command -L$dir -l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ compile_shlibpath="$compile_shlibpath$dir:"
+ compile_command="$compile_command -l$name"
+ fi
+ ;;
+
+ relink)
+ # We need an absolute path.
+ case "$dir" in
+ /* | [A-Za-z]:\\*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ exit 1
+ fi
+ dir="$absdir"
+ ;;
+ esac
+
+ if test "$hardcode_direct" = yes; then
+ compile_command="$compile_command $dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ compile_command="$compile_command -L$dir -l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ compile_shlibpath="$compile_shlibpath$dir:"
+ compile_command="$compile_command -l$name"
+ fi
+ ;;
+
+ *)
+ $echo "$modename: \`$hardcode_action' is an unknown hardcode action" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes; then
+ finalize_command="$finalize_command $libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ finalize_command="$finalize_command -L$libdir -l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ finalize_shlibpath="$finalize_shlibpath$libdir:"
+ finalize_command="$finalize_command -l$name"
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ finalize_command="$finalize_command -L$libdir -l$name"
+ fi
+ else
+ # Transform directly to old archives if we don't build new libraries.
+ if test -n "$pic_flag" && test -z "$old_library"; then
+ $echo "$modename: cannot find static library for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_command="$compile_command $dir/$linklib"
+ finalize_command="$finalize_command $dir/$linklib"
+ else
+ compile_command="$compile_command -L$dir -l$name"
+ finalize_command="$finalize_command -L$dir -l$name"
+ fi
+ fi
+
+ # Add in any libraries that this one depends upon.
+ compile_command="$compile_command$dependency_libs"
+ finalize_command="$finalize_command$dependency_libs"
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+ esac
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+ done
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -n "$vinfo" && test -n "$release"; then
+ $echo "$modename: you cannot specify both \`-version-info' and \`-release'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ oldlib=
+ oldobjs=
+ case "$output" in
+ "")
+ $echo "$modename: you must specify an output file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ */* | *\\*)
+ $echo "$modename: output file \`$output' must have no directory components" 1>&2
+ exit 1
+ ;;
+
+ *.a)
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ build_old_libs=yes
+ oldlib="$output"
+ $show "$rm $oldlib"
+ $run $rm $oldlib
+ ;;
+
+ *.la)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case "$output" in
+ lib*) ;;
+ *)
+ $echo "$modename: libtool library \`$arg' must begin with \`lib'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval libname=\"$libname_spec\"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+ current=0
+ revision=0
+ age=0
+
+ if test -n "$objs"; then
+ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
+ exit 1
+ fi
+
+ # How the heck are we supposed to write a wrapper for a shared library?
+ if test -n "$link_against_libtool_libs"; then
+ $echo "$modename: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
+ exit 1
+ fi
+
+ if test -n "$dlfiles$dlprefiles"; then
+ $echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+ if test -z "$rpath"; then
+ $echo "$modename: you must specify an installation directory with \`-rpath'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ set dummy $rpath
+ if test $# -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+
+ # Parse the version information argument.
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo
+ IFS="$save_ifs"
+
+ if test -n "$5"; then
+ $echo "$modename: too many parameters to \`-version-info'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ test -n "$2" && current="$2"
+ test -n "$3" && revision="$3"
+ test -n "$4" && age="$4"
+
+ # Check that each of the things are valid numbers.
+ case "$current" in
+ 0 | [1-9] | [1-9][0-9]*) ;;
+ *)
+ $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case "$revision" in
+ 0 | [1-9] | [1-9][0-9]*) ;;
+ *)
+ $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case "$age" in
+ 0 | [1-9] | [1-9][0-9]*) ;;
+ *)
+ $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test $age -gt $current; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ fi
+
+ # Calculate the version variables.
+ version_vars="version_type current age revision"
+ case "$version_type" in
+ none) ;;
+
+ linux)
+ version_vars="$version_vars major versuffix"
+ major=`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ version_vars="$version_vars versuffix verstring"
+ major=`expr $current - $age`
+ versuffix="$current.$age.$revision"
+ verstring="$versuffix"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test $loop != 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ sunos)
+ version_vars="$version_vars major versuffix"
+ major="$current"
+ versuffix="$current.$revision"
+ ;;
+
+ *)
+ $echo "$modename: unknown library version type \`$version_type'" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Create the output directory, or remove our outputs if we need to.
+ if test -d $objdir; then
+ $show "$rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
+ $run $rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
+ else
+ $show "$mkdir $objdir"
+ $run $mkdir $objdir
+ status=$?
+ if test $status -eq 0 || test -d $objdir; then :
+ else
+ exit $status
+ fi
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ # Add libc to deplibs on all systems.
+ dependency_libs="$deplibs"
+ deplibs="$deplibs -lc"
+
+ if test "$build_libtool_libs" = yes; then
+ # Get the real and link names of the library.
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ lib="$objdir/$realname"
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are PIC.
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
+
+ # Do each of the archive commands.
+ eval cmds=\"$archive_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ $show "(cd $objdir && $LN_S $realname $linkname)"
+ $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
+ done
+
+ # If -export-dynamic was specified, set the dlname.
+ if test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+
+ # Now set the variables for building old libraries.
+ oldlib="$objdir/$libname.a"
+ ;;
+
+ *.lo | *.o)
+ if test -n "$link_against_libtool_libs"; then
+ $echo "$modename: error: cannot link libtool libraries into reloadable objects" 1>&2
+ exit 1
+ fi
+
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles"; then
+ $echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored while creating objects" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
+ fi
+
+ case "$output" in
+ *.lo)
+ if test -n "$objs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit 1
+ fi
+ libobj="$output"
+ obj=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $run $rm $obj $libobj
+
+ # Create the old-style object.
+ reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
+
+ output="$obj"
+ eval cmds=\"$reload_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Exit if we aren't doing a library object file.
+ test -z "$libobj" && exit 0
+
+ if test "$build_libtool_libs" != yes; then
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ $show "echo timestamp > $libobj"
+ $run eval "echo timestamp > $libobj" || exit $?
+ exit 0
+ fi
+
+ if test -n "$pic_flag"; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs"
+ output="$libobj"
+ eval cmds=\"$reload_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ else
+ # Just create a symlink.
+ $show "$LN_S $obj $libobj"
+ $run $LN_S $obj $libobj || exit 1
+ fi
+
+ exit 0
+ ;;
+
+ *)
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ # Put the magic libdir with the hardcode flag.
+ hardcode_libdirs="$libdir"
+ libdir="@HARDCODE_LIBDIRS@"
+ else
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ libdir=
+ fi
+ fi
+
+ if test -n "$libdir"; then
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ compile_command="$compile_command $flag"
+ finalize_command="$finalize_command $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ fi
+
+ # Substitute the hardcoded libdirs into the compile commands.
+ if test -n "$hardcode_libdir_separator"; then
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
+ fi
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
+ finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
+ fi
+
+ if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
+ dlsyms="${output}S.c"
+ else
+ dlsyms=
+ fi
+
+ if test -n "$dlsyms"; then
+ # Add our own program objects to the preloaded list.
+ dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
+
+ # Discover the nlist of each of the dlfiles.
+ nlist="$objdir/${output}.nm"
+
+ if test -d $objdir; then
+ $show "$rm $nlist ${nlist}T"
+ $run $rm "$nlist" "${nlist}T"
+ else
+ $show "$mkdir $objdir"
+ $run $mkdir $objdir
+ status=$?
+ if test $status -eq 0 || test -d $objdir; then :
+ else
+ exit $status
+ fi
+ fi
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ # Parse the name list into a source file.
+ $show "creating $objdir/$dlsyms"
+ if test -z "$run"; then
+ # Make sure we at least have an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ wcout=`wc "$nlist" 2>/dev/null`
+ count=`echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
+ (test "$count" -ge 0) 2>/dev/null || count=-1
+ else
+ $rm "$nlist"T
+ count=-1
+ fi
+
+ case "$dlsyms" in
+ "") ;;
+ *.c)
+ $echo > "$objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define dld_preloaded_symbol_count some_other_symbol
+#define dld_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test -f "$nlist"; then
+ sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
+ else
+ echo '/* NONE */' >> "$objdir/$dlsyms"
+ fi
+
+ $echo >> "$objdir/$dlsyms" "\
+
+#undef dld_preloaded_symbol_count
+#undef dld_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define __ptr_t void *
+#else
+# define __ptr_t char *
+#endif
+
+/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
+int dld_preloaded_symbol_count = $count;
+
+/* The mapping between symbol names and symbols. */
+struct {
+ char *name;
+ __ptr_t address;
+}
+dld_preloaded_symbols[] =
+{\
+"
+
+ if test -f "$nlist"; then
+ sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
+ fi
+
+ $echo >> "$objdir/$dlsyms" "\
+ {0, (__ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ ;;
+
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit 1
+ ;;
+ esac
+ fi
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
+ $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
+
+ # Transform the symbol file into the correct name.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
+ elif test "$export_dynamic" != yes; then
+ test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
+ else
+ # We keep going just in case the user didn't refer to
+ # dld_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+ if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ $show "$compile_command"
+ $run eval "$compile_command"
+ exit $?
+ fi
+
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
+
+ # Create the binary in the object directory, then wrap it.
+ if test -d $objdir; then :
+ else
+ $show "$mkdir $objdir"
+ $run $mkdir $objdir
+ status=$?
+ if test $status -eq 0 || test -d $objdir; then :
+ else
+ exit $status
+ fi
+ fi
+
+ if test -n "$shlibpath_var"; then
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+ case "$dir" in
+ /* | [A-Za-z]:\\*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+ ;;
+ *)
+ # Relative path: add a thisdir entry.
+ rpath="$rpath\$thisdir/$dir:"
+ ;;
+ esac
+ done
+ temp_rpath="$rpath"
+ fi
+
+ # Delete the old output file.
+ $run $rm $output
+
+ if test -n "$compile_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
+ finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
+ fi
+
+ case "$hardcode_action" in
+ relink)
+ # AGH! Flame the AIX and HP-UX people for me, will ya?
+ $echo "$modename: warning: using a buggy system linker" 1>&2
+ $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
+ ;;
+ esac
+
+ $show "$compile_command"
+ $run eval "$compile_command" || exit $?
+
+ # Now create the wrapper script.
+ $show "creating $output"
+
+ # Quote the finalize command for shipping.
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
+
+ # Quote $echo for shipping.
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+
+ # Only actually do things if our run command is non-null.
+ if test -z "$run"; then
+ $rm $output
+ trap "$rm $output; exit 1" 1 2 15
+
+ $echo > $output "\
+#! /bin/sh
+
+# $output - temporary wrapper script for $objdir/$output
+# Generated by ltmain.sh - GNU $PACKAGE $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of \``pwd`'.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ link_against_libtool_libs='$link_against_libtool_libs'
+ finalize_command=\"$finalize_command\"
+else
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test \"\$libtool_execute_magic\" = \"$magic\"; then :
+ else
+ echo=\"$qecho\"
+ file=\"\$0\"
+ fi\
+"
+ $echo >> $output "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ /* | [A-Za-z]:\\*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+
+ progdir=\"\$thisdir/$objdir\"
+ program='$output'
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+
+ # Export the path to the program.
+ PATH=\"\$progdir:\$PATH\"
+ export PATH
+
+ exec \$program \${1+\"\$@\"}
+
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+ \$echo \"This script is just a wrapper for \$program.\" 1>&2
+ echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+ chmod +x $output
+ fi
+ exit 0
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ if test "$build_old_libs" = "yes"; then
+ # Transform .lo files to .o files.
+ oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ eval cmds=\"$old_archive_from_new_cmds\"
+ else
+ eval cmds=\"$old_archive_cmds\"
+ fi
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Now create the libtool archive.
+ case "$output" in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.a"
+
+ $show "creating $output"
+
+ # Only create the output if not a dry run.
+ if test -z "$run"; then
+ $echo > $output "\
+# $output - a libtool library file
+# Generated by ltmain.sh - GNU $PACKAGE $VERSION
+
+# The name that we can dlopen(3).
+dlname='$dlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'\
+"
+ fi
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $objdir && $LN_S ../$output $output)"
+ $run eval "(cd $objdir && $LN_S ../$output $output)" || exit 1
+ ;;
+ esac
+ exit 0
+ ;;
+
+ # libtool install mode
+ install)
+ modename="$modename: install"
+
+ # There may be an optional /bin/sh argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL"; then
+ # Aesthetically quote it.
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$arg "
+ arg="$1"
+ shift
+ else
+ install_prog=
+ arg="$nonopt"
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog$arg"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest="$arg"
+ continue
+ fi
+
+ case "$arg" in
+ -d) isdir=yes ;;
+ -f) prev="-f" ;;
+ -g) prev="-g" ;;
+ -m) prev="-m" ;;
+ -o) prev="-o" ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*) ;;
+
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest="$arg"
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog $arg"
+ done
+
+ if test -z "$install_prog"; then
+ $echo "$modename: you must specify an install program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ $echo "$modename: no file or destination specified" 1>&2
+ else
+ $echo "$modename: you must specify a destination" 1>&2
+ fi
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Strip any trailing slash from the destination.
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test -n "$isdir"; then
+ destdir="$dest"
+ destname=
+ else
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$destdir" = "X$dest" && destdir=.
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+ if test $# -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ fi
+ case "$destdir" in
+ /* | [A-Za-z]:\\*) ;;
+ *)
+ for file in $files; do
+ case "$file" in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case "$file" in
+ *.a)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ library_names=
+ old_library=
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+ realname="$2"
+ shift
+ shift
+
+ # Install the shared library and build the symlinks.
+ $show "$install_prog $dir/$realname $destdir/$realname"
+ $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
+ test "X$dlname" = "X$realname" && dlname=
+
+ if test $# -gt 0; then
+ # Delete the old symlinks.
+ rmcmd="$rm"
+ for linkname
+ do
+ rmcmd="$rmcmd $destdir/$linkname"
+ done
+ $show "$rmcmd"
+ $run $rmcmd
+
+ # ... and create new ones.
+ for linkname
+ do
+ test "X$dlname" = "X$linkname" && dlname=
+ $show "(cd $destdir && $LN_S $realname $linkname)"
+ $run eval "(cd $destdir && $LN_S $realname $linkname)"
+ done
+ fi
+
+ if test -n "$dlname"; then
+ # Install the dynamically-loadable library.
+ $show "$install_prog $dir/$dlname $destdir/$dlname"
+ $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ eval cmds=\"$postinstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Install the pseudo-library for information purposes.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ $show "$install_prog $file $destdir/$name"
+ $run eval "$install_prog $file $destdir/$name" || exit $?
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case "$destfile" in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e 's/\.lo$/\.o/'`
+ ;;
+ *.o)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ if test -n "$destfile"; then
+ $show "$install_prog $file $destfile"
+ $run eval "$install_prog $file $destfile" || exit $?
+ fi
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ staticobj=`$echo "X$file" | $Xsed -e 's/\.lo$/\.o/'`
+
+ $show "$install_prog $staticobj $staticdest"
+ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ fi
+ exit 0
+ ;;
+
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
+ link_against_libtool_libs=
+ finalize_command=
+
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
+ $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
+ exit 1
+ fi
+
+ finalize=yes
+ for lib in $link_against_libtool_libs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ # If there is no directory component, then add one.
+ case "$lib" in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+ libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
+ if test -z "$libdir"; then
+ $echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
+ elif test -f "$libfile"; then :
+ else
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
+ if test "$hardcode_action" = relink; then
+ if test "$finalize" = yes; then
+ $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
+ $show "$finalize_command"
+ if $run eval "$finalize_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ continue
+ fi
+ file="$objdir/$file"T
+ else
+ $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
+ fi
+ else
+ # Install the binary that we compiled earlier.
+ file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ $show "$install_prog$stripme $file $dest"
+ $run eval "$install_prog\$stripme \$file \$dest" || exit $?
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
+ # Do each command in the postinstall commands.
+ eval cmds=\"$old_postinstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$future_libdirs"; then
+ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+ fi
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+ exec $SHELL $0 --finish$current_libdirs
+ exit 1
+ fi
+
+ exit 0
+ ;;
+
+ # libtool finish mode
+ finish)
+ modename="$modename: finish"
+ libdirs="$nonopt"
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ eval cmds=\"$finish_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ done
+ IFS="$save_ifs"
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $run eval "$cmds"
+ fi
+ done
+ fi
+
+ echo "------------------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ echo " $libdir"
+ done
+ echo
+ echo "To link against installed libraries in a given directory, LIBDIR,"
+ echo "you must use the \`-LLIBDIR' flag during linking."
+ echo
+ echo " You will also need to do one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ echo " - use the \`$flag' linker flag"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+ echo "See any operating system documentation about shared libraries for"
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ echo "------------------------------------------------------------------------------"
+ exit 0
+ ;;
+
+ # libtool execute mode
+ execute)
+ modename="$modename: execute"
+
+ # The first argument is the command name.
+ cmd="$nonopt"
+ if test -z "$cmd"; then
+ $echo "$modename: you must specify a COMMAND" 1>&2
+ $echo "$help"
+ exit 1
+ fi
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ if test -f "$file"; then :
+ else
+ $echo "$modename: \`$file' is not a file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ dir=
+ case "$file" in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit 1
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ ;;
+
+ *)
+ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case "$file" in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+ args="$args \"$file\""
+ done
+
+ if test -z "$run"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+
+ # Now actually exec the command.
+ eval "exec \$cmd$args"
+
+ $echo "$modename: cannot exec \$cmd$args"
+ exit 1
+ else
+ # Display what would be done.
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ $echo "$cmd$args"
+ exit 0
+ fi
+ ;;
+
+ # libtool uninstall mode
+ uninstall)
+ modename="$modename: uninstall"
+ rm="$nonopt"
+ files=
+
+ for arg
+ do
+ case "$arg" in
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ if test -z "$rm"; then
+ $echo "$modename: you must specify an RM program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ rmfiles="$file"
+
+ case "$name" in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $dir/$n"
+ test "X$n" = "X$dlname" && dlname=
+ done
+ test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
+ test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
+
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
+
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ eval cmds=\"$postuninstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ eval cmds=\"$old_postuninstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ done
+ IFS="$save_ifs"
+ fi
+
+ # FIXME: should reinstall the best remaining shared library.
+ fi
+ ;;
+
+ *.lo)
+ if test "$build_old_libs" = yes; then
+ oldobj=`$echo "X$name" | $Xsed -e 's/\.lo$/\.o/'`
+ rmfiles="$rmfiles $dir/$oldobj"
+ fi
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
+ ;;
+
+ *)
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
+ ;;
+ esac
+ done
+ exit 0
+ ;;
+
+ "")
+ $echo "$modename: you must specify a MODE" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+fi # test -z "$show_help"
+
+# We need to display help for each of the modes.
+case "$mode" in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+-n, --dry-run display commands without modifying any files
+ --features display configuration information and exit
+ --finish same as \`--mode=finish'
+ --help display this help message and exit
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
+ --version print version information
+
+MODE must be one of the following:
+
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE."
+ exit 0
+ ;;
+
+compile)
+ $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+execute)
+ $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+finish)
+ $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+install)
+ $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+link)
+ $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -static do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
+library objects (\`.lo' files) may be specified, and \`-rpath' is required.
+
+If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
+and \`ranlib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
+created, otherwise an executable program is created."
+ ;;
+
+uninstall)
+ $echo
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+*)
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+esac
+
+echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/contrib/binutils/missing b/contrib/binutils/missing
new file mode 100644
index 0000000..a6abd06
--- /dev/null
+++ b/contrib/binutils/missing
@@ -0,0 +1,134 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+case "$1" in
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison touch file \`y.tab.c'
+ makeinfo touch the output file
+ yacc touch file \`y.tab.c'"
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing - GNU libit 0.0"
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+ aclocal)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acinclude.m4' or \`configure.in'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`configure.in'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acconfig.h' or \`configure.in'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ touch config.h.in
+ ;;
+
+ automake)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print \
+ | sed 's/^\(.*\).am$/touch \1.in/' \
+ | sh
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ touch y.tab.c
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ fi
+ touch $file
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequirements for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/contrib/binutils/mkinstalldirs b/contrib/binutils/mkinstalldirs
new file mode 100755
index 0000000..cc8783e
--- /dev/null
+++ b/contrib/binutils/mkinstalldirs
@@ -0,0 +1,36 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Last modified: 1994-03-25
+# Public domain
+
+errstatus=0
+
+for file in ${1+"$@"} ; do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d in ${1+"$@"} ; do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp" 1>&2
+ mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+ fi
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/contrib/binutils/opcodes/ChangeLog b/contrib/binutils/opcodes/ChangeLog
index 73e6d14..2d528c6 100644
--- a/contrib/binutils/opcodes/ChangeLog
+++ b/contrib/binutils/opcodes/ChangeLog
@@ -1,3 +1,727 @@
+Fri Apr 24 16:07:57 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386-dis.c (OP_DSSI): Print segment override.
+
+Tue Apr 21 16:31:51 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * mips-dis.c (print_insn_arg): Restore accidentally lost code.
+
+Sun Apr 5 16:04:39 1998 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am (stamp-lib): Check that .libs/libopcodes.a exists
+ before trying to copy it.
+ * Makefile.in: Rebuild.
+
+Tue Mar 31 11:09:08 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Rebuild dependencies.
+ * Makefile.in: Rebuild.
+
+ From H.J. Lu <hjl@gnu.org>:
+ * i386-dis.c (dis386): Change 0x8c and 0x8e to movS, and change Ew
+ to Ev for both.
+
+Fri Mar 27 18:08:13 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Fix some gcc -Wall warnings:
+ * arc-dis.c (print_insn): Add casts to avoid warnings.
+ * cgen-opc.c (cgen_keyword_lookup_name): Likewise.
+ * d10v-dis.c (dis_long, dis_2_short): Likewise.
+ * m10200-dis.c (disassemble): Likewise.
+ * m10300-dis.c (disassemble): Likewise.
+ * ns32k-dis.c (print_insn_ns32k): Likewise.
+ * ppc-opc.c (insert_ral, insert_ram): Likewise.
+ * cgen-dis.c (build_dis_hash_table): Remove used local variables.
+ * cgen-opc.c (cgen_keyword_search_next): Likewise.
+ * d10v-dis.c (dis_long, dis_2_short): Likewise.
+ * ns32k-dis.c (bit_extract, print_insn_ns32k): Likewise.
+ * w65-dis.c (print_operand): Likewise.
+ * z8k-dis.c (fetch_data): Likewise.
+ * a29k-dis.c: Add return type for find_byte_func_type.
+ * arc-opc.c: Include <stdio.h>. Remove declarations of
+ insert_multshift and extract_multshift.
+ * h8500-dis.c (print_insn_h8500): Initialize local variables.
+ * h8500-opc.h (h8500_table): Fully bracket initializer.
+ * w65-opc.h (optable): Likewise.
+ * i386-dis.c (print_insn_x86): Declare aflag and flag parameters.
+ * i386-dis.c (OP_E): Initialize local variables.
+ * m10200-dis.c (print_insn_mn10200): Likewise.
+ * mips-dis.c (print_insn_mips16): Likewise.
+ * sh-dis.c (print_insn_shx): Likewise.
+ * v850-dis.c (print_insn_v850): Likewise.
+ * ns32k-dis.c (print_insn_arg): Declare.
+ (get_displacement, invalid_float): Declare.
+ (list_search, sign_extend, flip_bytes): Declare return type.
+ (get_displacement): Likewise.
+ (print_insn_arg): Likewise. Make d int. Fix sprintf format
+ string.
+ (print_insn_ns32k): Make i unsigned.
+ (invalid_float): Make static. Declare type of val.
+ * tic30-dis.c (print_par_insn): Make i size_t. Don't check strlen
+ on each for iteration.
+ * tic30-dis.c (get_indirect_operand): Likewise.
+ * z8k-dis.c (print_insn_z8001): Declare return type.
+ (print_insn_z8002): Likewise.
+ (unparse_instr): Fix sprintf format strings.
+
+Fri Mar 27 00:05:23 1998 Jeffrey A Law (law@cygnus.com)
+
+ * mips-opc.c: Add "sync.l" and "sync.p".
+
+Wed Mar 25 14:32:48 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * m68k-dis.c (print_insn_m68k): Use info->mach to select the
+ default m68k variant to recognize.
+
+ * i960-dis.c (pinsn): Change type of first argument to bfd_vma.
+ (ctrl, cobr, mem, ea): Likewise.
+ (print_addr): Likewise. Remove cast.
+ (ea): Cast argument of print_addr to bfd_vma.
+
+ * cgen-asm.c (cgen_parse_signed_integer): Fix type of local
+ variable value.
+ (cgen_parse_unsigned_integer): Likewise.
+ (cgen_parse_address): Likewise.
+
+Wed Mar 25 14:31:31 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * i960-dis.c (ctrl): Add full braces to structure initialization.
+ (cobr, mem, reg): Likewise.
+ (ea): Correct parenthesization in expression.
+
+ * cgen-asm.c: Include <ctype.h>.
+ (build_asm_hash_table): Remove unused local variable i.
+ (cgen_parse_keyword): Add casts to avoid warnings.
+
+ * arm-dis.c (print_insn_big_arm): Only call coffsymbol for a COFF
+ symbol. Fix indentation.
+ (print_insn_little_arm): Likewise.
+
+Fri Mar 20 18:55:18 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Use AM_DISABLE_SHARED.
+ * aclocal.m4, configure: Rebuild with libtool 1.2.
+
+Thu Mar 19 15:46:53 1998 Nick Clifton <nickc@cygnus.com>
+
+ These patches are courtesy of Jonathan Walton and Tony Thompson
+ (athompso@cambridge.arm.com).
+
+ * arm-dis.c (print_insn_thumb): Ignore bottom two bits of PC
+ relative addresses.
+
+ * arm-opc.h (thumb_opcodes): Annotate PC relative addresses with
+ both the offset and the label closest to the destination.
+
+Sat Mar 14 23:47:14 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * m32r-opc.h: Regenerate.
+
+Wed Mar 4 12:08:14 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * m32r-opc.h,m32r-opc.c,m32r-asm.c,m32r-dis.c: Regenerate.
+
+Tue Mar 3 18:51:22 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen-asm.in: Move insertion of generated routines to top of file.
+ (insert_normal): Add prototype. Delete `shift' arg.
+ * cgen-dis.in: Move insertion of generated routines to top of file.
+ (extract_normal): Add prototype. Delete `shift' arg.
+ (print_normal): Add prototype. Call CGEN_PRINT_NORMAL if defined.
+ (print_keyword): Add prototype. Fix type of `attrs' arg.
+
+Sat Feb 28 16:02:34 1998 Nick Clifton <nickc@cygnus.com>
+
+ * arm-dis.c (print_insn_big_arm, print_insn_little_arm): Do not
+ assume that info->symbols is non-empty.
+
+Sat Feb 28 12:19:05 1998 Richard Henderson <rth@cygnus.com>
+
+ * alpha-opc.c (cvtqs) There is no such thing.
+ (cvttq): Missing most of the /*d variants.
+
+Tue Feb 24 10:46:44 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * arm-dis.c (print_insn_{big,little}_arm): info->symbol changed
+ to *info->symbols.
+ * mips-dis.c (print_insn_{big,little}_mips): Likewise.
+ * tic30-dis.c (print_branch): Likewise.
+
+Tue Feb 24 11:06:18 1998 Nick Clifton <nickc@cygnus.com>
+
+ * arm-dis.c (print_insn_big_arm, print_insn_little_arm): Remove
+ saved_symbol code as it is no longer needed.
+
+Mon Feb 23 13:16:17 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen-asm.c: Include symcat.h.
+ * cgen-dis.c,cgen-opc.c,cgen-asm.in,cgen-dis.in: Ditto.
+
+ * m32r-asm.c,m32r-dis.c,m32r-opc.h,m32r-opc.c: Regenerate.
+
+Mon Feb 23 10:34:58 1998 Jeffrey A Law (law@cygnus.com)
+
+ * mips-dis.c (print_insn_arg): Do not prefix 'P' arguments with '$'.
+
+Thu Feb 19 16:51:13 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * m32r-opc.[ch]: Regenerate.
+
+Tue Feb 17 17:14:50 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * Makefile.am (CGENFILES): Update.
+ * Makefile.in: Regenerate.
+ * cgen-asm.in (insert_normal): Result is error message now.
+ Validate value to be inserted.
+ (insert_insn_normal): Result is error message now.
+ (@arch@_cgen_assemble_insn): Update.
+ * cgen-asm.c (cgen_parse_{signed,unsigned}_integer): Delete min,max
+ arguments. Don't perform validation here.
+ * m32r-asm.c,m32r-dis.c,m32r-opc.c: Regenerate.
+
+Fri Feb 13 14:26:06 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * cgen-opc.in (@arch@_cgen_get_insn_operands): Handle empty
+ operand instance list.
+ * m32r-opc.c: Regenerate.
+
+Fri Feb 13 14:53:02 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Define.
+ * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e.
+
+Fri Feb 13 10:21:09 1998 Mark Alexander <marka@cygnus.com>
+
+ * m10300-dis.c (print_insn_mn10300): Recognize break instruction.
+
+Fri Feb 13 13:12:14 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Get the version number from BFD.
+ * configure: Rebuild.
+
+ From H.J. Lu <hjl@gnu.org>:
+ * Makefile.am (libopcodes_la_LDFLAGS): Define.
+ * Makefile.in: Rebuild.
+
+Fri Feb 13 09:50:32 1998 Nick Clifton <nickc@cygnus.com>
+
+ * m32r-opc.c: Regenerate.
+ * m32r-opc.h: Regenerate.
+
+Thu Feb 12 11:01:40 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * cgen-opc.in (@arch@_cgen_lookup_insn): New argument alias_p.
+ Ignore ALIAS insns if asked to.
+ (@arch@_cgen_get_insn_operands): Pass 0 for alias_p, NULL for insn.
+ * m32r-opc.c: Regenerate.
+
+Thu Feb 12 03:41:00 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ Fix rac to accept only a0:
+ * d10v-opc.c (d10v_predefined_registers, d10v_operands, d10v_opcodes):
+ Split OPERAND_ACC into OPERAND_ACC0 and OPERAND_ACC1.
+ Introduce OPERAND_GPR.
+ * d10v-dis.c (print_operand): Likewise.
+
+Wed Feb 11 18:58:34 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen-opc.in: New file.
+ * cgen.sh: Translate @ARCH@. Cat cgen-opc.in into @arch@-opc.c.
+ * Makefile.am (CGENFILES): Add cgen-opc.in.
+ * Makefile.in: Regenerate.
+
+ * cgen-opc.c (cgen_set_cpu): Delete init of hw list `next' chain.
+ (cgen_hw_lookup): Make result const.
+
+ * cgen-dis.in (*): Use PTR instead of void *.
+ (print_insn): Delete unused vars `i', `syntax'.
+
+ * m32r-opc.h, m32r-opc.c, m32r-asm.c, m32r-dis.c: Regenerate.
+
+Sat Feb 7 15:30:27 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure, aclocal.m4: Rebuild with new libtool.
+
+Wed Feb 4 19:17:37 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set libtool_enable_shared rather than
+ libtool_shared. Remove diversion hack.
+ * configure, Makefile.in, aclocal.m4: Rebuild with new libtool.
+
+Tue Feb 3 17:19:40 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen-opc.c (cgen_set_cpu): Initialize hardware table.
+ * m32r-opc.h, m32r-opc.c, m32r-asm.c, m32r-dis.c: Regenerate.
+
+Mon Feb 2 19:22:15 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
+
+ * tic30-dis.c: New file.
+ * disassemble.c (disassembler): Add bfd_arch_tic30 case.
+ * configure.in: Handle bfd_tic30_arch.
+ * Makefile.am: Rebuild dependencies.
+ (CFILES): Add tic30-dis.c
+ (ALL_MACHINES): Add tic30-dis.lo.
+ * configure, Makefile.in: Rebuild.
+
+Thu Jan 29 13:02:56 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * m32r-opc.h (HAVE_CPU_M32R): Define.
+
+Wed Jan 28 09:55:03 1998 Nick Clifton <nickc@cygnus.com>
+
+ * v850-opc.c (insertion routines): If both alignment and size is
+ wrong then report this.
+
+Tue Jan 27 21:52:59 1998 Jeffrey A Law (law@cygnus.com)
+
+ * mips-dis.c (_print_insn_mips): Set target_processor as appropriate.
+ Only recognize instructions for the current target_processor.
+
+Thu Jan 22 16:20:17 1998 Fred Fish <fnf@cygnus.com>
+
+ * d10v-dis.c (PC_MASK): Correct value.
+ (print_operand): If there's a reloc, don't calculate the
+ address because they could be in different sections.
+
+Fri Jan 16 15:29:11 1998 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * mips-opc.c (mips_builtin_opcodes): Move 4010's "addciu"
+ instruction after the 4650's "mul" instruction; nobody's using the
+ 4010 these days. If object files someday indicate which processor
+ variant they're intended for, we can do a better job at this.
+
+Mon Jan 12 14:43:54 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * cgen-asm.c (build_asm_hash_table): Traverse compiled in table using
+ table provided entry size. Use CGEN_INSN_MNEMONIC.
+ (cgen_parse_keyword): Rewrite.
+ * cgen-dis.c (build_dis_hash_table): Traverse compiled in table using
+ table provided entry size. Use CGEN_INSN_MASK_BITSIZE.
+ * cgen-opc.c: Clean up pass over `struct foo' usage.
+ (cgen_keyword_lookup_value): Handle "" entry.
+ (cgen_keyword_add): Likewise.
+
+Mon Dec 22 12:37:06 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * mips-opc.c: Add FP_D to s.d instruction flags.
+
+Wed Dec 17 11:38:29 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * m68k-opc.c (halt, pulse): Enable them on the 68060.
+
+1997-12-15 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * configure: Only build libopcodes shared if --enable-shared's value
+ was `yes', or was set to `*opcodes*'.
+ * aclocal.m4: Likewise.
+ * NOTE: this really needs to be fixed in libtool/libtool.m4, the
+ original source of this bit of code. It's not clear what the best fix
+ would be, though.
+
+Fri Dec 12 01:32:30 1997 Richard Henderson <rth@cygnus.com>
+
+ * alpha-opc.c (cvttq/*u*): Remove, as that suffix is invalid.
+
+Wed Dec 10 17:42:35 1997 Nick Clifton <nickc@cygnus.com>
+
+ * arm-dis.c (print_insn_little_arm): Prevent examination of stored
+ symbol if none is present.
+ (print_insn_big_arm): Prevent examination of stored symbol if
+ none is present.
+
+Thu Oct 23 21:13:37 1997 Fred Fish <fnf@cygnus.com>
+
+ * d10v-opc.c (d10v_opcodes): Correct entry for RTE.
+
+Mon Dec 8 11:21:07 1997 Nick Clifton <nickc@cygnus.com>
+
+ * disassemble.c: Remove disasm_symaddr() function.
+
+ * arm-dis.c: Use info->symbol instead of info->flags to determine
+ if disassmbly should be in Thumb or Arm mode.
+
+Tue Dec 2 09:54:27 1997 Nick Clifton <nickc@cygnus.com>
+
+ * arm-dis.c: Add support for disassembling Thumb opcodes.
+ (print_insn_thumb): New function.
+
+ * disassemble.c (disasm_symaddr): New function.
+
+ * arm-opc.h: Display nop pseudo ops alongside equivalent disassembly.
+ (thumb_opcodes): Table of Thumb opcodes.
+
+Mon Dec 1 12:25:57 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * m68k-opc.c (btst): Change Dd@s to Dd;b.
+
+ * m68k-dis.c (print_insn_arg): Recognize 'm', 'n', 'o', 'p', 'q',
+ and 'v' as operand types.
+
+Mon Dec 1 11:56:50 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * m68k-opc.c: Add argument for lpstop. From Olivier Carmona
+ <olivier.carmona@di.epfl.ch>.
+ * m68k-dis.c (print_insn_m68k): Handle special case of lpstop,
+ which has a two word opcode with a one word argument.
+
+Wed Nov 19 17:42:35 1997 Richard Henderson <rth@cygnus.com>
+
+ * sh-dis.c (print_insn_shx): Recognize all sh4 additions.
+ * sh-opc.h (fmov): Add @<REG_M>+,<DX_REG_N> variant for sh4.
+ (ftrv): Slay the cut-and-paste monster.
+
+Tue Nov 18 23:10:03 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * d10v-dis.c (print_operand):
+ Split OPERAND_FLAG into OPERAND_FFLAG and OPERAND_CFLAG.
+
+Tue Nov 18 18:45:14 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * d10v-opc.c (OPERAND_FLAG): Split into:
+ (OPERAND_FFLAG, OPERAND_CFLAG) .
+ (FSRC): Split into:
+ (FFSRC, CFSRC).
+
+Thu Nov 13 11:05:33 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips-opc.c: Move the INSN_MACRO ISA value to the membership
+ field for all INSN_MACRO's.
+ * mips16-opc.c: same
+
+Wed Nov 12 10:16:57 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips-opc.c (sync,cache): These are 3900 insns.
+
+Tue Nov 11 23:53:41 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ sh-opc.h (sh_table): Remove ftst/nan.
+
+Tue Oct 28 17:59:32 1997 Ken Raeburn <raeburn@cygnus.com>
+
+ * mips-opc.c (ffc, ffs): Fix mask.
+
+Mon Oct 27 22:34:03 1997 Ken Raeburn <raeburn@cygnus.com>
+
+ * mips-opc.c: Fix bug in mask for "not" pseudo-instruction.
+ (WR_HILO, RD_HILO, MOD_HILO): New macros.
+
+Mon Oct 27 22:34:03 1997 Ken Raeburn <raeburn@cygnus.com>
+
+ * mips-opc.c: Fix bug in mask for "not" pseudo-instruction.
+ (WR_HILO, RD_HILO, MOD_HILO): New macros.
+
+Thu Oct 23 14:57:58 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-dis.c (disassemble): Replace // with /* ... */
+
+Wed Oct 22 17:33:21 1997 Richard Henderson <rth@cygnus.com>
+
+ * sparc-opc.c: Add wr & rd for v9a asr's.
+ * sparc-dis.c (print_insn_sparc): Recognize '_' and '/' for v9a asr's.
+ (v9a_asr_reg_names): New variable.
+ Patch from David Miller <davem@vger.rutgers.edu>.
+
+Wed Oct 22 17:18:02 1997 Richard Henderson <rth@cygnus.com>
+
+ * sparc-opc.c (v9notv9a): New insn type.
+ (IMPDEP): Move to the end to not conflict with edge8 et al.
+ Patch from David Miller <davem@vger.rutgers.edu>.
+
+Fri Oct 17 13:18:53 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips-opc.c (bnezl,beqzl): Mark these as also tx39.
+
+Thu Oct 16 11:55:20 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips-opc.c: Note that 'jalx' is (probably incorrectly) marked I1.
+
+Tue Oct 14 16:10:31 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-dis.c (disassemble): Use new symbol_at_address_func() field
+ of disassemble_info structure to determine if an overlay address
+ has a matching symbol in low memory.
+
+ * dis-buf.c (generic_symbol_at_address): New (dummy) function for
+ new symbol_at_address_func field in disassemble_info structure.
+
+Fri Oct 10 16:44:52 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-opc.c (extract_d22): Use signed arithmatic.
+
+Tue Oct 7 23:40:43 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips-opc.c: Three op mult is not an ISA insn.
+
+Tue Oct 7 23:37:21 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips-opc.c: Fix formatting.
+
+Fri Oct 3 17:26:54 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * i386-dis.c (OP_E): Explicitly sign extend 8 bit values, rather
+ than assuming that char is signed. Explicitly sign extend 16 bit
+ values, rather than assuming that short is 16 bits.
+ (OP_sI, OP_J, OP_DIR): Likewise.
+
+Wed Oct 1 16:58:54 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-opc.c: Fix typo in comment.
+
+ * v850-dis.c (disassemble): Add test of processor type when
+ determining opcodes.
+
+Wed Oct 1 14:10:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Use a diversion to set enable_shared before the
+ arguments are parsed.
+ * configure: Rebuild.
+
+Thu Sep 25 13:04:59 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * m68k-opc.c (TBL1): Use ! rather than `.
+ * m68k-dis.c (print_insn_arg): Remove ` operand specifier.
+
+Wed Sep 24 11:29:35 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * m68k-opc.c: Correct bchg, bclr, bset, and btst on ColdFire.
+
+ * m68k-opc.c: Accept tst{b,w,l} with immediate operands on cpu32.
+
+ * m68k-opc.c: Correct movew of an immediate operand to %sr or %ccr
+ for mcf5200.
+
+ * configure.in: Call AC_CHECK_TOOL before AM_PROG_LIBTOOL.
+ * aclocal.m4: Rebuild with new libtool.
+ * configure: Rebuild.
+
+Thu Sep 18 11:21:43 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * sparc-opc.c (sparclet_cpreg_table): Add %ccsr2, %cccrr, %ccrstr.
+
+Tue Sep 16 15:18:20 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-opc.c (v850_opcodes): Further rearrangements.
+
+Tue Sep 16 09:48:50 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-opc.c (v850_opcodes): Fields reordered to allow assembler
+ parser to work.
+
+Tue Sep 16 10:01:00 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips-opc.c: Added tx39 insns sdbbp, rfe, and deret.
+
+Mon Sep 15 18:31:52 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-opc.c: Initialise processors field of v850_opcode structure.
+
+Thu Sep 11 17:35:10 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * sparc-opc.c (sparc_opcodes): Fix assembler args to
+ fzeros, fones, fsrc1, fsrc1s, fsrc2s, fnot1, fnot1s, fnot2s,
+ fors, fnors, fands, fnands, fxors, fxnors, fornot1s, fornot2s,
+ fandnot1s, fandnot2s.
+
+Tue Sep 9 10:03:49 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * sparc-opc.c (sparc_opcodes): Fix op3 field for fcmpq/fcmpeq.
+
+Mon Sep 8 14:06:59 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * cgen-asm.c (cgen_parse_address): New argument resultp.
+ All callers updated.
+ * m32r-asm.c (parse_h_hi16): Right shift numbers by 16.
+
+Tue Sep 2 18:39:08 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mn10200-dis.c (disassemble): PC relative instructions are
+ relative to the next instruction, not the current instruction.
+
+Tue Sep 2 15:41:55 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-dis.c (disassemble): Only signed extend values that are not
+ returned by extract functions.
+ Remove use of V850_OPERAND_ADJUST_SHORT_MEMORY flag.
+
+Tue Sep 2 15:39:40 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-opc.c: Update comments. Remove use of
+ V850_OPERAND_ADJUST_SHORT_MEMORY. Fix several operand patterns.
+
+Tue Aug 26 09:42:28 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-opc.c (MOVHI): Immediate parameter is unsigned.
+
+Mon Aug 25 15:58:07 1997 Christopher Provenzano <proven@cygnus.com>
+
+ * configure: Rebuilt with latest devo autoconf for NT support.
+
+Fri Aug 22 10:35:15 1997 Nick Clifton <nickc@cygnus.com>
+
+ * v850-dis.c (disassemble): Use curly brace syntax for register
+ lists.
+
+ * v850-opc.c (v850_opcodes[]): Add NOT_R0 flag to decect cases
+ where r0 is being used as a destination register.
+
+
+Wed Aug 20 00:43:11 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * sh-opc.h (sh_arg_type): Add A_SGR and A_DBR.
+ (sh_nibble_type, sh_arg_type): Add SH4 floating point extensions.
+ (sh_table): Likewise. Add movca.l, ocbi, ocbp, ocbwb.
+ Add insns to access SGR and DBR.
+ * sh-dis.c (print_insn_shx): Add SH4 floating point extensions.
+
+Tue Aug 19 10:59:59 1997 Richard Henderson <rth@cygnus.com>
+
+ * alpha-opc.c (alpha_opcodes): Fix hw_rei_stall mungage.
+
+
+Fri Aug 15 05:17:48 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.in (bfd_arc_arch): Add.
+ * configure: Rebuild.
+ * Makefile.am (ALL_MACHINES): Add arc-dis.lo, arc-opc.lo.
+ * Makefile.in: Rebuild.
+ * arc-dis.c, arc-opc.c: New files.
+ * disassemble.c (ARCH_all): Define ARCH_arc.
+ (disassembler): Add ARC support.
+
+Wed Aug 13 18:52:11 1997 Nick Clifton <nickc@cygnus.com>
+
+
+ * v850-opc.c: Reorganised and re-layed out to improve readability
+ and portability.
+
+Tue Aug 5 23:09:31 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Rebuild with autoconf 2.12.1.
+
+Mon Aug 4 12:02:16 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4, configure: Rebuild with new automake patches.
+
+Fri Aug 1 13:02:04 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set enable_shared before AM_PROG_LIBTOOL.
+ * acinclude.m4: Just include acinclude.m4 from BFD.
+ * aclocal.m4, configure: Rebuild.
+
+Thu Jul 31 21:44:42 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: New file, based on old Makefile.in.
+ * acconfig.h: New file.
+ * acinclude.m4: New file.
+ * stamp-h.in: New file.
+ * configure.in: Call AM_INIT_AUTOMAKE and AM_PROG_LIBTOOL.
+ Removed shared library handling; now handled by libtool. Replace
+ AC_CONFIG_HEADER with AM_CONFIG_HEADER. Call AM_MAINTAINER_MODE,
+ AM_CYGWIN32, and AM_EXEEXT. Replace AC_PROG_INSTALL with
+ AM_PROG_INSTALL. Change all .o files to .lo. Remove stamp-h
+ handling in AC_OUTPUT.
+ * dep-in.sed: Change .o to .lo.
+ * Makefile.in: Now built with automake.
+ * aclocal.m4: Now built with aclocal.
+ * config.in, configure: Rebuild.
+
+Mon Jul 28 21:52:24 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mips-opc.c: Fix typo/thinko in "eret" instruction.
+
+Thu Jul 24 13:03:26 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * sparc-opc.c (sparc_opcodes): Fix spelling on fpaddX, fpsubX insns.
+ Make array const.
+ * sparc-dis.c (sorted_opcodes): New static local.
+ (struct opcode_hash): `opcode' is pointer to const element.
+ (build_hash): First arg is now table of sorted pointers.
+ (print_insn_sparc): Sort opcodes by sorting table of pointers.
+ (compare_opcodes): Update.
+
+Tue Jul 15 12:05:23 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * cgen-opc.c: #include <ctype.h>.
+ (hash_keyword_name): New arg `case_sensitive_p'. Callers updated.
+ Handle case insensitive hashing.
+ (hash_keyword_value): Change type of `value' to unsigned int.
+
+Thu Jul 10 12:56:10 1997 Jeffrey A Law (law@cygnus.com)
+
+ * mips-opc.c (mips_builtin_opcodes): If an insn uses single
+ precision FP, mark it as such. Likewise for double precision
+ FP. Mark ISA1 insns. Consolidate duplicate opcodes where
+ possible.
+
+Wed Jun 25 15:25:57 1997 Felix Lee <flee@cirdan.cygnus.com>
+
+ * ppc-opc.c (extract_nsi): make unsigned expression signed before
+ negating it.
+ (UNUSED): remove one level of parens, so MSVC doesn't choke on
+ nesting depth when all the macros are expanded.
+
+Tue Jun 17 17:02:17 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * sparc-opc.c: The fcmp v9a instructions take an integer register
+ as a destination, not a floating point register. From Christian
+ Kuehnke <Christian.Kuehnke@arbi.Informatik.Uni-Oldenburg.DE>.
+
+Mon Jun 16 14:13:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * m68k-dis.c (print_insn_arg): Print case 7.2 using %pc@()
+ syntax. From Roman Hodek
+ <rnhodek@faui22c.informatik.uni-erlangen.de>.
+
+ * i386-dis.c (twobyte_has_modrm): Fix pand.
+
+Mon Jun 16 14:08:38 1997 Michael Taylor <mbt@mit.edu>
+
+ * i386-dis.c (dis386_twobyte): Fix pand and pandn.
+
+Tue Jun 10 11:26:47 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * arm-dis.c: Add prototypes for arm_decode_shift and
+ print_insn_arm.
+
+Mon Jun 2 11:39:04 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips-opc.c: Add r3900 insns.
+
+Tue May 27 15:55:44 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * sh-dis.c (print_insn_shx): Change relmask to bfd_vma. Don't
+ print delay slot instructions on the same line. When using a PC
+ relative load, add a comment with the value being loaded if it can
+ be obtained.
+
+Tue May 27 11:02:08 1997 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * i386-dis.c (dis386[], dis386_twobyte[]): change pushl/popl
+ to pushS/popS for segment regs and byte constant so that
+ pushw/popw printed when in 16 bit data mode.
+
+ * i386-dis.c (dis386[]): change cwtl, cltd to cWtS, cStd to
+ print cbtw, cwtd in 16 bit data mode.
+ * i386-dis.c (putop): extra case W to support above.
+
+ * i386-dis.c (print_insn_x86): print addr32 prefix when given
+ address size prefix in 16 bit address mode.
+
+Fri May 23 16:47:23 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * sh-dis.c: Reindent. Rename local variable fprintf to
+ fprintf_fn.
+
+Thu May 22 14:06:02 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * m32r-opc.c (m32r_cgen_insn_table, cmpui): Undo patch of May 2.
+
+Tue May 20 11:26:27 1997 Gavin Koch <gavin@cygnus.com>
+
+ * mips-opc.c (mips_builtin_opcodes): Moved INSN_ISA field into new
+ field membership.
+ * mips16-opc.c (mip16_opcodes): same.
+
Mon May 12 15:10:53 1997 Jim Wilson <wilson@cygnus.com>
* m68k-opc.c (moveb): Change $d to %d.
@@ -12,6 +736,20 @@ Mon May 5 14:28:41 1997 Ian Lance Taylor <ian@cygnus.com>
* i386-dis.c: Revert patch of April 4. The output now matches
what gcc generates.
+Fri May 2 12:48:37 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * m32r-opc.c (m32r_cgen_insn_table, cmpui): Use $uimm16 instead
+ of $simm16.
+
+Thu May 1 15:34:15 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * m32r-opc.h (CGEN_ARCH): Renamed from CGEN_CPU.
+
+Tue Apr 15 12:40:08 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (install): Depend upon installdirs.
+ (installdirs): New target.
+
Mon Apr 14 12:13:51 1997 Ian Lance Taylor <ian@cygnus.com>
From Thomas Graichen <graichen@rzpd.de>:
@@ -72,11 +810,17 @@ Fri Apr 4 14:04:16 1997 Ian Lance Taylor <ian@cygnus.com>
* configure.in: Correct file names for bfd_mn10[23]00_arch.
* configure: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+
* d10v-dis.c: Include "ansidecl.h" before "opcode/d10v.h".
* i386-dis.c (float_reg): Swap fsubrp and fsubp. Swap fdivrp and
fdivp.
+Thu Apr 3 13:22:45 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Branched binutils 2.8.
+
Wed Apr 2 12:23:53 1997 Ian Lance Taylor <ian@cygnus.com>
* m10200-dis.c: Rename from mn10200-dis.c.
@@ -110,6 +854,12 @@ Thu Mar 27 14:24:43 1997 Ian Lance Taylor <ian@cygnus.com>
* mips-opc.c: Add cast when setting mips_opcodes.
+Tue Mar 25 23:04:00 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * v850-dis.c (disassemble): Fix sign extension problem.
+ * v850-opc.c (extract_d*): Fix sign extension problems to make
+ disassembly calculate branch offsets correctly.
+
Mon Mar 24 13:22:13 1997 Ian Lance Taylor <ian@cygnus.com>
* sh-opc.h: Add bf/s and bt/s as synonyms for bf.s and bt.s.
@@ -322,11 +1072,21 @@ Thu Jan 2 12:14:29 1997 Jeffrey A Law (law@cygnus.com)
* mn10300-dis.c (disassemble): Make sure all variables are initialized
before they are used.
+Tue Dec 31 12:20:38 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (v850_opcodes): Put curly-braces around operands
+ for "breakpoint" instruction.
+
Tue Dec 31 15:38:13 1996 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (ALL_CFLAGS): Add -D_GNU_SOURCE.
(dep): Use ALL_CFLAGS rather than CFLAGS.
+Tue Dec 31 15:09:16 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * v850-opc.c (D8_{6,7}): Set V850_OPERAND_ADJUST_SHORT_MEMORY
+ flag.
+
Mon Dec 30 17:02:11 1996 Fred Fish <fnf@cygnus.com>
* Makefile.in (m68k-opc.o, alpha-opc.o): Remove dis-asm.h dependency.
@@ -566,15 +1326,33 @@ Fri Nov 1 10:29:11 1996 Richard Henderson <rth@tamu.edu>
(alpha_opcodes): Add new BWX, CIX, and MAX instructions.
Recategorize PALcode instructions.
+Wed Oct 30 16:46:58 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (v850_opcodes): Add relaxing "jbr".
+
Tue Oct 29 16:30:28 1996 Ian Lance Taylor <ian@cygnus.com>
* mips-dis.c (_print_insn_mips): Don't print a trailing tab if
there are no operand types.
+Tue Oct 29 12:22:21 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (D9_RELAX): Renamed from D9, all references
+ changed.
+ (v850_operands): Make sure D22 immediately follows D9_RELAX.
+
Fri Oct 25 12:12:53 1996 Ian Lance Taylor <ian@cygnus.com>
* i386-dis.c (print_insn_x86): Set info->bytes_per_line to 5.
+Thu Oct 24 17:53:52 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (insert_d8_6): Fix operand insertion for sld.w
+ and sst.w instructions.
+
+ * v850-opc.c (v850_opcodes): Add "jCC" instructions (aliases for
+ "bCC"instructions).
+
Thu Oct 24 17:21:20 1996 Ian Lance Taylor <ian@cygnus.com>
* mips-dis.c (_print_insn_mips): Use a tab between the instruction
@@ -591,6 +1369,10 @@ Fri Oct 11 16:03:49 1996 Jeffrey A Law (law@cygnus.com)
* mn10300-opc.c (mn10300_opcodes): Fix typo in opcode
field for movhu instruction.
+ * v850-dis.c (disassemble): For V850_OPERAND_SIGNED operands,
+ cast value to "long" not "signed long" to keep hpux10
+ compiler quiet.
+
Thu Oct 10 10:25:58 1996 Jeffrey A Law (law@cygnus.com)
* mn10300-opc.c (mn10300_opcodes): Fix typo in opcode field
@@ -672,6 +1454,16 @@ Tue Oct 1 10:49:11 1996 Ian Lance Taylor <ian@cygnus.com>
* i386-dis.c (op_rtn): Change to be a pointer. Adjust uses
accordingly. Don't declare functions using op_rtn.
+Fri Sep 27 18:28:59 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * v850-dis.c (disassemble): Add memaddr argument. Re-arrange
+ params to be more standard.
+ * (disassemble): Print absolute addresses and symbolic names for
+ branch and jump targets.
+ * v850-opc.c (v850_operand): Add displacement flag to 9 and 22
+ bit operands.
+ * (v850_opcodes): Add breakpoint insn.
+
Mon Sep 23 12:32:26 1996 Ian Lance Taylor <ian@cygnus.com>
* m68k-opc.c: Move the fmovemx data register cases before the
@@ -697,11 +1489,179 @@ Tue Sep 3 12:09:46 1996 Doug Evans <dje@canuck.cygnus.com>
* sparc-opc.c (sparc_opcodes): Add setuw, setsw, setx.
+Tue Sep 3 12:05:25 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-dis.c (disassemble): Make static. Provide prototype.
+
+Sun Sep 1 22:30:40 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (insert_d9, insert_d22): Fix boundary case
+ in range checks.
+
+Sat Aug 31 01:27:26 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-dis.c (disassemble): Handle insertion of ',', '[' and
+ ']' characters into the output stream.
+ * v850-opc.c (v850_opcodes: Remove size field from all opcodes.
+ Add "memop" field to all opcodes (for the disassembler).
+ Reorder opcodes so that "nop" comes before "mov" and "jr"
+ comes before "jarl".
+
+ * v850-dis.c (print_insn_v850): Fix typo in last change.
+
+ * v850-dis.c (print_insn_v850): Properly handle disassembling
+ a two byte insn at the end of a memory region when the memory
+ region's size is only two byte aligned.
+
+ * v850-dis.c (v850_cc_names): Fix stupid thinkos.
+
+ * v850-dis.c (v850_reg_names): Define.
+ (v850_sreg_names, v850_cc_names): Likewise.
+ (disassemble): Very rough cut at printing operands (unformatted).
+
+ * v850-opc.c (BOP_MASK): Fix.
+ (v850_opcodes): Fix mask for jarl and jr.
+
+ * v850-dis.c: New file. Skeleton for disassembler support.
+ * Makefile.in Remove v850 references, they're not needed here.
+ * configure.in: Add v850-dis.o when building v850 toolchains.
+ * configure: Rebuilt.
+ * disassemble.c (disassembler): Call v850 disassembler.
+
+ * v850-opc.c (insert_d8_7, extract_d8_7): New functions.
+ (insert_d8_6, extract_d8_6): New functions.
+ (v850_operands): Rename D7S to D7; operand for D7 is unsigned.
+ Rename D8 to D8_7, use {insert,extract}_d8_7 routines.
+ Add D8_6.
+ (IF4A, IF4B): Use "D7" instead of "D7S".
+ (IF4C, IF4D): Use "D8_7" instead of "D8".
+ (IF4E, IF4F): New. Use "D8_6".
+ (v850_opcodes): Use IF4A/IF4B for sld.b/sst.b. Use IF4C/IF4D for
+ sld.h/sst.h. Use IF4E/IF4F for sld.w/sst.w.
+
+ * v850-opc.c (insert_d16_15, extract_d16_15): New functions.
+ (v850_operands): Change D16 to D16_15, use special insert/extract
+ routines. New new D16 that uses the generic insert/extract code.
+ (IF7A, IF7B): Use D16_15.
+ (IF7C, IF7D): New. Use D16.
+ (v850_opcodes): Use IF7C and IF7D for ld.b and st.b.
+
+ * v850-opc.c (insert_d9, insert_d22): Slightly improve error
+ message. Issue an error if the branch offset is odd.
+
+ * v850-opc.c: Add notes about needing special insert/extract
+ for all the load/store insns, except "ld.b" and "st.b".
+
+ * v850-opc.c (insert_d22, extract_d22): New functions.
+ (v850_operands): Use insert_d22 and extract_d22 for
+ D22 operands.
+ (insert_d9): Fix range check.
+
+Fri Aug 30 18:01:02 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * v850-opc.c (v850_operands): Add V850_OPERAND_SIGNED flag
+ and set bits field to D9 and D22 operands.
+
+Thu Aug 29 11:10:46 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (v850_operands): Define SR2 operand.
+ (v850_opcodes): "ldsr" uses R1,SR2.
+
+ * v850-opc.c (v850_opcodes): Fix opcode specs for
+ sld.w, sst.b, sst.h, sst.w, and nop.
+
+Wed Aug 28 15:55:43 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (v850_opcodes): Add null opcode to mark the
+ end of the opcode table.
+
Mon Aug 26 13:35:53 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* d10v-opc.c (pre_defined_registers): Added register pairs,
"r0-r1", "r2-r3", etc.
+Fri Aug 23 00:27:01 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (v850_operands): Make I16 be a signed operand.
+ Create I16U for an unsigned 16bit mmediate operand.
+ (v850_opcodes): Use I16U for "ori", "andi" and "xori".
+
+ * v850-opc.c (v850_operands): Define EP operand.
+ (IF4A, IF4B, IF4C, IF4D): Use EP.
+
+ * v850-opc.c (v850_opcodes): Fix opcode numbers for "mov"
+ with immediate operand, "movhi". Tweak "ldsr".
+
+ * v850-opc.c (v850_opcodes): Get ld.[bhw] and st.[bhw]
+ correct. Get sld.[bhw] and sst.[bhw] closer.
+
+ * v850-opc.c (v850_operands): "not" is a two byte insn
+
+ * v850-opc.c (v850_opcodes): Correct bit pattern for setf.
+
+ * v850-opc.c (v850_operands): D16 inserts at offset 16!
+
+ * v850-opc.c (two): Get order of words correct.
+
+ * v850-opc.c (v850_operands): I16 inserts at offset 16!
+
+ * v850-opc.c (v850_operands): Add "SR1" and "SR2" for system
+ register source and destination operands.
+ (v850_opcodes): Use SR1 and SR2 for "ldsr" and "stsr".
+
+ * v850-opc.c (v850_opcodes): Fix thinko in "jmp" opcode. Fix
+ same thinko in "trap" opcode.
+
+ * v850-opc.c (v850_opcodes): Add initializer for size field
+ on all opcodes.
+
+ * v850-opc.c (v850_operands): D6 -> DS7. References changed.
+ Add D8 for 8-bit unsigned field in short load/store insns.
+ (IF4A, IF4D): These both need two registers.
+ (IF4C, IF4D): Define. Use 8-bit unsigned field.
+ (v850_opcodes): For "sld.h", "sld.w", "sst.h", "sst.w", use
+ IF4C & IF4D. For "trap" use I5U, not I5. Add IF1 operand
+ for "ldsr" and "stsr".
+ * v850-opc.c (v850_operands): 3-bit immediate for bit insns
+ is unsigned.
+
+ * v850-opc.c (v850_opcodes): Correct short store half (sst.h) and
+ short store word (sst.w).
+
+Thu Aug 22 16:57:27 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * v850-opc.c (v850_operands): Added insert and extract fields,
+ pointers to functions that handle unusual operand encodings.
+
+Thu Aug 22 01:05:24 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (v850_opcodes): Enable "trap".
+
+ * v850-opc.c (v850_opcodes): Fix order of displacement
+ and register for "set1", "clr1", "not1", and "tst1".
+
+Wed Aug 21 18:46:26 1996 Jeffrey A Law (law@cygnus.com)
+
+ * v850-opc.c (v850_operands): Add "B3" support.
+ (v850_opcodes): Fix and enable "set1", "clr1", "not1"
+ and "tst1".
+
+ * v850-opc.c (v850_opcodes): "jmp" has only an R1 operand.
+
+ * v850-opc.c: Close unterminated comment.
+
+Wed Aug 21 17:31:26 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * v850-opc.c (v850_operands): Add flags field.
+ (v850_opcodes): add move opcodes.
+
+Tue Aug 20 14:41:03 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * Makefile.in (ALL_MACHINES): Add v850-opc.o.
+ * configure: (bfd_v850v_arch) Add new case.
+ * configure.in: (bfd_v850_arch) Add new case.
+ * v850-opc.c: New file.
+
Mon Aug 19 15:21:38 1996 Doug Evans <dje@canuck.cygnus.com>
* sparc-dis.c (print_insn_sparc): Handle little endian sparcs.
@@ -1666,7 +2626,6 @@ Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
* disassemble.c (disassembler, case bfd_arch_arm): Disassemble for
the correct endianness.
-
Mon Apr 24 14:18:05 1995 Jason Molenda (crash@phydeaux.cygnus.com>
* sh-opc.h (sh_nibble_type, sh_arg_type): remove trailing , from
@@ -1692,7 +2651,6 @@ Mon Apr 17 12:23:28 1995 Kung Hsu <kung@rtl.cygnus.com>
* m68k-dis.c: Take out #define BREAK_UP_BIG_DECL kludge, because
gcc memory hog problem with initializer is fixed.
-
Mon Apr 10 15:55:01 1995 Stan Shebs <shebs@andros.cygnus.com>
Merge in support for Mac MPW as a host.
@@ -1718,7 +2676,6 @@ Mon Apr 10 15:55:01 1995 Stan Shebs <shebs@andros.cygnus.com>
* mpw-config.in: New file, MPW version of configure.in.
* mpw-make.in: New file, MPW version of Makefile.in.
-
Fri Mar 31 14:23:38 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
* alpha-dis.c (print_insn_alpha): Put empty statement after
@@ -1767,7 +2724,6 @@ Wed Mar 8 02:54:05 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
(print_insn_arg): Arrays cacheFieldName and names now const.
(print_indexed): Array scales now const.
-
Tue Mar 7 16:41:21 1995 Ian Lance Taylor <ian@cygnus.com>
* ppc-opc.c: Sort recently added instructions by minor opcode
@@ -1785,7 +2741,6 @@ Mon Feb 20 23:54:38 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* Makefile.in (ALL_MACHINES): Add w65-dis.o.
-
Thu Feb 16 17:34:41 1995 Ian Lance Taylor <ian@cygnus.com>
* mips-opc.c: Add r4650 mul instruction.
@@ -1800,7 +2755,6 @@ Tue Feb 14 13:17:37 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* ppc-opc.c (powerpc_opcodes): Add 403GA opcodes rfci, dccci,
mfdcr, mtdcr, icbt, iccci.
-
Thu Feb 9 12:28:13 1995 Stan Shebs <shebs@andros.cygnus.com>
* i960-dis.c (struct tabent, struct sparse_tabent): Change the
@@ -1853,12 +2807,10 @@ Wed Dec 28 22:15:33 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* h8300-dis.c (bfd_h8_disassemble): Add support for 2 bit
immediates.
-
Tue Dec 20 11:25:12 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
* mips-opc.c: Add dli as a synonym for li.
-
Thu Dec 8 18:23:31 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
* alpha-dis.c (print_insn_alpha): Handle call_pal instruction, and
@@ -1871,7 +2823,6 @@ Thu Dec 8 18:23:31 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
* m68k-dis.c (print_insn_arg, case 'J'): Handle buscr and pcr
control registers.
-
Wed Nov 23 22:34:51 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* sh-opc.h (mov.l gbr): Get direction right.
diff --git a/contrib/binutils/opcodes/Makefile.am b/contrib/binutils/opcodes/Makefile.am
new file mode 100644
index 0000000..5dda6953
--- /dev/null
+++ b/contrib/binutils/opcodes/Makefile.am
@@ -0,0 +1,258 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus
+
+INCDIR = $(srcdir)/../include
+BFDDIR = $(srcdir)/../bfd
+DEP = mkdep
+
+lib_LTLIBRARIES = libopcodes.la
+
+# This is where bfd.h lives.
+BFD_H = ../bfd/bfd.h
+
+# Header files.
+HFILES = \
+ arm-opc.h \
+ h8500-opc.h \
+ sh-opc.h \
+ sysdep.h \
+ w65-opc.h \
+ z8k-opc.h
+
+# C source files that correspond to .o's.
+CFILES = \
+ a29k-dis.c \
+ alpha-dis.c \
+ alpha-opc.c \
+ arm-dis.c \
+ cgen-asm.c \
+ cgen-dis.c \
+ cgen-opc.c \
+ d10v-dis.c \
+ d10v-opc.c \
+ dis-buf.c \
+ disassemble.c \
+ h8300-dis.c \
+ h8500-dis.c \
+ hppa-dis.c \
+ i386-dis.c \
+ i960-dis.c \
+ m32r-asm.c \
+ m32r-dis.c \
+ m32r-opc.c \
+ m68k-dis.c \
+ m68k-opc.c \
+ m88k-dis.c \
+ mips-dis.c \
+ mips-opc.c \
+ mips16-opc.c \
+ m10200-dis.c \
+ m10200-opc.c \
+ m10300-dis.c \
+ m10300-opc.c \
+ ns32k-dis.c \
+ ppc-dis.c \
+ ppc-opc.c \
+ sh-dis.c \
+ sparc-dis.c \
+ sparc-opc.c \
+ tic30-dis.c \
+ w65-dis.c \
+ z8k-dis.c \
+ z8kgen.c
+
+ALL_MACHINES = \
+ a29k-dis.lo \
+ alpha-dis.lo \
+ alpha-opc.lo \
+ arc-dis.lo \
+ arc-opc.lo \
+ arm-dis.lo \
+ cgen-asm.lo \
+ cgen-dis.lo \
+ cgen-opc.lo \
+ d10v-dis.lo \
+ d10v-opc.lo \
+ h8300-dis.lo \
+ h8500-dis.lo \
+ hppa-dis.lo \
+ i386-dis.lo \
+ i960-dis.lo \
+ m32r-asm.lo \
+ m32r-dis.lo \
+ m32r-opc.lo \
+ m68k-dis.lo \
+ m68k-opc.lo \
+ m88k-dis.lo \
+ m10200-dis.lo \
+ m10200-opc.lo \
+ m10300-dis.lo \
+ m10300-opc.lo \
+ mips-dis.lo \
+ mips-opc.lo \
+ mips16-opc.lo \
+ ppc-dis.lo \
+ ppc-opc.lo \
+ ns32k-dis.lo \
+ sh-dis.lo \
+ sparc-dis.lo \
+ sparc-opc.lo \
+ tic30-dis.lo \
+ v850-dis.lo \
+ v850-opc.lo \
+ w65-dis.lo \
+ z8k-dis.lo
+
+OFILES = @BFD_MACHINES@
+
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@
+
+disassemble.lo: disassemble.c $(INCDIR)/dis-asm.h
+ $(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $(srcdir)/disassemble.c
+
+libopcodes_la_SOURCES = dis-buf.c disassemble.c
+libopcodes_la_DEPENDENCIES = $(OFILES)
+libopcodes_la_LIBADD = $(OFILES)
+libopcodes_la_LDFLAGS = -release $(VERSION)
+
+# libtool will build .libs/libopcodes.a. We create libopcodes.a in
+# the build directory so that we don't have to convert all the
+# programs that use libopcodes.a simultaneously. This is a hack which
+# should be removed if everything else starts using libtool. FIXME.
+
+noinst_LIBRARIES = libopcodes.a
+
+stamp-lib: libopcodes.la
+ if [ -f .libs/libopcodes.a ]; then \
+ cp .libs/libopcodes.a libopcodes.tmp; \
+ $(SHELL) $(srcdir)/../move-if-change libopcodes.tmp libopcodes.a; \
+ else true; fi
+ touch stamp-lib
+
+libopcodes.a: stamp-lib ; @true
+
+CLEANFILES = libopcodes.a stamp-lib dep.sed .dep .dep1
+
+
+
+
+
+# This dependency stuff is copied from BFD.
+
+.dep: dep.sed $(CFILES) $(HFILES) config.h
+ rm -f .dep1
+ $(MAKE) DEP=$(DEP) .dep1
+ sed -f dep.sed < .dep1 > .dep
+
+.dep1: $(CFILES)
+ rm -f .dep2 .dep2a
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
+ echo > .dep2a
+ $(DEP) -f .dep2a $(INCLUDES) $(CFLAGS) $?
+ sed -e '/DO NOT DELETE/d' -e '/^$$/d' < .dep2a >> .dep2
+ rm -f .dep2a
+ $(srcdir)/../move-if-change .dep2 .dep1
+
+dep.sed: dep-in.sed config.status
+ sed <$(srcdir)/dep-in.sed >dep.sed \
+ -e 's!@BFD_H@!$(BFD_H)!' \
+ -e 's!@INCDIR@!$(INCDIR)!' \
+ -e 's!@BFDDIR@!$(BFDDIR)!' \
+ -e 's!@SRCDIR@!$(srcdir)!'
+
+dep: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
+ cat .dep >> tmp-Makefile
+ $(srcdir)/../move-if-change tmp-Makefile Makefile
+
+dep-in: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
+ cat .dep >> tmp-Makefile.in
+ $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
+
+dep-am: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
+ cat .dep >> tmp-Makefile.am
+ $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
+
+.PHONY: dep dep-in dep-am
+
+# What appears below is generated by a hacked mkdep using gcc -MM.
+
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+a29k-dis.lo: a29k-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h $(INCDIR)/opcode/a29k.h
+alpha-dis.lo: alpha-dis.c $(INCDIR)/ansidecl.h sysdep.h \
+ config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/opcode/alpha.h
+alpha-opc.lo: alpha-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/alpha.h \
+ $(BFD_H)
+arm-dis.lo: arm-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h arm-opc.h $(INCDIR)/coff/internal.h \
+ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+cgen-asm.lo: cgen-asm.c sysdep.h config.h $(INCDIR)/libiberty.h \
+ $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h
+cgen-dis.lo: cgen-dis.c sysdep.h config.h $(INCDIR)/libiberty.h \
+ $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h
+cgen-opc.lo: cgen-opc.c sysdep.h config.h $(INCDIR)/libiberty.h \
+ $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h
+d10v-dis.lo: d10v-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/d10v.h \
+ $(INCDIR)/dis-asm.h $(BFD_H)
+d10v-opc.lo: d10v-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/d10v.h
+dis-buf.lo: dis-buf.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+ $(BFD_H)
+disassemble.lo: disassemble.c $(INCDIR)/ansidecl.h \
+ $(INCDIR)/dis-asm.h $(BFD_H)
+h8300-dis.lo: h8300-dis.c $(INCDIR)/opcode/h8300.h \
+ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h
+h8500-dis.lo: h8500-dis.c h8500-opc.h $(INCDIR)/dis-asm.h \
+ $(BFD_H) $(INCDIR)/ansidecl.h
+hppa-dis.lo: hppa-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+ $(BFD_H) $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h
+i386-dis.lo: i386-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h sysdep.h config.h
+i960-dis.lo: i960-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h
+m32r-asm.lo: m32r-asm.c sysdep.h config.h $(BFD_H) \
+ $(INCDIR)/symcat.h m32r-opc.h $(INCDIR)/opcode/cgen.h
+m32r-dis.lo: m32r-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+ $(BFD_H) $(INCDIR)/symcat.h m32r-opc.h $(INCDIR)/opcode/cgen.h
+m32r-opc.lo: m32r-opc.c sysdep.h config.h $(INCDIR)/libiberty.h \
+ $(BFD_H) $(INCDIR)/symcat.h m32r-opc.h $(INCDIR)/opcode/cgen.h
+m68k-dis.lo: m68k-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h $(INCDIR)/floatformat.h $(INCDIR)/opcode/m68k.h
+m68k-opc.lo: m68k-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/m68k.h
+m88k-dis.lo: m88k-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h $(INCDIR)/opcode/m88k.h
+mips-dis.lo: mips-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+ $(BFD_H) $(INCDIR)/opcode/mips.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h
+mips-opc.lo: mips-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mips.h
+mips16-opc.lo: mips16-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mips.h
+m10200-dis.lo: m10200-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10200.h \
+ $(INCDIR)/dis-asm.h $(BFD_H)
+m10200-opc.lo: m10200-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10200.h
+m10300-dis.lo: m10300-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10300.h \
+ $(INCDIR)/dis-asm.h $(BFD_H)
+m10300-opc.lo: m10300-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10300.h
+ns32k-dis.lo: ns32k-dis.c $(BFD_H) $(INCDIR)/ansidecl.h \
+ sysdep.h config.h $(INCDIR)/dis-asm.h $(INCDIR)/opcode/ns32k.h
+ppc-dis.lo: ppc-dis.c $(INCDIR)/ansidecl.h sysdep.h \
+ config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/opcode/ppc.h
+ppc-opc.lo: ppc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/ppc.h
+sh-dis.lo: sh-dis.c sh-opc.h $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h
+sparc-dis.lo: sparc-dis.c $(INCDIR)/ansidecl.h sysdep.h \
+ config.h $(INCDIR)/opcode/sparc.h $(INCDIR)/dis-asm.h \
+ $(BFD_H) $(INCDIR)/libiberty.h
+sparc-opc.lo: sparc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/sparc.h
+tic30-dis.lo: tic30-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h $(INCDIR)/opcode/tic30.h
+w65-dis.lo: w65-dis.c w65-opc.h $(INCDIR)/dis-asm.h \
+ $(BFD_H) $(INCDIR)/ansidecl.h
+z8k-dis.lo: z8k-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+ $(BFD_H) z8k-opc.h
+z8kgen.lo: z8kgen.c sysdep.h config.h
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/contrib/binutils/opcodes/Makefile.in b/contrib/binutils/opcodes/Makefile.in
index 5a0670e..b1d1b0f 100644
--- a/contrib/binutils/opcodes/Makefile.in
+++ b/contrib/binutils/opcodes/Makefile.in
@@ -1,78 +1,89 @@
-# Makefile template for Configure for the opcodes library.
-# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
-# Free Software Foundation, Inc.
-# Written by Cygnus Support.
-#
-# 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.
-#
+# Makefile.in generated automatically by automake 1.2e from Makefile.am
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
+
# 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.
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-VPATH = @srcdir@
-srcdir = @srcdir@
-prefix = @prefix@
+SHELL = @SHELL@
-program_transform_name = @program_transform_name@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
datadir = @datadir@
-mandir = @mandir@
-man1dir = $(mandir)/man1
-man2dir = $(mandir)/man2
-man3dir = $(mandir)/man3
-man4dir = $(mandir)/man4
-man5dir = $(mandir)/man5
-man6dir = $(mandir)/man6
-man7dir = $(mandir)/man7
-man8dir = $(mandir)/man8
-man9dir = $(mandir)/man9
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
infodir = @infodir@
+mandir = @mandir@
includedir = @includedir@
+oldincludedir = /usr/include
-SHELL = /bin/sh
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
AR = @AR@
-AR_FLAGS = rc
+BFD_MACHINES = @BFD_MACHINES@
CC = @CC@
-CFLAGS = @CFLAGS@
-MAKEINFO = makeinfo
+EXEEXT = @EXEEXT@
+HDEFINES = @HDEFINES@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
+VERSION = @VERSION@
+archdefs = @archdefs@
-ALLLIBS = @ALLLIBS@
-
-PICFLAG = @PICFLAG@
-SHLIB = @SHLIB@
-SHLIB_CC = @SHLIB_CC@
-SHLIB_CFLAGS = @SHLIB_CFLAGS@
-SHLIB_LIBS = @SHLIB_LIBS@
-COMMON_SHLIB = @COMMON_SHLIB@
-SHLIB_DEP = @SHLIB_DEP@
-SHLINK = @SHLINK@
-
-SONAME = lib`echo $(SHLIB) | sed -e 's,^\.\./bfd/,,' -e 's/^lib//' | sed '$(program_transform_name)'`
+AUTOMAKE_OPTIONS = cygnus
INCDIR = $(srcdir)/../include
BFDDIR = $(srcdir)/../bfd
-CSEARCH = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR)
DEP = mkdep
-TARGETLIB = libopcodes.a
+lib_LTLIBRARIES = libopcodes.la
# This is where bfd.h lives.
BFD_H = ../bfd/bfd.h
@@ -123,226 +134,372 @@ CFILES = \
sh-dis.c \
sparc-dis.c \
sparc-opc.c \
+ tic30-dis.c \
w65-dis.c \
z8k-dis.c \
z8kgen.c
ALL_MACHINES = \
- a29k-dis.o \
- alpha-dis.o \
- alpha-opc.o \
- arm-dis.o \
- cgen-asm.o \
- cgen-dis.o \
- cgen-opc.o \
- d10v-dis.o \
- d10v-opc.o \
- h8300-dis.o \
- h8500-dis.o \
- hppa-dis.o \
- i386-dis.o \
- i960-dis.o \
- m32r-asm.o \
- m32r-dis.o \
- m32r-opc.o \
- m68k-dis.o \
- m68k-opc.o \
- m88k-dis.o \
- m10200-dis.o \
- m10200-opc.o \
- m10300-dis.o \
- m10300-opc.o \
- mips-dis.o \
- mips-opc.o \
- mips16-opc.o \
- ppc-dis.o \
- ppc-opc.o \
- ns32k-dis.o \
- sh-dis.o \
- sparc-dis.o \
- sparc-opc.o \
- w65-dis.o \
- z8k-dis.o
-
-OFILES = @BFD_MACHINES@ dis-buf.o disassemble.o
-
-FLAGS_TO_PASS = \
- "against=$(against)" \
- "AR=$(AR)" \
- "AR_FLAGS=$(AR_FLAGS)" \
- "CC=$(CC)" \
- "CFLAGS=$(CFLAGS)" \
- "RANLIB=$(RANLIB)" \
- "MAKEINFO=$(MAKEINFO)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
-
-ALL_CFLAGS = -D_GNU_SOURCE $(CSEARCH) @HDEFINES@ $(CFLAGS)
+ a29k-dis.lo \
+ alpha-dis.lo \
+ alpha-opc.lo \
+ arc-dis.lo \
+ arc-opc.lo \
+ arm-dis.lo \
+ cgen-asm.lo \
+ cgen-dis.lo \
+ cgen-opc.lo \
+ d10v-dis.lo \
+ d10v-opc.lo \
+ h8300-dis.lo \
+ h8500-dis.lo \
+ hppa-dis.lo \
+ i386-dis.lo \
+ i960-dis.lo \
+ m32r-asm.lo \
+ m32r-dis.lo \
+ m32r-opc.lo \
+ m68k-dis.lo \
+ m68k-opc.lo \
+ m88k-dis.lo \
+ m10200-dis.lo \
+ m10200-opc.lo \
+ m10300-dis.lo \
+ m10300-opc.lo \
+ mips-dis.lo \
+ mips-opc.lo \
+ mips16-opc.lo \
+ ppc-dis.lo \
+ ppc-opc.lo \
+ ns32k-dis.lo \
+ sh-dis.lo \
+ sparc-dis.lo \
+ sparc-opc.lo \
+ tic30-dis.lo \
+ v850-dis.lo \
+ v850-opc.lo \
+ w65-dis.lo \
+ z8k-dis.lo
+
+OFILES = @BFD_MACHINES@
+
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@
+
+libopcodes_la_SOURCES = dis-buf.c disassemble.c
+libopcodes_la_DEPENDENCIES = $(OFILES)
+libopcodes_la_LIBADD = $(OFILES)
+libopcodes_la_LDFLAGS = -release $(VERSION)
+
+# libtool will build .libs/libopcodes.a. We create libopcodes.a in
+# the build directory so that we don't have to convert all the
+# programs that use libopcodes.a simultaneously. This is a hack which
+# should be removed if everything else starts using libtool. FIXME.
+
+noinst_LIBRARIES = libopcodes.a
+
+CLEANFILES = libopcodes.a stamp-lib dep.sed .dep .dep1
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I.
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+libopcodes_a_LIBADD =
+libopcodes_a_SOURCES = libopcodes.a.c
+libopcodes_a_OBJECTS = libopcodes.a.o
+LTLIBRARIES = $(lib_LTLIBRARIES)
+
+libopcodes_la_OBJECTS = dis-buf.lo disassemble.lo
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = ChangeLog Makefile.am Makefile.in acconfig.h acinclude.m4 \
+aclocal.m4 config.in configure configure.in stamp-h.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP = --best
+SOURCES = libopcodes.a.c $(libopcodes_la_SOURCES)
+OBJECTS = libopcodes.a.o $(libopcodes_la_OBJECTS)
+
+default: all
+
+.SUFFIXES:
+.SUFFIXES: .S .c .lo .o .s
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINT@ configure.in acinclude.m4
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+ @:
+stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h
+$(srcdir)/config.in: @MAINT@$(srcdir)/stamp-h.in
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f config.h
+
+maintainer-clean-hdr:
+
+mostlyclean-noinstLIBRARIES:
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+distclean-noinstLIBRARIES:
+
+maintainer-clean-noinstLIBRARIES:
.c.o:
- if [ -n "$(PICFLAG)" ]; then \
- $(CC) -c $(PICFLAG) $(ALL_CFLAGS) $< -o pic/$@; \
- else true; fi
- $(CC) -c $(ALL_CFLAGS) $<
+ $(COMPILE) -c $<
-all: $(ALLLIBS)
+.s.o:
+ $(COMPILE) -c $<
-.NOEXPORT:
+.S.o:
+ $(COMPILE) -c $<
-installcheck check:
+mostlyclean-compile:
+ -rm -f *.o core *.core
-info:
-clean-info:
-install-info:
-dvi:
+clean-compile:
-# HDEPFILES comes from the host config; TDEPFILES from the target config.
-
-$(TARGETLIB): $(OFILES)
- rm -f $(TARGETLIB)
- $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES)
- $(RANLIB) $(TARGETLIB)
-
-LIBIBERTY_LISTS = ../libiberty/required-list ../libiberty/needed-list
-BFD_PICLIST = @BFD_PICLIST@
-
-stamp-piclist: Makefile $(LIBIBERTY_LISTS) $(BFD_PICLIST)
- rm -f tpiclist
- if [ -n "$(PICFLAG)" ]; then \
- echo $(OFILES) | sed -e 's,\([^ ][^ ]*\),pic/\1,g' > tpiclist; \
- else \
- echo $(OFILES) > tpiclist; \
- fi
- if [ "$(COMMON_SHLIB)" = "yes" ]; then \
- lobjs=`cat $(LIBIBERTY_LISTS)`; \
- if [ -n "$(PICFLAG)" ]; then \
- lobjs=`echo $$lobjs | sed -e 's,\([^ ][^ ]*\),pic/\1,g'`; \
- fi; \
- lobjs=`echo $$lobjs | sed -e 's,\([^ ][^ ]*\),../libiberty/\1,g'`; \
- echo $$lobjs >> tpiclist; \
- sed -e 's,\([^ ][^ ]*\),../bfd/\1,g' $(BFD_PICLIST) >> tpiclist; \
- else true; fi
- $(srcdir)/../move-if-change tpiclist piclist
- touch stamp-piclist
-
-piclist: stamp-piclist ; @true
-
-$(SHLIB): stamp-picdir $(OFILES) piclist $(SHLIB_DEP)
- rm -f $(SHLIB)
- $(SHLIB_CC) $(SHLIB_CFLAGS) -o $(SHLIB) `cat piclist` $(SHLIB_LIBS)
-
-$(SHLINK): $(SHLIB)
- ts=lib`echo $(SHLIB) | sed -e 's,^\.\./bfd/,,' -e 's/^lib//' | sed -e '$(program_transform_name)'`; \
- if [ "$(COMMON_SHLIB)" = "yes" ]; then \
- ts=../bfd/$$ts; \
- fi; \
- if [ "$$ts" != "$(SHLIB)" ]; then \
- rm -f $$ts; \
- ln -s `echo $(SHLIB) | sed -e 's,^\.\./bfd/,,'` $$ts; \
- else true; fi
- rm -f $(SHLINK)
- ln -s `echo $(SHLIB) | sed -e 's,^\.\./bfd/,,'` $(SHLINK)
-
-# This target creates libTARGET-opcodes.so.VERSION as a symlink to
-# libopcodes.so.VERSION. It is used on SunOS, which does not have SONAME.
-stamp-tshlink: $(SHLIB)
- tf=lib`echo $(SHLIB) | sed -e 's,\.\./bfd/,,' -e 's/^lib//' | sed '$(program_transform_name)'`; \
- if [ "$(COMMON_SHLIB)" = "yes" ]; then \
- tf=../bfd/$$tf; \
- fi; \
- if [ "$$tf" != "$(SHLIB)" ]; then \
- rm -f $$tf; \
- ln -s $(SHLIB) $$tf; \
- else true; fi
- if [ "$(COMMON_SHLIB)" = "yes" ]; then \
- tf=lib`echo $(TARGETLIB) | sed -e 's/^lib//' | sed '$(program_transform_name)'`; \
- if [ "$$tf" != "$(TARGETLIB)" ]; then \
- rm -f $$tf; \
- ln -s $(TARGETLIB) $$tf; \
- else true; fi; \
- else true; fi
- touch stamp-tshlink
+distclean-compile:
+ -rm -f *.tab.c
-$(OFILES): stamp-picdir
+maintainer-clean-compile:
-disassemble.o: disassemble.c $(INCDIR)/dis-asm.h
- if [ -n "$(PICFLAG)" ]; then \
- $(CC) -c @archdefs@ $(PICFLAG) $(ALL_CFLAGS) $(srcdir)/disassemble.c -o pic/disassemble.o; \
- else true; fi
- $(CC) -c @archdefs@ $(ALL_CFLAGS) $(srcdir)/disassemble.c
-
-
-tags etags: TAGS
-
-TAGS: force
- etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
-
-MOSTLYCLEAN = *.o core *.E *.p *.ip pic/*.o
-mostlyclean:
- rm -rf $(MOSTLYCLEAN)
-clean:
- rm -f *.a $(MOSTLYCLEAN) $(SHLIB) $(SHLINK) piclist stamp-piclist
-distclean: clean
- rm -rf Makefile config.status TAGS config.cache config.h stamp-h \
- pic stamp-picdir config.log
-clobber realclean maintainer-clean: distclean
-
-# Mark everything as depending on config.status, since the timestamp on
-# sysdep.h might actually move backwards if we reconfig and relink it
-# to a different hosts/h-xxx.h file. This will force a recompile anyway.
-RECONFIG = config.status
-
-# This target should be invoked before building a new release.
-# 'VERSION' file must be present and contain a string of the form "x.y"
-#
-roll:
- @V=`cat VERSION` ; \
- MAJ=`sed 's/\..*//' VERSION` ; \
- MIN=`sed 's/.*\.//' VERSION` ; \
- V=$$MAJ.`expr $$MIN + 1` ; \
- rm -f VERSION ; \
- echo $$V >VERSION ; \
- echo Version $$V
-
-# Dummy target to force execution of dependent targets.
-#
-force:
-
-install: $(ALLLIBS)
- for f in $(ALLLIBS); do \
- if [ "$$f" = "stamp-tshlink" ]; then \
- continue; \
- fi; \
- tf=lib`echo $$f | sed -e 's,^\.\./bfd/,,' -e 's/^lib//' | sed '$(program_transform_name)'`; \
- rm -f $(libdir)/$$tf; \
- if [ "$$f" = "$(SHLINK)" ]; then \
- ts=lib`echo $(SHLIB) | sed -e 's,^\.\./bfd/,,' -e 's/^lib//' | sed '$(program_transform_name)'`; \
- ln -s $$ts $(libdir)/$$tf; \
- elif [ "$$f" = "$(SHLIB)" ]; then \
- @INSTALL_SHLIB@ \
- else \
- $(INSTALL_DATA) $$f $(libdir)/$$tf; \
- $(RANLIB) $(libdir)/$$tf; \
- chmod a-x $(libdir)/$$tf; \
- fi; \
- done
+.c.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
-Makefile: Makefile.in config.status
- CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
+maintainer-clean-libtool:
-config.h: stamp-h ; @true
-stamp-h: config.in config.status
- CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
+mostlyclean-libLTLIBRARIES:
-config.status: configure $(srcdir)/../bfd/configure.host $(srcdir)/../bfd/config.bfd $(srcdir)/../bfd/VERSION
- $(SHELL) config.status --recheck
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-stamp-picdir:
- if [ -n "$(PICFLAG)" ] && [ ! -d pic ]; then \
- mkdir pic; \
+distclean-libLTLIBRARIES:
+
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(libdir)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo "$(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ $(NORMAL_UNINSTALL)
+ list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$$p; \
+ done
+
+libopcodes.la: $(libopcodes_la_OBJECTS) $(libopcodes_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(libopcodes_la_LDFLAGS) $(libopcodes_la_OBJECTS) $(libopcodes_la_LIBADD) $(LIBS)
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) \
+ && $(MAKE) dvi \
+ && $(MAKE) check \
+ && $(MAKE) install \
+ && $(MAKE) installcheck \
+ && $(MAKE) dist
+ -rm -rf $(distdir)
+ @echo "========================"; \
+ echo "$(distdir).tar.gz is ready for distribution"; \
+ echo "========================"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done
+info:
+dvi:
+check:
+ $(MAKE)
+installcheck:
+install-info:
+install-exec: install-libLTLIBRARIES
+ @$(NORMAL_INSTALL)
+
+install-data:
+ @$(NORMAL_INSTALL)
+
+install: install-exec install-data all
+ @:
+
+uninstall: uninstall-libLTLIBRARIES
+
+all: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
+
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs:
+ $(mkinstalldirs) $(libdir)
+
+
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean: mostlyclean-hdr mostlyclean-noinstLIBRARIES \
+ mostlyclean-compile mostlyclean-libtool \
+ mostlyclean-libLTLIBRARIES mostlyclean-tags \
+ mostlyclean-generic
+
+clean: clean-hdr clean-noinstLIBRARIES clean-compile clean-libtool \
+ clean-libLTLIBRARIES clean-tags clean-generic \
+ mostlyclean
+
+distclean: distclean-hdr distclean-noinstLIBRARIES distclean-compile \
+ distclean-libtool distclean-libLTLIBRARIES \
+ distclean-tags distclean-generic clean
+ -rm -f config.status
+ -rm -f libtool
+
+maintainer-clean: maintainer-clean-hdr maintainer-clean-noinstLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-libLTLIBRARIES maintainer-clean-tags \
+ maintainer-clean-generic distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f config.status
+
+.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
+maintainer-clean-hdr mostlyclean-noinstLIBRARIES \
+distclean-noinstLIBRARIES clean-noinstLIBRARIES \
+maintainer-clean-noinstLIBRARIES mostlyclean-compile distclean-compile \
+clean-compile maintainer-clean-compile mostlyclean-libtool \
+distclean-libtool clean-libtool maintainer-clean-libtool \
+mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES tags mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
+installcheck install-info install-exec install-data install uninstall \
+all installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+disassemble.lo: disassemble.c $(INCDIR)/dis-asm.h
+ $(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $(srcdir)/disassemble.c
+
+stamp-lib: libopcodes.la
+ if [ -f .libs/libopcodes.a ]; then \
+ cp .libs/libopcodes.a libopcodes.tmp; \
+ $(SHELL) $(srcdir)/../move-if-change libopcodes.tmp libopcodes.a; \
else true; fi
- touch stamp-picdir
+ touch stamp-lib
+
+libopcodes.a: stamp-lib ; @true
# This dependency stuff is copied from BFD.
@@ -355,7 +512,7 @@ stamp-picdir:
rm -f .dep2 .dep2a
echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
echo > .dep2a
- $(DEP) -f .dep2a $(ALL_CFLAGS) $?
+ $(DEP) -f .dep2a $(INCLUDES) $(CFLAGS) $?
sed -e '/DO NOT DELETE/d' -e '/^$$/d' < .dep2a >> .dep2
rm -f .dep2a
$(srcdir)/../move-if-change .dep2 .dep1
@@ -377,80 +534,92 @@ dep-in: .dep
cat .dep >> tmp-Makefile.in
$(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
-.PHONY: dep dep-in
+dep-am: .dep
+ sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
+ cat .dep >> tmp-Makefile.am
+ $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
+
+.PHONY: dep dep-in dep-am
# What appears below is generated by a hacked mkdep using gcc -MM.
# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-a29k-dis.o: a29k-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+a29k-dis.lo: a29k-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
$(INCDIR)/ansidecl.h $(INCDIR)/opcode/a29k.h
-alpha-dis.o: alpha-dis.c $(INCDIR)/ansidecl.h sysdep.h \
+alpha-dis.lo: alpha-dis.c $(INCDIR)/ansidecl.h sysdep.h \
config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/opcode/alpha.h
-alpha-opc.o: alpha-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/alpha.h \
+alpha-opc.lo: alpha-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/alpha.h \
$(BFD_H)
-arm-dis.o: arm-dis.c $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h \
- arm-opc.h
-cgen-asm.o: cgen-asm.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/libiberty.h $(BFD_H) $(INCDIR)/opcode/cgen.h
-cgen-dis.o: cgen-dis.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/libiberty.h $(BFD_H) $(INCDIR)/opcode/cgen.h
-cgen-opc.o: cgen-opc.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/libiberty.h $(BFD_H) $(INCDIR)/opcode/cgen.h
-d10v-dis.o: d10v-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/d10v.h \
+arm-dis.lo: arm-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h arm-opc.h $(INCDIR)/coff/internal.h \
+ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+cgen-asm.lo: cgen-asm.c sysdep.h config.h $(INCDIR)/libiberty.h \
+ $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h
+cgen-dis.lo: cgen-dis.c sysdep.h config.h $(INCDIR)/libiberty.h \
+ $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h
+cgen-opc.lo: cgen-opc.c sysdep.h config.h $(INCDIR)/libiberty.h \
+ $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen.h
+d10v-dis.lo: d10v-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/d10v.h \
$(INCDIR)/dis-asm.h $(BFD_H)
-d10v-opc.o: d10v-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/d10v.h
-dis-buf.o: dis-buf.c sysdep.h config.h $(INCDIR)/dis-asm.h \
- $(BFD_H)
-disassemble.o: disassemble.c $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h \
+d10v-opc.lo: d10v-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/d10v.h
+dis-buf.lo: dis-buf.c sysdep.h config.h $(INCDIR)/dis-asm.h \
$(BFD_H)
-h8300-dis.o: h8300-dis.c $(INCDIR)/opcode/h8300.h $(INCDIR)/dis-asm.h \
- $(BFD_H) $(INCDIR)/ansidecl.h
-h8500-dis.o: h8500-dis.c h8500-opc.h $(INCDIR)/dis-asm.h \
+disassemble.lo: disassemble.c $(INCDIR)/ansidecl.h \
+ $(INCDIR)/dis-asm.h $(BFD_H)
+h8300-dis.lo: h8300-dis.c $(INCDIR)/opcode/h8300.h \
+ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h
+h8500-dis.lo: h8500-dis.c h8500-opc.h $(INCDIR)/dis-asm.h \
$(BFD_H) $(INCDIR)/ansidecl.h
-hppa-dis.o: hppa-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+hppa-dis.lo: hppa-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
$(BFD_H) $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h
-i386-dis.o: i386-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+i386-dis.lo: i386-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
$(INCDIR)/ansidecl.h sysdep.h config.h
-i960-dis.o: i960-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+i960-dis.lo: i960-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
$(INCDIR)/ansidecl.h
-m32r-asm.o: m32r-asm.c $(INCDIR)/ansidecl.h $(BFD_H) \
- m32r-opc.h $(INCDIR)/opcode/cgen.h
-m32r-dis.o: m32r-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h \
- $(BFD_H) m32r-opc.h $(INCDIR)/opcode/cgen.h
-m32r-opc.o: m32r-opc.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/libiberty.h $(BFD_H) m32r-opc.h $(INCDIR)/opcode/cgen.h
-m68k-dis.o: m68k-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+m32r-asm.lo: m32r-asm.c sysdep.h config.h $(BFD_H) \
+ $(INCDIR)/symcat.h m32r-opc.h $(INCDIR)/opcode/cgen.h
+m32r-dis.lo: m32r-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+ $(BFD_H) $(INCDIR)/symcat.h m32r-opc.h $(INCDIR)/opcode/cgen.h
+m32r-opc.lo: m32r-opc.c sysdep.h config.h $(INCDIR)/libiberty.h \
+ $(BFD_H) $(INCDIR)/symcat.h m32r-opc.h $(INCDIR)/opcode/cgen.h
+m68k-dis.lo: m68k-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
$(INCDIR)/ansidecl.h $(INCDIR)/floatformat.h $(INCDIR)/opcode/m68k.h
-m68k-opc.o: m68k-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/m68k.h
-m88k-dis.o: m88k-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+m68k-opc.lo: m68k-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/m68k.h
+m88k-dis.lo: m88k-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
$(INCDIR)/ansidecl.h $(INCDIR)/opcode/m88k.h
-mips-dis.o: mips-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+mips-dis.lo: mips-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
$(BFD_H) $(INCDIR)/opcode/mips.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h
-mips-opc.o: mips-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mips.h
-mips16-opc.o: mips16-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mips.h
-m10200-dis.o: m10200-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10200.h \
+mips-opc.lo: mips-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mips.h
+mips16-opc.lo: mips16-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mips.h
+m10200-dis.lo: m10200-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10200.h \
$(INCDIR)/dis-asm.h $(BFD_H)
-m10200-opc.o: m10200-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10200.h
-m10300-dis.o: m10300-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10300.h \
+m10200-opc.lo: m10200-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10200.h
+m10300-dis.lo: m10300-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10300.h \
$(INCDIR)/dis-asm.h $(BFD_H)
-m10300-opc.o: m10300-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10300.h
-ns32k-dis.o: ns32k-dis.c $(BFD_H) $(INCDIR)/ansidecl.h \
+m10300-opc.lo: m10300-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/mn10300.h
+ns32k-dis.lo: ns32k-dis.c $(BFD_H) $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/dis-asm.h $(INCDIR)/opcode/ns32k.h
-ppc-dis.o: ppc-dis.c $(INCDIR)/ansidecl.h sysdep.h \
+ppc-dis.lo: ppc-dis.c $(INCDIR)/ansidecl.h sysdep.h \
config.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/opcode/ppc.h
-ppc-opc.o: ppc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/ppc.h
-sh-dis.o: sh-dis.c sh-opc.h $(INCDIR)/dis-asm.h $(BFD_H) \
+ppc-opc.lo: ppc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/ppc.h
+sh-dis.lo: sh-dis.c sh-opc.h $(INCDIR)/dis-asm.h $(BFD_H) \
$(INCDIR)/ansidecl.h
-sparc-dis.o: sparc-dis.c $(INCDIR)/ansidecl.h sysdep.h \
+sparc-dis.lo: sparc-dis.c $(INCDIR)/ansidecl.h sysdep.h \
config.h $(INCDIR)/opcode/sparc.h $(INCDIR)/dis-asm.h \
$(BFD_H) $(INCDIR)/libiberty.h
-sparc-opc.o: sparc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/sparc.h
-w65-dis.o: w65-dis.c w65-opc.h $(INCDIR)/dis-asm.h \
+sparc-opc.lo: sparc-opc.c $(INCDIR)/ansidecl.h $(INCDIR)/opcode/sparc.h
+tic30-dis.lo: tic30-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
+ $(INCDIR)/ansidecl.h $(INCDIR)/opcode/tic30.h
+w65-dis.lo: w65-dis.c w65-opc.h $(INCDIR)/dis-asm.h \
$(BFD_H) $(INCDIR)/ansidecl.h
-z8k-dis.o: z8k-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
+z8k-dis.lo: z8k-dis.c sysdep.h config.h $(INCDIR)/dis-asm.h \
$(BFD_H) z8k-opc.h
-z8kgen.o: z8kgen.c sysdep.h config.h
+z8kgen.lo: z8kgen.c sysdep.h config.h
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/binutils/opcodes/acconfig.h b/contrib/binutils/opcodes/acconfig.h
new file mode 100644
index 0000000..ef2f496
--- /dev/null
+++ b/contrib/binutils/opcodes/acconfig.h
@@ -0,0 +1,6 @@
+
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
diff --git a/contrib/binutils/opcodes/acinclude.m4 b/contrib/binutils/opcodes/acinclude.m4
new file mode 100644
index 0000000..71b09b9
--- /dev/null
+++ b/contrib/binutils/opcodes/acinclude.m4
@@ -0,0 +1 @@
+sinclude(../bfd/acinclude.m4)
diff --git a/contrib/binutils/opcodes/aclocal.m4 b/contrib/binutils/opcodes/aclocal.m4
index 7adc004..ea7ce9b 100644
--- a/contrib/binutils/opcodes/aclocal.m4
+++ b/contrib/binutils/opcodes/aclocal.m4
@@ -1 +1,460 @@
-sinclude(../bfd/aclocal.m4)
+dnl aclocal.m4 generated automatically by aclocal 1.2e
+
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+sinclude(../bfd/acinclude.m4)
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AM_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+
+# serial 1
+
+AC_DEFUN(AM_PROG_INSTALL,
+[AC_REQUIRE([AC_PROG_INSTALL])
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+AC_SUBST(INSTALL_SCRIPT)dnl
+])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+
+# serial 24 AM_PROG_LIBTOOL
+AC_DEFUN(AM_PROG_LIBTOOL,
+[AC_REQUIRE([AM_ENABLE_SHARED])dnl
+AC_REQUIRE([AM_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_RANLIB])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AM_PROG_LD])dnl
+AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+dnl
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+])
+
+# AM_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_SHARED,
+[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
+changequote([, ])dnl
+[ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AM_DISABLE_SHARED,
+[AM_ENABLE_SHARED(no)])
+
+# AM_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AM_DISABLE_STATIC,
+[AM_ENABLE_STATIC(no)])
+
+# AM_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_STATIC,
+[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
+changequote([, ])dnl
+[ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+])
+
+
+# AM_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AM_PROG_LD,
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+changequote(,)dnl
+ /* | [A-Za-z]:\\*)
+changequote([,])dnl
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(ac_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_SUBST(LD)
+AM_PROG_LD_GNU
+])
+
+AC_DEFUN(AM_PROG_LD_GNU,
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi])
+])
+
+# AM_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AM_PROG_NM,
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(ac_cv_path_NM,
+[case "$NM" in
+changequote(,)dnl
+/* | [A-Za-z]:\\*)
+changequote([,])dnl
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac])
+NM="$ac_cv_path_NM"
+AC_MSG_RESULT([$NM])
+AC_SUBST(NM)
+])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT($USE_MAINTAINER_MODE)
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+ AC_SUBST(MAINT)dnl
+]
+)
+
+# Check to see if we're running under Cygwin32, without using
+# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_CYGWIN32()
+AC_DEFUN(AM_CYGWIN32,
+[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
+[AC_TRY_COMPILE(,[return __CYGWIN32__;],
+am_cv_cygwin32=yes, am_cv_cygwin32=no)
+rm -f conftest*])
+CYGWIN32=
+test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
+
+# Check to see if we're running under Win32, without using
+# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
+# Otherwise set it to "".
+
+dnl AM_EXEEXT()
+dnl This knows we add .exe if we're building in the Cygwin32
+dnl environment. But if we're not, then it compiles a test program
+dnl to see if there is a suffix for executables.
+AC_DEFUN(AM_EXEEXT,
+[AC_REQUIRE([AM_CYGWIN32])
+AC_REQUIRE([AM_MINGW32])
+AC_MSG_CHECKING([for executable suffix])
+AC_CACHE_VAL(am_cv_exeext,
+[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*])
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+AC_MSG_RESULT(${am_cv_exeext})
+AC_SUBST(EXEEXT)])
+
+# Check to see if we're running under Mingw, without using
+# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_MINGW32()
+AC_DEFUN(AM_MINGW32,
+[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
+[AC_TRY_COMPILE(,[return __MINGW32__;],
+am_cv_mingw32=yes, am_cv_mingw32=no)
+rm -f conftest*])
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes])
+
diff --git a/contrib/binutils/opcodes/alpha-opc.c b/contrib/binutils/opcodes/alpha-opc.c
index cf836b2..46b7223 100644
--- a/contrib/binutils/opcodes/alpha-opc.c
+++ b/contrib/binutils/opcodes/alpha-opc.c
@@ -860,8 +860,7 @@ const struct alpha_opcode alpha_opcodes[] = {
{ "mult/um", FP(0x16,0x162), BASE, ARG_FP },
{ "divt/um", FP(0x16,0x163), BASE, ARG_FP },
{ "cvtts/um", FP(0x16,0x16C), BASE, ARG_FPZ1 },
- { "cvttq/um", FP(0x16,0x16F), BASE, ARG_FPZ1 },
- { "cvtqs/um", FP(0x16,0x17C), BASE, ARG_FPZ1 },
+ { "cvttq/vm", FP(0x16,0x16F), BASE, ARG_FPZ1 },
{ "adds/u", FP(0x16,0x180), BASE, ARG_FP },
{ "subs/u", FP(0x16,0x181), BASE, ARG_FP },
{ "muls/u", FP(0x16,0x182), BASE, ARG_FP },
@@ -881,7 +880,7 @@ const struct alpha_opcode alpha_opcodes[] = {
{ "mult/ud", FP(0x16,0x1E2), BASE, ARG_FP },
{ "divt/ud", FP(0x16,0x1E3), BASE, ARG_FP },
{ "cvtts/ud", FP(0x16,0x1EC), BASE, ARG_FPZ1 },
- { "cvttq/ud", FP(0x16,0x1EF), BASE, ARG_FPZ1 },
+ { "cvttq/vd", FP(0x16,0x1EF), BASE, ARG_FPZ1 },
{ "cvtst", FP(0x16,0x2AC), BASE, ARG_FPZ1 },
{ "adds/suc", FP(0x16,0x500), BASE, ARG_FP },
{ "subs/suc", FP(0x16,0x501), BASE, ARG_FP },
@@ -902,8 +901,7 @@ const struct alpha_opcode alpha_opcodes[] = {
{ "mult/sum", FP(0x16,0x562), BASE, ARG_FP },
{ "divt/sum", FP(0x16,0x563), BASE, ARG_FP },
{ "cvtts/sum", FP(0x16,0x56C), BASE, ARG_FPZ1 },
- { "cvttq/sum", FP(0x16,0x56F), BASE, ARG_FPZ1 },
- { "cvtqs/sum", FP(0x16,0x57C), BASE, ARG_FPZ1 },
+ { "cvttq/svm", FP(0x16,0x56F), BASE, ARG_FPZ1 },
{ "adds/su", FP(0x16,0x580), BASE, ARG_FP },
{ "negs/su", FP(0x16,0x581), BASE, ARG_FPZ1 }, /* pseudo */
{ "subs/su", FP(0x16,0x581), BASE, ARG_FP },
@@ -929,7 +927,7 @@ const struct alpha_opcode alpha_opcodes[] = {
{ "mult/sud", FP(0x16,0x5E2), BASE, ARG_FP },
{ "divt/sud", FP(0x16,0x5E3), BASE, ARG_FP },
{ "cvtts/sud", FP(0x16,0x5EC), BASE, ARG_FPZ1 },
- { "cvttq/sud", FP(0x16,0x5EF), BASE, ARG_FPZ1 },
+ { "cvttq/svd", FP(0x16,0x5EF), BASE, ARG_FPZ1 },
{ "cvtst/s", FP(0x16,0x6AC), BASE, ARG_FPZ1 },
{ "adds/suic", FP(0x16,0x700), BASE, ARG_FP },
{ "subs/suic", FP(0x16,0x701), BASE, ARG_FP },
@@ -952,7 +950,7 @@ const struct alpha_opcode alpha_opcodes[] = {
{ "mult/suim", FP(0x16,0x762), BASE, ARG_FP },
{ "divt/suim", FP(0x16,0x763), BASE, ARG_FP },
{ "cvtts/suim", FP(0x16,0x76C), BASE, ARG_FPZ1 },
- { "cvttq/suim", FP(0x16,0x76F), BASE, ARG_FPZ1 },
+ { "cvttq/svim", FP(0x16,0x76F), BASE, ARG_FPZ1 },
{ "cvtqs/suim", FP(0x16,0x77C), BASE, ARG_FPZ1 },
{ "cvtqt/suim", FP(0x16,0x77E), BASE, ARG_FPZ1 },
{ "adds/sui", FP(0x16,0x780), BASE, ARG_FP },
@@ -978,7 +976,7 @@ const struct alpha_opcode alpha_opcodes[] = {
{ "mult/suid", FP(0x16,0x7E2), BASE, ARG_FP },
{ "divt/suid", FP(0x16,0x7E3), BASE, ARG_FP },
{ "cvtts/suid", FP(0x16,0x7EC), BASE, ARG_FPZ1 },
- { "cvttq/suid", FP(0x16,0x7EF), BASE, ARG_FPZ1 },
+ { "cvttq/svid", FP(0x16,0x7EF), BASE, ARG_FPZ1 },
{ "cvtqs/suid", FP(0x16,0x7FC), BASE, ARG_FPZ1 },
{ "cvtqt/suid", FP(0x16,0x7FE), BASE, ARG_FPZ1 },
@@ -1268,7 +1266,7 @@ const struct alpha_opcode alpha_opcodes[] = {
{ "pal1d", PCD(0x1D), BASE, ARG_PCD },
{ "hw_rei", SPCD(0x1E,0x3FF8000), EV4|EV5, ARG_NONE },
- { "hw_rei_stBASE", SPCD(0x1E,0x3FFC000), EV5, ARG_NONE },
+ { "hw_rei_stall", SPCD(0x1E,0x3FFC000), EV5, ARG_NONE },
{ "pal1e", PCD(0x1E), BASE, ARG_PCD },
{ "hw_stl", EV4HWMEM(0x1F,0x0), EV4, ARG_EV4HWMEM },
diff --git a/contrib/binutils/opcodes/arc-dis.c b/contrib/binutils/opcodes/arc-dis.c
new file mode 100644
index 0000000..3a597aa
--- /dev/null
+++ b/contrib/binutils/opcodes/arc-dis.c
@@ -0,0 +1,266 @@
+/* Instruction printing code for the ARC.
+ Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
+ Contributed by Doug Evans (dje@cygnus.com).
+
+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 "dis-asm.h"
+#include "opcode/arc.h"
+#include "elf-bfd.h"
+#include "elf/arc.h"
+
+static int print_insn_arc_base_little PARAMS ((bfd_vma, disassemble_info *));
+static int print_insn_arc_base_big PARAMS ((bfd_vma, disassemble_info *));
+
+static int print_insn PARAMS ((bfd_vma, disassemble_info *, int, int));
+
+/* Print one instruction from PC on INFO->STREAM.
+ Return the size of the instruction (4 or 8 for the ARC). */
+
+static int
+print_insn (pc, info, mach, big_p)
+ bfd_vma pc;
+ disassemble_info *info;
+ int mach;
+ int big_p;
+{
+ const struct arc_opcode *opcode;
+ bfd_byte buffer[4];
+ void *stream = info->stream;
+ fprintf_ftype func = info->fprintf_func;
+ int status;
+ /* First element is insn, second element is limm (if present). */
+ arc_insn insn[2];
+ int got_limm_p = 0;
+ static int initialized = 0;
+ static int current_mach = 0;
+
+ if (!initialized || mach != current_mach)
+ {
+ initialized = 1;
+ current_mach = arc_get_opcode_mach (mach, big_p);
+ arc_opcode_init_tables (current_mach);
+ }
+
+ status = (*info->read_memory_func) (pc, buffer, 4, info);
+ if (status != 0)
+ {
+ (*info->memory_error_func) (status, pc, info);
+ return -1;
+ }
+ if (big_p)
+ insn[0] = bfd_getb32 (buffer);
+ else
+ insn[0] = bfd_getl32 (buffer);
+
+ (*func) (stream, "%08lx\t", insn[0]);
+
+ /* The instructions are stored in lists hashed by the insn code
+ (though we needn't care how they're hashed). */
+
+ opcode = arc_opcode_lookup_dis (insn[0]);
+ for ( ; opcode != NULL; opcode = ARC_OPCODE_NEXT_DIS (opcode))
+ {
+ char *syn;
+ int mods,invalid;
+ long value;
+ const struct arc_operand *operand;
+ const struct arc_operand_value *opval;
+
+ /* Basic bit mask must be correct. */
+ if ((insn[0] & opcode->mask) != opcode->value)
+ continue;
+
+ /* Supported by this cpu? */
+ if (! arc_opcode_supported (opcode))
+ continue;
+
+ /* Make two passes over the operands. First see if any of them
+ have extraction functions, and, if they do, make sure the
+ instruction is valid. */
+
+ arc_opcode_init_extract ();
+ invalid = 0;
+
+ /* ??? Granted, this is slower than the `ppc' way. Maybe when this is
+ done it'll be clear what the right way to do this is. */
+ /* Instructions like "add.f r0,r1,1" are tricky because the ".f" gets
+ printed first, but we don't know how to print it until we've processed
+ the regs. Since we're scanning all the args before printing the insn
+ anyways, it's actually quite easy. */
+
+ for (syn = opcode->syntax; *syn; ++syn)
+ {
+ int c;
+
+ if (*syn != '%' || *++syn == '%')
+ continue;
+ mods = 0;
+ c = *syn;
+ while (ARC_MOD_P (arc_operands[arc_operand_map[c]].flags))
+ {
+ mods |= arc_operands[arc_operand_map[c]].flags & ARC_MOD_BITS;
+ ++syn;
+ c = *syn;
+ }
+ operand = arc_operands + arc_operand_map[c];
+ if (operand->extract)
+ (*operand->extract) (insn, operand, mods,
+ (const struct arc_operand_value **) NULL,
+ &invalid);
+ }
+ if (invalid)
+ continue;
+
+ /* The instruction is valid. */
+
+ /* If we have an insn with a limm, fetch it now. Scanning the insns
+ twice lets us do this. */
+ if (arc_opcode_limm_p (NULL))
+ {
+ status = (*info->read_memory_func) (pc + 4, buffer, 4, info);
+ if (status != 0)
+ {
+ (*info->memory_error_func) (status, pc, info);
+ return -1;
+ }
+ if (big_p)
+ insn[1] = bfd_getb32 (buffer);
+ else
+ insn[1] = bfd_getl32 (buffer);
+ got_limm_p = 1;
+ }
+
+ for (syn = opcode->syntax; *syn; ++syn)
+ {
+ int c;
+
+ if (*syn != '%' || *++syn == '%')
+ {
+ (*func) (stream, "%c", *syn);
+ continue;
+ }
+
+ /* We have an operand. Fetch any special modifiers. */
+ mods = 0;
+ c = *syn;
+ while (ARC_MOD_P (arc_operands[arc_operand_map[c]].flags))
+ {
+ mods |= arc_operands[arc_operand_map[c]].flags & ARC_MOD_BITS;
+ ++syn;
+ c = *syn;
+ }
+ operand = arc_operands + arc_operand_map[c];
+
+ /* Extract the value from the instruction. */
+ opval = NULL;
+ if (operand->extract)
+ {
+ value = (*operand->extract) (insn, operand, mods,
+ &opval, (int *) NULL);
+ }
+ else
+ {
+ value = (insn[0] >> operand->shift) & ((1 << operand->bits) - 1);
+ if ((operand->flags & ARC_OPERAND_SIGNED)
+ && (value & (1 << (operand->bits - 1))))
+ value -= 1 << operand->bits;
+
+ /* If this is a suffix operand, set `opval'. */
+ if (operand->flags & ARC_OPERAND_SUFFIX)
+ opval = arc_opcode_lookup_suffix (operand, value);
+ }
+
+ /* Print the operand as directed by the flags. */
+ if (operand->flags & ARC_OPERAND_FAKE)
+ ; /* nothing to do (??? at least not yet) */
+ else if (operand->flags & ARC_OPERAND_SUFFIX)
+ {
+ /* Default suffixes aren't printed. Fortunately, they all have
+ zero values. Also, zero values for boolean suffixes are
+ represented by the absence of text. */
+
+ if (value != 0)
+ {
+ /* ??? OPVAL should have a value. If it doesn't just cope
+ as we want disassembly to be reasonably robust.
+ Also remember that several condition code values (16-31)
+ aren't defined yet. For these cases just print the
+ number suitably decorated. */
+ if (opval)
+ (*func) (stream, "%s%s",
+ mods & ARC_MOD_DOT ? "." : "",
+ opval->name);
+ else
+ (*func) (stream, "%s%c%d",
+ mods & ARC_MOD_DOT ? "." : "",
+ operand->fmt, value);
+ }
+ }
+ else if (operand->flags & ARC_OPERAND_RELATIVE_BRANCH)
+ (*info->print_address_func) (pc + 4 + value, info);
+ /* ??? Not all cases of this are currently caught. */
+ else if (operand->flags & ARC_OPERAND_ABSOLUTE_BRANCH)
+ (*info->print_address_func) ((bfd_vma) value & 0xffffffff, info);
+ else if (operand->flags & ARC_OPERAND_ADDRESS)
+ (*info->print_address_func) ((bfd_vma) value & 0xffffffff, info);
+ else if (opval)
+ /* Note that this case catches both normal and auxiliary regs. */
+ (*func) (stream, "%s", opval->name);
+ else
+ (*func) (stream, "%ld", value);
+ }
+
+ /* We have found and printed an instruction; return. */
+ return got_limm_p ? 8 : 4;
+ }
+
+ (*func) (stream, "*unknown*");
+ return 4;
+}
+
+/* Given MACH, one of bfd_mach_arc_xxx, return the print_insn function to use.
+ This does things a non-standard way (the "standard" way would be to copy
+ this code into disassemble.c). Since there are more than a couple of
+ variants, hiding all this crud here seems cleaner. */
+
+disassembler_ftype
+arc_get_disassembler (mach, big_p)
+ int mach;
+ int big_p;
+{
+ switch (mach)
+ {
+ case bfd_mach_arc_base:
+ return big_p ? print_insn_arc_base_big : print_insn_arc_base_little;
+ }
+ return print_insn_arc_base_little;
+}
+
+static int
+print_insn_arc_base_little (pc, info)
+ bfd_vma pc;
+ disassemble_info *info;
+{
+ return print_insn (pc, info, bfd_mach_arc_base, 0);
+}
+
+static int
+print_insn_arc_base_big (pc, info)
+ bfd_vma pc;
+ disassemble_info *info;
+{
+ return print_insn (pc, info, bfd_mach_arc_base, 1);
+}
diff --git a/contrib/binutils/opcodes/arc-opc.c b/contrib/binutils/opcodes/arc-opc.c
new file mode 100644
index 0000000..5ee928b
--- /dev/null
+++ b/contrib/binutils/opcodes/arc-opc.c
@@ -0,0 +1,1128 @@
+/* Opcode table for the ARC.
+ Copyright 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
+ Contributed by Doug Evans (dje@cygnus.com).
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <stdio.h>
+#include "ansidecl.h"
+#include "opcode/arc.h"
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define INSERT_FN(fn) \
+static arc_insn fn PARAMS ((arc_insn, const struct arc_operand *, \
+ int, const struct arc_operand_value *, long, \
+ const char **))
+#define EXTRACT_FN(fn) \
+static long fn PARAMS ((arc_insn *, const struct arc_operand *, \
+ int, const struct arc_operand_value **, int *))
+
+INSERT_FN (insert_reg);
+INSERT_FN (insert_shimmfinish);
+INSERT_FN (insert_limmfinish);
+INSERT_FN (insert_shimmoffset);
+INSERT_FN (insert_shimmzero);
+INSERT_FN (insert_flag);
+INSERT_FN (insert_flagfinish);
+INSERT_FN (insert_cond);
+INSERT_FN (insert_forcelimm);
+INSERT_FN (insert_reladdr);
+INSERT_FN (insert_absaddr);
+INSERT_FN (insert_unopmacro);
+
+EXTRACT_FN (extract_reg);
+EXTRACT_FN (extract_flag);
+EXTRACT_FN (extract_cond);
+EXTRACT_FN (extract_reladdr);
+EXTRACT_FN (extract_unopmacro);
+
+/* Various types of ARC operands, including insn suffixes. */
+
+/* Insn format values:
+
+ 'a' REGA register A field
+ 'b' REGB register B field
+ 'c' REGC register C field
+ 'S' SHIMMFINISH finish inserting a shimm value
+ 'L' LIMMFINISH finish inserting a limm value
+ 'd' SHIMMOFFSET shimm offset in ld,st insns
+ '0' SHIMMZERO 0 shimm value in ld,st insns
+ 'f' FLAG F flag
+ 'F' FLAGFINISH finish inserting the F flag
+ 'G' FLAGINSN insert F flag in "flag" insn
+ 'n' DELAY N field (nullify field)
+ 'q' COND condition code field
+ 'Q' FORCELIMM set `cond_p' to 1 to ensure a constant is a limm
+ 'B' BRANCH branch address (22 bit pc relative)
+ 'J' JUMP jump address (26 bit absolute)
+ 'z' SIZE1 size field in ld a,[b,c]
+ 'Z' SIZE10 size field in ld a,[b,shimm]
+ 'y' SIZE22 size field in st c,[b,shimm]
+ 'x' SIGN0 sign extend field ld a,[b,c]
+ 'X' SIGN9 sign extend field ld a,[b,shimm]
+ 'w' ADDRESS3 write-back field in ld a,[b,c]
+ 'W' ADDRESS12 write-back field in ld a,[b,shimm]
+ 'v' ADDRESS24 write-back field in st c,[b,shimm]
+ 'e' CACHEBYPASS5 cache bypass in ld a,[b,c]
+ 'E' CACHEBYPASS14 cache bypass in ld a,[b,shimm]
+ 'D' CACHEBYPASS26 cache bypass in st c,[b,shimm]
+ 'U' UNOPMACRO fake operand to copy REGB to REGC for unop macros
+
+ The following modifiers may appear between the % and char (eg: %.f):
+
+ '.' MODDOT '.' prefix must be present
+ 'r' REG generic register value, for register table
+ 'A' AUXREG auxiliary register in lr a,[b], sr c,[b]
+
+ Fields are:
+
+ CHAR BITS SHIFT FLAGS INSERT_FN EXTRACT_FN
+*/
+
+const struct arc_operand arc_operands[] =
+{
+/* place holder (??? not sure if needed) */
+#define UNUSED 0
+ { 0 },
+
+/* register A or shimm/limm indicator */
+#define REGA (UNUSED + 1)
+ { 'a', 6, ARC_SHIFT_REGA, ARC_OPERAND_SIGNED, insert_reg, extract_reg },
+
+/* register B or shimm/limm indicator */
+#define REGB (REGA + 1)
+ { 'b', 6, ARC_SHIFT_REGB, ARC_OPERAND_SIGNED, insert_reg, extract_reg },
+
+/* register C or shimm/limm indicator */
+#define REGC (REGB + 1)
+ { 'c', 6, ARC_SHIFT_REGC, ARC_OPERAND_SIGNED, insert_reg, extract_reg },
+
+/* fake operand used to insert shimm value into most instructions */
+#define SHIMMFINISH (REGC + 1)
+ { 'S', 9, 0, ARC_OPERAND_SIGNED + ARC_OPERAND_FAKE, insert_shimmfinish, 0 },
+
+/* fake operand used to insert limm value into most instructions. */
+#define LIMMFINISH (SHIMMFINISH + 1)
+ { 'L', 32, 32, ARC_OPERAND_ADDRESS + ARC_OPERAND_LIMM + ARC_OPERAND_FAKE, insert_limmfinish, 0 },
+
+/* shimm operand when there is no reg indicator (ld,st) */
+#define SHIMMOFFSET (LIMMFINISH + 1)
+ { 'd', 9, 0, ARC_OPERAND_SIGNED, insert_shimmoffset, 0 },
+
+/* 0 shimm operand for ld,st insns */
+#define SHIMMZERO (SHIMMOFFSET + 1)
+ { '0', 9, 0, ARC_OPERAND_FAKE, insert_shimmzero, 0 },
+
+/* flag update bit (insertion is defered until we know how) */
+#define FLAG (SHIMMZERO + 1)
+ { 'f', 1, 8, ARC_OPERAND_SUFFIX, insert_flag, extract_flag },
+
+/* fake utility operand to finish 'f' suffix handling */
+#define FLAGFINISH (FLAG + 1)
+ { 'F', 1, 8, ARC_OPERAND_FAKE, insert_flagfinish, 0 },
+
+/* fake utility operand to set the 'f' flag for the "flag" insn */
+#define FLAGINSN (FLAGFINISH + 1)
+ { 'G', 1, 8, ARC_OPERAND_FAKE, insert_flag, 0 },
+
+/* branch delay types */
+#define DELAY (FLAGINSN + 1)
+ { 'n', 2, 5, ARC_OPERAND_SUFFIX },
+
+/* conditions */
+#define COND (DELAY + 1)
+ { 'q', 5, 0, ARC_OPERAND_SUFFIX, insert_cond, extract_cond },
+
+/* set `cond_p' to 1 to ensure a constant is treated as a limm */
+#define FORCELIMM (COND + 1)
+ { 'Q', 0, 0, ARC_OPERAND_FAKE, insert_forcelimm },
+
+/* branch address; b, bl, and lp insns */
+#define BRANCH (FORCELIMM + 1)
+ { 'B', 20, 7, ARC_OPERAND_RELATIVE_BRANCH + ARC_OPERAND_SIGNED, insert_reladdr, extract_reladdr },
+
+/* jump address; j insn (this is basically the same as 'L' except that the
+ value is right shifted by 2) */
+#define JUMP (BRANCH + 1)
+ { 'J', 24, 32, ARC_OPERAND_ABSOLUTE_BRANCH + ARC_OPERAND_LIMM + ARC_OPERAND_FAKE, insert_absaddr },
+
+/* size field, stored in bit 1,2 */
+#define SIZE1 (JUMP + 1)
+ { 'z', 2, 1, ARC_OPERAND_SUFFIX },
+
+/* size field, stored in bit 10,11 */
+#define SIZE10 (SIZE1 + 1)
+ { 'Z', 2, 10, ARC_OPERAND_SUFFIX, },
+
+/* size field, stored in bit 22,23 */
+#define SIZE22 (SIZE10 + 1)
+ { 'y', 2, 22, ARC_OPERAND_SUFFIX, },
+
+/* sign extend field, stored in bit 0 */
+#define SIGN0 (SIZE22 + 1)
+ { 'x', 1, 0, ARC_OPERAND_SUFFIX },
+
+/* sign extend field, stored in bit 9 */
+#define SIGN9 (SIGN0 + 1)
+ { 'X', 1, 9, ARC_OPERAND_SUFFIX },
+
+/* address write back, stored in bit 3 */
+#define ADDRESS3 (SIGN9 + 1)
+ { 'w', 1, 3, ARC_OPERAND_SUFFIX },
+
+/* address write back, stored in bit 12 */
+#define ADDRESS12 (ADDRESS3 + 1)
+ { 'W', 1, 12, ARC_OPERAND_SUFFIX },
+
+/* address write back, stored in bit 24 */
+#define ADDRESS24 (ADDRESS12 + 1)
+ { 'v', 1, 24, ARC_OPERAND_SUFFIX },
+
+/* cache bypass, stored in bit 5 */
+#define CACHEBYPASS5 (ADDRESS24 + 1)
+ { 'e', 1, 5, ARC_OPERAND_SUFFIX },
+
+/* cache bypass, stored in bit 14 */
+#define CACHEBYPASS14 (CACHEBYPASS5 + 1)
+ { 'E', 1, 14, ARC_OPERAND_SUFFIX },
+
+/* cache bypass, stored in bit 26 */
+#define CACHEBYPASS26 (CACHEBYPASS14 + 1)
+ { 'D', 1, 26, ARC_OPERAND_SUFFIX },
+
+/* unop macro, used to copy REGB to REGC */
+#define UNOPMACRO (CACHEBYPASS26 + 1)
+ { 'U', 6, ARC_SHIFT_REGC, ARC_OPERAND_FAKE, insert_unopmacro, extract_unopmacro },
+
+/* '.' modifier ('.' required). */
+#define MODDOT (UNOPMACRO + 1)
+ { '.', 1, 0, ARC_MOD_DOT },
+
+/* Dummy 'r' modifier for the register table.
+ It's called a "dummy" because there's no point in inserting an 'r' into all
+ the %a/%b/%c occurrences in the insn table. */
+#define REG (MODDOT + 1)
+ { 'r', 6, 0, ARC_MOD_REG },
+
+/* Known auxiliary register modifier (stored in shimm field). */
+#define AUXREG (REG + 1)
+ { 'A', 9, 0, ARC_MOD_AUXREG },
+
+/* end of list place holder */
+ { 0 }
+};
+
+/* Given a format letter, yields the index into `arc_operands'.
+ eg: arc_operand_map['a'] = REGA. */
+unsigned char arc_operand_map[256];
+
+#define I(x) (((x) & 31) << 27)
+#define A(x) (((x) & ARC_MASK_REG) << ARC_SHIFT_REGA)
+#define B(x) (((x) & ARC_MASK_REG) << ARC_SHIFT_REGB)
+#define C(x) (((x) & ARC_MASK_REG) << ARC_SHIFT_REGC)
+#define R(x,b,m) (((x) & (m)) << (b)) /* value X, mask M, at bit B */
+
+/* ARC instructions.
+
+ Longer versions of insns must appear before shorter ones (if gas sees
+ "lsr r2,r3,1" when it's parsing "lsr %a,%b" it will think the ",1" is
+ junk). This isn't necessary for `ld' because of the trailing ']'.
+
+ Instructions that are really macros based on other insns must appear
+ before the real insn so they're chosen when disassembling. Eg: The `mov'
+ insn is really the `and' insn.
+
+ This table is best viewed on a wide screen (161 columns). I'd prefer to
+ keep it this way. The rest of the file, however, should be viewable on an
+ 80 column terminal. */
+
+/* ??? This table also includes macros: asl, lsl, and mov. The ppc port has
+ a more general facility for dealing with macros which could be used if
+ we need to. */
+
+/* This table can't be `const' because members `next_asm' and `next_dis' are
+ computed at run-time. We could split this into two, but that doesn't seem
+ worth it. */
+
+struct arc_opcode arc_opcodes[] = {
+
+ /* Macros appear first. */
+ /* "mov" is really an "and". */
+ { "mov%.q%.f %a,%b%F%S%L%U", I(-1), I(12) },
+ /* "asl" is really an "add". */
+ { "asl%.q%.f %a,%b%F%S%L%U", I(-1), I(8) },
+ /* "lsl" is really an "add". */
+ { "lsl%.q%.f %a,%b%F%S%L%U", I(-1), I(8) },
+ /* "nop" is really an "xor". */
+ { "nop", 0xffffffff, 0x7fffffff },
+ /* "rlc" is really an "adc". */
+ { "rlc%.q%.f %a,%b%F%S%L%U", I(-1), I(9) },
+
+ /* The rest of these needn't be sorted, but it helps to find them if they are. */
+ { "adc%.q%.f %a,%b,%c%F%S%L", I(-1), I(9) },
+ { "add%.q%.f %a,%b,%c%F%S%L", I(-1), I(8) },
+ { "and%.q%.f %a,%b,%c%F%S%L", I(-1), I(12) },
+ { "asr%.q%.f %a,%b%F%S%L", I(-1)+C(-1), I(3)+C(1) },
+ { "bic%.q%.f %a,%b,%c%F%S%L", I(-1), I(14) },
+ { "b%q%.n %B", I(-1), I(4), ARC_OPCODE_COND_BRANCH },
+ { "bl%q%.n %B", I(-1), I(5), ARC_OPCODE_COND_BRANCH },
+ { "extb%.q%.f %a,%b%F%S%L", I(-1)+C(-1), I(3)+C(7) },
+ { "extw%.q%.f %a,%b%F%S%L", I(-1)+C(-1), I(3)+C(8) },
+ { "flag%.q %b%G%S%L", I(-1)+A(-1)+C(-1), I(3)+A(ARC_REG_SHIMM_UPDATE)+C(0) },
+ /* %Q: force cond_p=1 --> no shimm values */
+ /* ??? This insn allows an optional flags spec. */
+ { "j%q%Q%.n%.f %b%J", I(-1)+A(-1)+C(-1)+R(-1,7,1), I(7)+A(0)+C(0)+R(0,7,1) },
+ /* Put opcode 1 ld insns first so shimm gets prefered over limm. */
+ /* "[%b]" is before "[%b,%d]" so 0 offsets don't get printed. */
+ { "ld%Z%.X%.W%.E %0%a,[%b]%L", I(-1)+R(-1,13,1)+R(-1,0,511), I(1)+R(0,13,1)+R(0,0,511) },
+ { "ld%Z%.X%.W%.E %a,[%b,%d]%S%L", I(-1)+R(-1,13,1), I(1)+R(0,13,1) },
+ { "ld%z%.x%.w%.e%Q %a,[%b,%c]%L", I(-1)+R(-1,4,1)+R(-1,6,7), I(0)+R(0,4,1)+R(0,6,7) },
+ { "lp%q%.n %B", I(-1), I(6), },
+ { "lr %a,[%Ab]%S%L", I(-1)+C(-1), I(1)+C(0x10) },
+ { "lsr%.q%.f %a,%b%F%S%L", I(-1)+C(-1), I(3)+C(2) },
+ { "or%.q%.f %a,%b,%c%F%S%L", I(-1), I(13) },
+ { "ror%.q%.f %a,%b%F%S%L", I(-1)+C(-1), I(3)+C(3) },
+ { "rrc%.q%.f %a,%b%F%S%L", I(-1)+C(-1), I(3)+C(4) },
+ { "sbc%.q%.f %a,%b,%c%F%S%L", I(-1), I(11) },
+ { "sexb%.q%.f %a,%b%F%S%L", I(-1)+C(-1), I(3)+C(5) },
+ { "sexw%.q%.f %a,%b%F%S%L", I(-1)+C(-1), I(3)+C(6) },
+ { "sr %c,[%Ab]%S%L", I(-1)+A(-1), I(2)+A(0x10) },
+ /* "[%b]" is before "[%b,%d]" so 0 offsets don't get printed. */
+ { "st%y%.v%.D%Q %0%c,[%b]%L", I(-1)+R(-1,25,1)+R(-1,21,1)+R(-1,0,511), I(2)+R(0,25,1)+R(0,21,1)+R(0,0,511) },
+ { "st%y%.v%.D %c,[%b,%d]%S%L", I(-1)+R(-1,25,1)+R(-1,21,1), I(2)+R(0,25,1)+R(0,21,1) },
+ { "sub%.q%.f %a,%b,%c%F%S%L", I(-1), I(10) },
+ { "xor%.q%.f %a,%b,%c%F%S%L", I(-1), I(15) }
+};
+const int arc_opcodes_count = sizeof (arc_opcodes) / sizeof (arc_opcodes[0]);
+
+const struct arc_operand_value arc_reg_names[] =
+{
+ /* Sort this so that the first 61 entries are sequential.
+ IE: For each i (i<61), arc_reg_names[i].value == i. */
+
+ { "r0", 0, REG }, { "r1", 1, REG }, { "r2", 2, REG }, { "r3", 3, REG },
+ { "r4", 4, REG }, { "r5", 5, REG }, { "r6", 6, REG }, { "r7", 7, REG },
+ { "r8", 8, REG }, { "r9", 9, REG }, { "r10", 10, REG }, { "r11", 11, REG },
+ { "r12", 12, REG }, { "r13", 13, REG }, { "r14", 14, REG }, { "r15", 15, REG },
+ { "r16", 16, REG }, { "r17", 17, REG }, { "r18", 18, REG }, { "r19", 19, REG },
+ { "r20", 20, REG }, { "r21", 21, REG }, { "r22", 22, REG }, { "r23", 23, REG },
+ { "r24", 24, REG }, { "r25", 25, REG }, { "r26", 26, REG }, { "fp", 27, REG },
+ { "sp", 28, REG }, { "ilink1", 29, REG }, { "ilink2", 30, REG }, { "blink", 31, REG },
+ { "r32", 32, REG }, { "r33", 33, REG }, { "r34", 34, REG }, { "r35", 35, REG },
+ { "r36", 36, REG }, { "r37", 37, REG }, { "r38", 38, REG }, { "r39", 39, REG },
+ { "r40", 40, REG }, { "r41", 41, REG }, { "r42", 42, REG }, { "r43", 43, REG },
+ { "r44", 44, REG }, { "r45", 45, REG }, { "r46", 46, REG }, { "r47", 47, REG },
+ { "r48", 48, REG }, { "r49", 49, REG }, { "r50", 50, REG }, { "r51", 51, REG },
+ { "r52", 52, REG }, { "r53", 53, REG }, { "r54", 54, REG }, { "r55", 55, REG },
+ { "r56", 56, REG }, { "r57", 57, REG }, { "r58", 58, REG }, { "r59", 59, REG },
+ { "lp_count", 60, REG },
+
+ /* I'd prefer to output these as "fp" and "sp" by default, but we still need
+ to recognize the canonical values. */
+ { "r27", 27, REG }, { "r28", 28, REG },
+
+ /* Someone may wish to refer to these in this way, and it's probably a
+ good idea to reserve them as such anyway. */
+ { "r29", 29, REG }, { "r30", 30, REG }, { "r31", 31, REG }, { "r60", 60, REG },
+
+ /* Standard auxiliary registers. */
+ { "status", 0, AUXREG },
+ { "semaphore", 1, AUXREG },
+ { "lp_start", 2, AUXREG },
+ { "lp_end", 3, AUXREG },
+ { "identity", 4, AUXREG },
+ { "debug", 5, AUXREG },
+};
+const int arc_reg_names_count = sizeof (arc_reg_names) / sizeof (arc_reg_names[0]);
+
+/* The suffix table.
+ Operands with the same name must be stored together. */
+
+const struct arc_operand_value arc_suffixes[] =
+{
+ /* Entry 0 is special, default values aren't printed by the disassembler. */
+ { "", 0, -1 },
+ { "al", 0, COND },
+ { "ra", 0, COND },
+ { "eq", 1, COND },
+ { "z", 1, COND },
+ { "ne", 2, COND },
+ { "nz", 2, COND },
+ { "p", 3, COND },
+ { "pl", 3, COND },
+ { "n", 4, COND },
+ { "mi", 4, COND },
+ { "c", 5, COND },
+ { "cs", 5, COND },
+ { "lo", 5, COND },
+ { "nc", 6, COND },
+ { "cc", 6, COND },
+ { "hs", 6, COND },
+ { "v", 7, COND },
+ { "vs", 7, COND },
+ { "nv", 8, COND },
+ { "vc", 8, COND },
+ { "gt", 9, COND },
+ { "ge", 10, COND },
+ { "lt", 11, COND },
+ { "le", 12, COND },
+ { "hi", 13, COND },
+ { "ls", 14, COND },
+ { "pnz", 15, COND },
+ { "f", 1, FLAG },
+ { "nd", ARC_DELAY_NONE, DELAY },
+ { "d", ARC_DELAY_NORMAL, DELAY },
+ { "jd", ARC_DELAY_JUMP, DELAY },
+/*{ "b", 7, SIZEEXT },*/
+/*{ "b", 5, SIZESEX },*/
+ { "b", 1, SIZE1 },
+ { "b", 1, SIZE10 },
+ { "b", 1, SIZE22 },
+/*{ "w", 8, SIZEEXT },*/
+/*{ "w", 6, SIZESEX },*/
+ { "w", 2, SIZE1 },
+ { "w", 2, SIZE10 },
+ { "w", 2, SIZE22 },
+ { "x", 1, SIGN0 },
+ { "x", 1, SIGN9 },
+ { "a", 1, ADDRESS3 },
+ { "a", 1, ADDRESS12 },
+ { "a", 1, ADDRESS24 },
+ { "di", 1, CACHEBYPASS5 },
+ { "di", 1, CACHEBYPASS14 },
+ { "di", 1, CACHEBYPASS26 },
+};
+const int arc_suffixes_count = sizeof (arc_suffixes) / sizeof (arc_suffixes[0]);
+
+/* Indexed by first letter of opcode. Points to chain of opcodes with same
+ first letter. */
+static struct arc_opcode *opcode_map[26 + 1];
+
+/* Indexed by insn code. Points to chain of opcodes with same insn code. */
+static struct arc_opcode *icode_map[32];
+
+/* Configuration flags. */
+
+/* Various ARC_HAVE_XXX bits. */
+static int cpu_type;
+
+/* Translate a bfd_mach_arc_xxx value to a ARC_MACH_XXX value. */
+
+int
+arc_get_opcode_mach (bfd_mach, big_p)
+ int bfd_mach, big_p;
+{
+ static int mach_type_map[] =
+ {
+ ARC_MACH_BASE
+ };
+
+ return mach_type_map[bfd_mach] | (big_p ? ARC_MACH_BIG : 0);
+}
+
+/* Initialize any tables that need it.
+ Must be called once at start up (or when first needed).
+
+ FLAGS is a set of bits that say what version of the cpu we have,
+ and in particular at least (one of) ARC_MACH_XXX. */
+
+void
+arc_opcode_init_tables (flags)
+ int flags;
+{
+ static int init_p = 0;
+
+ cpu_type = flags;
+
+ /* We may be intentionally called more than once (for example gdb will call
+ us each time the user switches cpu). These tables only need to be init'd
+ once though. */
+ /* ??? We can remove the need for arc_opcode_supported by taking it into
+ account here, but I'm not sure I want to do that yet (if ever). */
+ if (!init_p)
+ {
+ register int i,n;
+
+ memset (arc_operand_map, 0, sizeof (arc_operand_map));
+ n = sizeof (arc_operands) / sizeof (arc_operands[0]);
+ for (i = 0; i < n; ++i)
+ arc_operand_map[arc_operands[i].fmt] = i;
+
+ memset (opcode_map, 0, sizeof (opcode_map));
+ memset (icode_map, 0, sizeof (icode_map));
+ /* Scan the table backwards so macros appear at the front. */
+ for (i = arc_opcodes_count - 1; i >= 0; --i)
+ {
+ int opcode_hash = ARC_HASH_OPCODE (arc_opcodes[i].syntax);
+ int icode_hash = ARC_HASH_ICODE (arc_opcodes[i].value);
+
+ arc_opcodes[i].next_asm = opcode_map[opcode_hash];
+ opcode_map[opcode_hash] = &arc_opcodes[i];
+
+ arc_opcodes[i].next_dis = icode_map[icode_hash];
+ icode_map[icode_hash] = &arc_opcodes[i];
+ }
+
+ init_p = 1;
+ }
+}
+
+/* Return non-zero if OPCODE is supported on the specified cpu.
+ Cpu selection is made when calling `arc_opcode_init_tables'. */
+
+int
+arc_opcode_supported (opcode)
+ const struct arc_opcode *opcode;
+{
+ if (ARC_OPCODE_CPU (opcode->flags) == 0)
+ return 1;
+ if (ARC_OPCODE_CPU (opcode->flags) & ARC_HAVE_CPU (cpu_type))
+ return 1;
+ return 0;
+}
+
+/* Return non-zero if OPVAL is supported on the specified cpu.
+ Cpu selection is made when calling `arc_opcode_init_tables'. */
+
+int
+arc_opval_supported (opval)
+ const struct arc_operand_value *opval;
+{
+ if (ARC_OPVAL_CPU (opval->flags) == 0)
+ return 1;
+ if (ARC_OPVAL_CPU (opval->flags) & ARC_HAVE_CPU (cpu_type))
+ return 1;
+ return 0;
+}
+
+/* Return the first insn in the chain for assembling INSN. */
+
+const struct arc_opcode *
+arc_opcode_lookup_asm (insn)
+ const char *insn;
+{
+ return opcode_map[ARC_HASH_OPCODE (insn)];
+}
+
+/* Return the first insn in the chain for disassembling INSN. */
+
+const struct arc_opcode *
+arc_opcode_lookup_dis (insn)
+ unsigned int insn;
+{
+ return icode_map[ARC_HASH_ICODE (insn)];
+}
+
+/* Nonzero if we've seen an 'f' suffix (in certain insns). */
+static int flag_p;
+
+/* Nonzero if we've finished processing the 'f' suffix. */
+static int flagshimm_handled_p;
+
+/* Nonzero if we've seen a 'q' suffix (condition code). */
+static int cond_p;
+
+/* Nonzero if we've inserted a shimm. */
+static int shimm_p;
+
+/* The value of the shimm we inserted (each insn only gets one but it can
+ appear multiple times. */
+static int shimm;
+
+/* Nonzero if we've inserted a limm (during assembly) or seen a limm
+ (during disassembly). */
+static int limm_p;
+
+/* The value of the limm we inserted. Each insn only gets one but it can
+ appear multiple times. */
+static long limm;
+
+/* Insertion functions. */
+
+/* Called by the assembler before parsing an instruction. */
+
+void
+arc_opcode_init_insert ()
+{
+ flag_p = 0;
+ flagshimm_handled_p = 0;
+ cond_p = 0;
+ shimm_p = 0;
+ limm_p = 0;
+}
+
+/* Called by the assembler to see if the insn has a limm operand.
+ Also called by the disassembler to see if the insn contains a limm. */
+
+int
+arc_opcode_limm_p (limmp)
+ long *limmp;
+{
+ if (limmp)
+ *limmp = limm;
+ return limm_p;
+}
+
+/* Insert a value into a register field.
+ If REG is NULL, then this is actually a constant.
+
+ We must also handle auxiliary registers for lr/sr insns. */
+
+static arc_insn
+insert_reg (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ static char buf[100];
+
+ if (reg == NULL)
+ {
+ /* We have a constant that also requires a value stored in a register
+ field. Handle these by updating the register field and saving the
+ value for later handling by either %S (shimm) or %L (limm). */
+
+ /* Try to use a shimm value before a limm one. */
+ if (ARC_SHIMM_CONST_P (value)
+ /* If we've seen a conditional suffix we have to use a limm. */
+ && !cond_p
+ /* If we already have a shimm value that is different than ours
+ we have to use a limm. */
+ && (!shimm_p || shimm == value))
+ {
+ int marker = flag_p ? ARC_REG_SHIMM_UPDATE : ARC_REG_SHIMM;
+ flagshimm_handled_p = 1;
+ shimm_p = 1;
+ shimm = value;
+ insn |= marker << operand->shift;
+ /* insn |= value & 511; - done later */
+ }
+ /* We have to use a limm. If we've already seen one they must match. */
+ else if (!limm_p || limm == value)
+ {
+ limm_p = 1;
+ limm = value;
+ insn |= ARC_REG_LIMM << operand->shift;
+ /* The constant is stored later. */
+ }
+ else
+ {
+ *errmsg = "unable to fit different valued constants into instruction";
+ }
+ }
+ else
+ {
+ /* We have to handle both normal and auxiliary registers. */
+
+ if (reg->type == AUXREG)
+ {
+ if (!(mods & ARC_MOD_AUXREG))
+ *errmsg = "auxiliary register not allowed here";
+ else
+ {
+ insn |= ARC_REG_SHIMM << operand->shift;
+ insn |= reg->value << arc_operands[reg->type].shift;
+ }
+ }
+ else
+ {
+ /* We should never get an invalid register number here. */
+ if ((unsigned int) reg->value > 60)
+ {
+ sprintf (buf, "invalid register number `%d'", reg->value);
+ *errmsg = buf;
+ }
+ else
+ insn |= reg->value << operand->shift;
+ }
+ }
+
+ return insn;
+}
+
+/* Called when we see an 'f' flag. */
+
+static arc_insn
+insert_flag (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ /* We can't store anything in the insn until we've parsed the registers.
+ Just record the fact that we've got this flag. `insert_reg' will use it
+ to store the correct value (ARC_REG_SHIMM_UPDATE or bit 0x100). */
+ flag_p = 1;
+
+ return insn;
+}
+
+/* Called after completely building an insn to ensure the 'f' flag gets set
+ properly. This is needed because we don't know how to set this flag until
+ we've parsed the registers. */
+
+static arc_insn
+insert_flagfinish (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ if (flag_p && !flagshimm_handled_p)
+ {
+ if (shimm_p)
+ abort ();
+ flagshimm_handled_p = 1;
+ insn |= (1 << operand->shift);
+ }
+ return insn;
+}
+
+/* Called when we see a conditional flag (eg: .eq). */
+
+static arc_insn
+insert_cond (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ cond_p = 1;
+ insn |= (value & ((1 << operand->bits) - 1)) << operand->shift;
+ return insn;
+}
+
+/* Used in the "j" instruction to prevent constants from being interpreted as
+ shimm values (which the jump insn doesn't accept). This can also be used
+ to force the use of limm values in other situations (eg: ld r0,[foo] uses
+ this).
+ ??? The mechanism is sound. Access to it is a bit klunky right now. */
+
+static arc_insn
+insert_forcelimm (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ cond_p = 1;
+ return insn;
+}
+
+/* Used in ld/st insns to handle the shimm offset field. */
+
+static arc_insn
+insert_shimmoffset (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ long minval, maxval;
+ static char buf[100];
+
+ if (reg != NULL)
+ {
+ *errmsg = "register appears where shimm value expected";
+ }
+ else
+ {
+ /* This is *way* more general than necessary, but maybe some day it'll
+ be useful. */
+ if (operand->flags & ARC_OPERAND_SIGNED)
+ {
+ minval = -(1 << (operand->bits - 1));
+ maxval = (1 << (operand->bits - 1)) - 1;
+ }
+ else
+ {
+ minval = 0;
+ maxval = (1 << operand->bits) - 1;
+ }
+ if (value < minval || value > maxval)
+ {
+ sprintf (buf, "value won't fit in range %ld - %ld",
+ minval, maxval);
+ *errmsg = buf;
+ }
+ else
+ insn |= (value & ((1 << operand->bits) - 1)) << operand->shift;
+ }
+ return insn;
+}
+
+/* Used in ld/st insns when the shimm offset is 0. */
+
+static arc_insn
+insert_shimmzero (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ shimm_p = 1;
+ shimm = 0;
+ return insn;
+}
+
+/* Called at the end of processing normal insns (eg: add) to insert a shimm
+ value (if present) into the insn. */
+
+static arc_insn
+insert_shimmfinish (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ if (shimm_p)
+ insn |= (shimm & ((1 << operand->bits) - 1)) << operand->shift;
+ return insn;
+}
+
+/* Called at the end of processing normal insns (eg: add) to insert a limm
+ value (if present) into the insn.
+
+ Note that this function is only intended to handle instructions (with 4 byte
+ immediate operands). It is not intended to handle data. */
+
+/* ??? Actually, there's nothing for us to do as we can't call frag_more, the
+ caller must do that. The extract fns take a pointer to two words. The
+ insert fns could be converted and then we could do something useful, but
+ then the reloc handlers would have to know to work on the second word of
+ a 2 word quantity. That's too much so we don't handle them. */
+
+static arc_insn
+insert_limmfinish (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ if (limm_p)
+ ; /* nothing to do, gas does it */
+ return insn;
+}
+
+/* Called at the end of unary operand macros to copy the B field to C. */
+
+static arc_insn
+insert_unopmacro (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ insn |= ((insn >> ARC_SHIFT_REGB) & ARC_MASK_REG) << operand->shift;
+ return insn;
+}
+
+/* Insert a relative address for a branch insn (b, bl, or lp). */
+
+static arc_insn
+insert_reladdr (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ if (value & 3)
+ *errmsg = "branch address not on 4 byte boundary";
+ insn |= ((value >> 2) & ((1 << operand->bits) - 1)) << operand->shift;
+ return insn;
+}
+
+/* Insert a limm value as a 26 bit address right shifted 2 into the insn.
+
+ Note that this function is only intended to handle instructions (with 4 byte
+ immediate operands). It is not intended to handle data. */
+
+/* ??? Actually, there's nothing for us to do as we can't call frag_more, the
+ caller must do that. The extract fns take a pointer to two words. The
+ insert fns could be converted and then we could do something useful, but
+ then the reloc handlers would have to know to work on the second word of
+ a 2 word quantity. That's too much so we don't handle them. */
+
+static arc_insn
+insert_absaddr (insn, operand, mods, reg, value, errmsg)
+ arc_insn insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value *reg;
+ long value;
+ const char **errmsg;
+{
+ if (limm_p)
+ ; /* nothing to do */
+ return insn;
+}
+
+/* Extraction functions.
+
+ The suffix extraction functions' return value is redundant since it can be
+ obtained from (*OPVAL)->value. However, the boolean suffixes don't have
+ a suffix table entry for the "false" case, so values of zero must be
+ obtained from the return value (*OPVAL == NULL). */
+
+static const struct arc_operand_value *lookup_register (int type, long regno);
+
+/* Called by the disassembler before printing an instruction. */
+
+void
+arc_opcode_init_extract ()
+{
+ flag_p = 0;
+ flagshimm_handled_p = 0;
+ shimm_p = 0;
+ limm_p = 0;
+}
+
+/* As we're extracting registers, keep an eye out for the 'f' indicator
+ (ARC_REG_SHIMM_UPDATE). If we find a register (not a constant marker,
+ like ARC_REG_SHIMM), set OPVAL so our caller will know this is a register.
+
+ We must also handle auxiliary registers for lr/sr insns. They are just
+ constants with special names. */
+
+static long
+extract_reg (insn, operand, mods, opval, invalid)
+ arc_insn *insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value **opval;
+ int *invalid;
+{
+ int regno;
+ long value;
+
+ /* Get the register number. */
+ regno = (insn[0] >> operand->shift) & ((1 << operand->bits) - 1);
+
+ /* Is it a constant marker? */
+ if (regno == ARC_REG_SHIMM)
+ {
+ value = insn[0] & 511;
+ if ((operand->flags & ARC_OPERAND_SIGNED)
+ && (value & 256))
+ value -= 512;
+ flagshimm_handled_p = 1;
+ }
+ else if (regno == ARC_REG_SHIMM_UPDATE)
+ {
+ value = insn[0] & 511;
+ if ((operand->flags & ARC_OPERAND_SIGNED)
+ && (value & 256))
+ value -= 512;
+ flag_p = 1;
+ flagshimm_handled_p = 1;
+ }
+ else if (regno == ARC_REG_LIMM)
+ {
+ value = insn[1];
+ limm_p = 1;
+ }
+ /* It's a register, set OPVAL (that's the only way we distinguish registers
+ from constants here). */
+ else
+ {
+ const struct arc_operand_value *reg = lookup_register (REG, regno);
+
+ if (reg == NULL)
+ abort ();
+ if (opval != NULL)
+ *opval = reg;
+ value = regno;
+ }
+
+ /* If this field takes an auxiliary register, see if it's a known one. */
+ if ((mods & ARC_MOD_AUXREG)
+ && ARC_REG_CONSTANT_P (regno))
+ {
+ const struct arc_operand_value *reg = lookup_register (AUXREG, value);
+
+ /* This is really a constant, but tell the caller it has a special
+ name. */
+ if (reg != NULL && opval != NULL)
+ *opval = reg;
+ }
+
+ return value;
+}
+
+/* Return the value of the "flag update" field for shimm insns.
+ This value is actually stored in the register field. */
+
+static long
+extract_flag (insn, operand, mods, opval, invalid)
+ arc_insn *insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value **opval;
+ int *invalid;
+{
+ int f;
+ const struct arc_operand_value *val;
+
+ if (flagshimm_handled_p)
+ f = flag_p != 0;
+ else
+ f = (insn[0] & (1 << operand->shift)) != 0;
+
+ /* There is no text for zero values. */
+ if (f == 0)
+ return 0;
+
+ val = arc_opcode_lookup_suffix (operand, 1);
+ if (opval != NULL && val != NULL)
+ *opval = val;
+ return val->value;
+}
+
+/* Extract the condition code (if it exists).
+ If we've seen a shimm value in this insn (meaning that the insn can't have
+ a condition code field), then we don't store anything in OPVAL and return
+ zero. */
+
+static long
+extract_cond (insn, operand, mods, opval, invalid)
+ arc_insn *insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value **opval;
+ int *invalid;
+{
+ long cond;
+ const struct arc_operand_value *val;
+
+ if (flagshimm_handled_p)
+ return 0;
+
+ cond = (insn[0] >> operand->shift) & ((1 << operand->bits) - 1);
+ val = arc_opcode_lookup_suffix (operand, cond);
+
+ /* Ignore NULL values of `val'. Several condition code values are
+ reserved for extensions. */
+ if (opval != NULL && val != NULL)
+ *opval = val;
+ return cond;
+}
+
+/* Extract a branch address.
+ We return the value as a real address (not right shifted by 2). */
+
+static long
+extract_reladdr (insn, operand, mods, opval, invalid)
+ arc_insn *insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value **opval;
+ int *invalid;
+{
+ long addr;
+
+ addr = (insn[0] >> operand->shift) & ((1 << operand->bits) - 1);
+ if ((operand->flags & ARC_OPERAND_SIGNED)
+ && (addr & (1 << (operand->bits - 1))))
+ addr -= 1 << operand->bits;
+
+ return addr << 2;
+}
+
+/* The only thing this does is set the `invalid' flag if B != C.
+ This is needed because the "mov" macro appears before it's real insn "and"
+ and we don't want the disassembler to confuse them. */
+
+static long
+extract_unopmacro (insn, operand, mods, opval, invalid)
+ arc_insn *insn;
+ const struct arc_operand *operand;
+ int mods;
+ const struct arc_operand_value **opval;
+ int *invalid;
+{
+ /* This misses the case where B == ARC_REG_SHIMM_UPDATE &&
+ C == ARC_REG_SHIMM (or vice versa). No big deal. Those insns will get
+ printed as "and"s. */
+ if (((insn[0] >> ARC_SHIFT_REGB) & ARC_MASK_REG)
+ != ((insn[0] >> ARC_SHIFT_REGC) & ARC_MASK_REG))
+ if (invalid != NULL)
+ *invalid = 1;
+
+ return 0;
+}
+
+/* Utility for the extraction functions to return the index into
+ `arc_suffixes'. */
+
+const struct arc_operand_value *
+arc_opcode_lookup_suffix (type, value)
+ const struct arc_operand *type;
+ int value;
+{
+ register const struct arc_operand_value *v,*end;
+
+ /* ??? This is a little slow and can be speeded up. */
+
+ for (v = arc_suffixes, end = arc_suffixes + arc_suffixes_count; v < end; ++v)
+ if (type == &arc_operands[v->type]
+ && value == v->value)
+ return v;
+ return 0;
+}
+
+static const struct arc_operand_value *
+lookup_register (type, regno)
+ int type;
+ long regno;
+{
+ register const struct arc_operand_value *r,*end;
+
+ if (type == REG)
+ return &arc_reg_names[regno];
+
+ /* ??? This is a little slow and can be speeded up. */
+
+ for (r = arc_reg_names, end = arc_reg_names + arc_reg_names_count;
+ r < end; ++r)
+ if (type == r->type && regno == r->value)
+ return r;
+ return 0;
+}
diff --git a/contrib/binutils/opcodes/cgen-asm.c b/contrib/binutils/opcodes/cgen-asm.c
index 732ba57..6dd558b 100644
--- a/contrib/binutils/opcodes/cgen-asm.c
+++ b/contrib/binutils/opcodes/cgen-asm.c
@@ -1,28 +1,30 @@
/* CGEN generic assembler support code.
-Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-This file is part of the GNU Binutils and GDB, the GNU debugger.
+ This file is part of the GNU Binutils and GDB, the GNU debugger.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ 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. */
+ 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 "sysdep.h"
#include <stdio.h>
+#include <ctype.h>
#include "ansidecl.h"
#include "libiberty.h"
#include "bfd.h"
+#include "symcat.h"
#include "opcode/cgen.h"
/* Operand parsing callback. */
@@ -64,11 +66,11 @@ cgen_init_parse_operand ()
static void
build_asm_hash_table ()
{
- int i;
unsigned int hash;
int count = cgen_insn_count ();
CGEN_OPCODE_DATA *data = cgen_current_opcode_data;
CGEN_INSN_TABLE *insn_table = data->insn_table;
+ unsigned int entry_size = insn_table->entry_size;
unsigned int hash_size = insn_table->asm_hash_table_size;
const CGEN_INSN *insn;
CGEN_INSN_LIST *insn_lists,*new_insns;
@@ -87,13 +89,18 @@ build_asm_hash_table ()
/* Add compiled in insns.
The table is scanned backwards as later additions are inserted in
front of earlier ones and we want earlier ones to be prefered.
- We stop at the first one as it is a reserved entry. */
-
- for (insn = insn_table->init_entries + insn_table->num_init_entries - 1;
+ We stop at the first one as it is a reserved entry.
+ This is a bit tricky as the attribute member of CGEN_INSN is variable
+ among architectures. This code could be moved to cgen-asm.in, but
+ I prefer to keep it here for now. */
+
+ for (insn = (CGEN_INSN *)
+ ((char *) insn_table->init_entries
+ + entry_size * (insn_table->num_init_entries - 1));
insn > insn_table->init_entries;
- --insn, ++insn_lists)
+ insn = (CGEN_INSN *) ((char *) insn - entry_size), ++insn_lists)
{
- hash = (*insn_table->asm_hash) (insn->syntax.mnemonic);
+ hash = (*insn_table->asm_hash) CGEN_INSN_MNEMONIC (insn);
insn_lists->next = asm_hash_table[hash];
insn_lists->insn = insn;
asm_hash_table[hash] = insn_lists;
@@ -106,7 +113,7 @@ build_asm_hash_table ()
new_insns != NULL;
new_insns = new_insns->next, ++insn_lists)
{
- hash = (*insn_table->asm_hash) (new_insns->insn->syntax.mnemonic);
+ hash = (*insn_table->asm_hash) CGEN_INSN_MNEMONIC (new_insns->insn);
insn_lists->next = asm_hash_table[hash];
insn_lists->insn = new_insns->insn;
asm_hash_table[hash] = insn_lists;
@@ -139,35 +146,40 @@ cgen_asm_lookup_insn (insn)
const char *
cgen_parse_keyword (strp, keyword_table, valuep)
const char **strp;
- struct cgen_keyword *keyword_table;
+ CGEN_KEYWORD *keyword_table;
long *valuep;
{
- const struct cgen_keyword_entry *ke;
+ const CGEN_KEYWORD_ENTRY *ke;
char buf[256];
- const char *p;
+ const char *p,*start;
- p = *strp;
+ p = start = *strp;
- /* Allow any first character. */
+ /* Allow any first character.
+ Note that this allows recognizing ",a" for the annul flag in sparc
+ even though "," is subsequently not a valid keyword char. */
if (*p)
++p;
/* Now allow letters, digits, and _. */
- while (isalnum (*p) || *p == '_')
+ while (((p - start) < (int) sizeof (buf))
+ && (isalnum ((unsigned char) *p) || *p == '_'))
++p;
- if (p - *strp > 255)
+ if (p - start >= (int) sizeof (buf))
return "unrecognized keyword/register name";
- memcpy (buf, *strp, p - *strp);
- buf[p - *strp] = 0;
+ memcpy (buf, start, p - start);
+ buf[p - start] = 0;
ke = cgen_keyword_lookup_name (keyword_table, buf);
if (ke != NULL)
{
*valuep = ke->value;
- *strp = p;
+ /* Don't advance pointer if we recognized the null keyword. */
+ if (ke->name[0] != 0)
+ *strp = p;
return NULL;
}
@@ -177,13 +189,12 @@ cgen_parse_keyword (strp, keyword_table, valuep)
/* Signed integer parser. */
const char *
-cgen_parse_signed_integer (strp, opindex, min, max, valuep)
+cgen_parse_signed_integer (strp, opindex, valuep)
const char **strp;
int opindex;
- long min, max;
long *valuep;
{
- long value;
+ bfd_vma value;
enum cgen_parse_operand_result result;
const char *errmsg;
@@ -192,24 +203,19 @@ cgen_parse_signed_integer (strp, opindex, min, max, valuep)
&result, &value);
/* FIXME: Examine `result'. */
if (!errmsg)
- {
- if (value < min || value > max)
- return "integer operand out of range";
- *valuep = value;
- }
+ *valuep = value;
return errmsg;
}
/* Unsigned integer parser. */
const char *
-cgen_parse_unsigned_integer (strp, opindex, min, max, valuep)
+cgen_parse_unsigned_integer (strp, opindex, valuep)
const char **strp;
int opindex;
- unsigned long min, max;
unsigned long *valuep;
{
- unsigned long value;
+ bfd_vma value;
enum cgen_parse_operand_result result;
const char *errmsg;
@@ -218,33 +224,32 @@ cgen_parse_unsigned_integer (strp, opindex, min, max, valuep)
&result, &value);
/* FIXME: Examine `result'. */
if (!errmsg)
- {
- if (value < min || value > max)
- return "integer operand out of range";
- *valuep = value;
- }
+ *valuep = value;
return errmsg;
}
/* Address parser. */
const char *
-cgen_parse_address (strp, opindex, opinfo, valuep)
+cgen_parse_address (strp, opindex, opinfo, resultp, valuep)
const char **strp;
int opindex;
int opinfo;
+ enum cgen_parse_operand_result *resultp;
long *valuep;
{
- long value;
- enum cgen_parse_operand_result result;
+ bfd_vma value;
+ enum cgen_parse_operand_result result_type;
const char *errmsg;
errmsg = (*cgen_parse_operand_fn) (CGEN_PARSE_OPERAND_ADDRESS, strp,
opindex, opinfo,
- &result, &value);
+ &result_type, &value);
/* FIXME: Examine `result'. */
if (!errmsg)
{
+ if (resultp != NULL)
+ *resultp = result_type;
*valuep = value;
}
return errmsg;
diff --git a/contrib/binutils/opcodes/cgen-dis.c b/contrib/binutils/opcodes/cgen-dis.c
index f239b66..f7ee88f 100644
--- a/contrib/binutils/opcodes/cgen-dis.c
+++ b/contrib/binutils/opcodes/cgen-dis.c
@@ -1,36 +1,37 @@
/* CGEN generic disassembler support code.
-Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-This file is part of the GNU Binutils and GDB, the GNU debugger.
+ This file is part of the GNU Binutils and GDB, the GNU debugger.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ 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. */
+ 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 "sysdep.h"
#include <stdio.h>
#include "ansidecl.h"
#include "libiberty.h"
#include "bfd.h"
+#include "symcat.h"
#include "opcode/cgen.h"
/* This is not published as part of the public interface so we don't
declare this in cgen.h. */
-extern CGEN_OPCODE_DATA *cgen_current_opcode_data;
+extern CGEN_OPCODE_DATA * cgen_current_opcode_data;
/* Disassembler instruction hash table. */
-static CGEN_INSN_LIST **dis_hash_table;
+static CGEN_INSN_LIST ** dis_hash_table;
void
cgen_dis_init ()
@@ -47,17 +48,18 @@ cgen_dis_init ()
static void
build_dis_hash_table ()
{
- int i;
- int big_p = cgen_current_endian == CGEN_ENDIAN_BIG;
+ int bigend = cgen_current_endian == CGEN_ENDIAN_BIG;
unsigned int hash;
- char buf[4];
+ char buf [4];
unsigned long value;
int count = cgen_insn_count ();
- CGEN_OPCODE_DATA *data = cgen_current_opcode_data;
- CGEN_INSN_TABLE *insn_table = data->insn_table;
+ CGEN_OPCODE_DATA * data = cgen_current_opcode_data;
+ CGEN_INSN_TABLE * insn_table = data->insn_table;
+ unsigned int entry_size = insn_table->entry_size;
unsigned int hash_size = insn_table->dis_hash_table_size;
- const CGEN_INSN *insn;
- CGEN_INSN_LIST *insn_lists,*new_insns;
+ const CGEN_INSN * insn;
+ CGEN_INSN_LIST * insn_lists;
+ CGEN_INSN_LIST * new_insns;
/* The space allocated for the hash table consists of two parts:
the hash table and the hash lists. */
@@ -73,28 +75,33 @@ build_dis_hash_table ()
/* Add compiled in insns.
The table is scanned backwards as later additions are inserted in
front of earlier ones and we want earlier ones to be prefered.
- We stop at the first one as it is a reserved entry. */
-
- for (insn = insn_table->init_entries + insn_table->num_init_entries - 1;
+ We stop at the first one as it is a reserved entry.
+ This is a bit tricky as the attribute member of CGEN_INSN is variable
+ among architectures. This code could be moved to cgen-asm.in, but
+ I prefer to keep it here for now. */
+
+ for (insn = (CGEN_INSN *)
+ ((char *) insn_table->init_entries
+ + entry_size * (insn_table->num_init_entries - 1));
insn > insn_table->init_entries;
- --insn, ++insn_lists)
+ insn = (CGEN_INSN *) ((char *) insn - entry_size), ++ insn_lists)
{
/* We don't know whether the target uses the buffer or the base insn
to hash on, so set both up. */
- value = insn->syntax.value;
- switch (CGEN_INSN_BITSIZE (insn))
+ value = CGEN_INSN_VALUE (insn);
+ switch (CGEN_INSN_MASK_BITSIZE (insn))
{
case 8:
buf[0] = value;
break;
case 16:
- if (big_p)
+ if (bigend)
bfd_putb16 ((bfd_vma) value, buf);
else
bfd_putl16 ((bfd_vma) value, buf);
break;
case 32:
- if (big_p)
+ if (bigend)
bfd_putb32 ((bfd_vma) value, buf);
else
bfd_putl32 ((bfd_vma) value, buf);
@@ -102,10 +109,13 @@ build_dis_hash_table ()
default:
abort ();
}
- hash = (*insn_table->dis_hash) (buf, value);
- insn_lists->next = dis_hash_table[hash];
+
+ hash = insn_table->dis_hash (buf, value);
+
+ insn_lists->next = dis_hash_table [hash];
insn_lists->insn = insn;
- dis_hash_table[hash] = insn_lists;
+
+ dis_hash_table [hash] = insn_lists;
}
/* Add runtime added insns.
@@ -113,24 +123,24 @@ build_dis_hash_table ()
Not sure this is a bug or not. */
for (new_insns = insn_table->new_entries;
new_insns != NULL;
- new_insns = new_insns->next, ++insn_lists)
+ new_insns = new_insns->next, ++ insn_lists)
{
/* We don't know whether the target uses the buffer or the base insn
to hash on, so set both up. */
- value = new_insns->insn->syntax.value;
- switch (CGEN_INSN_BITSIZE (new_insns->insn))
+ value = CGEN_INSN_VALUE (new_insns->insn);
+ switch (CGEN_INSN_MASK_BITSIZE (new_insns->insn))
{
case 8:
buf[0] = value;
break;
case 16:
- if (big_p)
+ if (bigend)
bfd_putb16 ((bfd_vma) value, buf);
else
bfd_putl16 ((bfd_vma) value, buf);
break;
case 32:
- if (big_p)
+ if (bigend)
bfd_putb32 ((bfd_vma) value, buf);
else
bfd_putl32 ((bfd_vma) value, buf);
@@ -138,10 +148,13 @@ build_dis_hash_table ()
default:
abort ();
}
- hash = (*insn_table->dis_hash) (buf, value);
- insn_lists->next = dis_hash_table[hash];
+
+ hash = insn_table->dis_hash (buf, value);
+
+ insn_lists->next = dis_hash_table [hash];
insn_lists->insn = new_insns->insn;
- dis_hash_table[hash] = insn_lists;
+
+ dis_hash_table [hash] = insn_lists;
}
}
@@ -149,7 +162,7 @@ build_dis_hash_table ()
CGEN_INSN_LIST *
cgen_dis_lookup_insn (buf, value)
- const char *buf;
+ const char * buf;
unsigned long value;
{
unsigned int hash;
@@ -157,6 +170,7 @@ cgen_dis_lookup_insn (buf, value)
if (dis_hash_table == NULL)
build_dis_hash_table ();
- hash = (*cgen_current_opcode_data->insn_table->dis_hash) (buf, value);
- return dis_hash_table[hash];
+ hash = cgen_current_opcode_data->insn_table->dis_hash (buf, value);
+
+ return dis_hash_table [hash];
}
diff --git a/contrib/binutils/opcodes/cgen-opc.c b/contrib/binutils/opcodes/cgen-opc.c
index f9c67c8..a9d937b 100644
--- a/contrib/binutils/opcodes/cgen-opc.c
+++ b/contrib/binutils/opcodes/cgen-opc.c
@@ -1,28 +1,30 @@
/* CGEN generic opcode support.
-Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-This file is part of the GNU Binutils and GDB, the GNU debugger.
+ This file is part of the GNU Binutils and GDB, the GNU debugger.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ 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. */
+ 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 "sysdep.h"
+#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "libiberty.h"
#include "bfd.h"
+#include "symcat.h"
#include "opcode/cgen.h"
/* State variables.
@@ -38,31 +40,44 @@ int cgen_current_mach;
/* Current endian. */
enum cgen_endian cgen_current_endian = CGEN_ENDIAN_UNKNOWN;
+/* FIXME: To support multiple architectures, we need to return a handle
+ to the state set up by this function, and pass the handle back to the
+ other functions. Later. */
+
void
cgen_set_cpu (data, mach, endian)
CGEN_OPCODE_DATA *data;
int mach;
enum cgen_endian endian;
{
+ static int init_once_p;
+
cgen_current_opcode_data = data;
cgen_current_mach = mach;
cgen_current_endian = endian;
+ /* Initialize those things that only need be done once. */
+ if (! init_once_p)
+ {
+ /* Nothing to do currently. */
+ init_once_p = 1;
+ }
+
#if 0 /* This isn't done here because it would put assembler support in the
disassembler, etc. The caller is required to call these after calling
us. */
/* Reset the hash tables. */
cgen_asm_init ();
cgen_dis_init ();
-#endif
+#endif
}
static unsigned int hash_keyword_name
- PARAMS ((const struct cgen_keyword *, const char *));
+ PARAMS ((const CGEN_KEYWORD *, const char *, int));
static unsigned int hash_keyword_value
- PARAMS ((const struct cgen_keyword *, int));
+ PARAMS ((const CGEN_KEYWORD *, unsigned int));
static void build_keyword_hash_tables
- PARAMS ((struct cgen_keyword *));
+ PARAMS ((CGEN_KEYWORD *));
/* Return number of hash table entries to use for N elements. */
#define KEYWORD_HASH_SIZE(n) ((n) <= 31 ? 17 : 31)
@@ -70,18 +85,18 @@ static void build_keyword_hash_tables
/* Look up *NAMEP in the keyword table KT.
The result is the keyword entry or NULL if not found. */
-const struct cgen_keyword_entry *
+const CGEN_KEYWORD_ENTRY *
cgen_keyword_lookup_name (kt, name)
- struct cgen_keyword *kt;
+ CGEN_KEYWORD *kt;
const char *name;
{
- const struct cgen_keyword_entry *ke;
+ const CGEN_KEYWORD_ENTRY *ke;
const char *p,*n;
if (kt->name_hash_table == NULL)
build_keyword_hash_tables (kt);
- ke = kt->name_hash_table[hash_keyword_name (kt, name)];
+ ke = kt->name_hash_table[hash_keyword_name (kt, name, 0)];
/* We do case insensitive comparisons.
If that ever becomes a problem, add an attribute that denotes
@@ -94,7 +109,9 @@ cgen_keyword_lookup_name (kt, name)
while (*p
&& (*p == *n
- || (isalpha (*p) && tolower (*p) == tolower (*n))))
+ || (isalpha ((unsigned char) *p)
+ && (tolower ((unsigned char) *p)
+ == tolower ((unsigned char) *n)))))
++n, ++p;
if (!*p && !*n)
@@ -103,18 +120,20 @@ cgen_keyword_lookup_name (kt, name)
ke = ke->next_name;
}
+ if (kt->null_entry)
+ return kt->null_entry;
return NULL;
}
/* Look up VALUE in the keyword table KT.
The result is the keyword entry or NULL if not found. */
-const struct cgen_keyword_entry *
+const CGEN_KEYWORD_ENTRY *
cgen_keyword_lookup_value (kt, value)
- struct cgen_keyword *kt;
+ CGEN_KEYWORD *kt;
int value;
{
- const struct cgen_keyword_entry *ke;
+ const CGEN_KEYWORD_ENTRY *ke;
if (kt->name_hash_table == NULL)
build_keyword_hash_tables (kt);
@@ -135,21 +154,24 @@ cgen_keyword_lookup_value (kt, value)
void
cgen_keyword_add (kt, ke)
- struct cgen_keyword *kt;
- struct cgen_keyword_entry *ke;
+ CGEN_KEYWORD *kt;
+ CGEN_KEYWORD_ENTRY *ke;
{
unsigned int hash;
if (kt->name_hash_table == NULL)
build_keyword_hash_tables (kt);
- hash = hash_keyword_name (kt, ke->name);
+ hash = hash_keyword_name (kt, ke->name, 0);
ke->next_name = kt->name_hash_table[hash];
kt->name_hash_table[hash] = ke;
hash = hash_keyword_value (kt, ke->value);
ke->next_value = kt->value_hash_table[hash];
kt->value_hash_table[hash] = ke;
+
+ if (ke->name[0] == 0)
+ kt->null_entry = ke;
}
/* FIXME: Need function to return count of keywords. */
@@ -162,12 +184,12 @@ cgen_keyword_add (kt, ke)
The result is an opaque data item used to record the search status.
It is passed to each call to cgen_keyword_search_next. */
-struct cgen_keyword_search
+CGEN_KEYWORD_SEARCH
cgen_keyword_search_init (kt, spec)
- struct cgen_keyword *kt;
+ CGEN_KEYWORD *kt;
const char *spec;
{
- struct cgen_keyword_search search;
+ CGEN_KEYWORD_SEARCH search;
/* FIXME: Need to specify format of PARAMS. */
if (spec != NULL)
@@ -186,12 +208,10 @@ cgen_keyword_search_init (kt, spec)
/* Return the next keyword specified by SEARCH.
The result is the next entry or NULL if there are no more. */
-const struct cgen_keyword_entry *
+const CGEN_KEYWORD_ENTRY *
cgen_keyword_search_next (search)
- struct cgen_keyword_search *search;
+ CGEN_KEYWORD_SEARCH *search;
{
- const struct cgen_keyword_entry *ke;
-
/* Has search finished? */
if (search->current_hash == search->table->hash_table_size)
return NULL;
@@ -220,17 +240,23 @@ cgen_keyword_search_next (search)
return NULL;
}
-/* Return first entry in hash chain for NAME. */
+/* Return first entry in hash chain for NAME.
+ If CASE_SENSITIVE_P is non-zero, return a case sensitive hash. */
static unsigned int
-hash_keyword_name (kt, name)
- const struct cgen_keyword *kt;
+hash_keyword_name (kt, name, case_sensitive_p)
+ const CGEN_KEYWORD *kt;
const char *name;
+ int case_sensitive_p;
{
unsigned int hash;
- for (hash = 0; *name; ++name)
- hash = (hash * 97) + (unsigned char) *name;
+ if (case_sensitive_p)
+ for (hash = 0; *name; ++name)
+ hash = (hash * 97) + (unsigned char) *name;
+ else
+ for (hash = 0; *name; ++name)
+ hash = (hash * 97) + (unsigned char) tolower (*name);
return hash % kt->hash_table_size;
}
@@ -238,8 +264,8 @@ hash_keyword_name (kt, name)
static unsigned int
hash_keyword_value (kt, value)
- const struct cgen_keyword *kt;
- int value;
+ const CGEN_KEYWORD *kt;
+ unsigned int value;
{
return value % kt->hash_table_size;
}
@@ -250,7 +276,7 @@ hash_keyword_value (kt, value)
static void
build_keyword_hash_tables (kt)
- struct cgen_keyword *kt;
+ CGEN_KEYWORD *kt;
{
int i;
/* Use the number of compiled in entries as an estimate for the
@@ -258,12 +284,12 @@ build_keyword_hash_tables (kt)
unsigned int size = KEYWORD_HASH_SIZE (kt->num_init_entries);
kt->hash_table_size = size;
- kt->name_hash_table = (struct cgen_keyword_entry **)
- xmalloc (size * sizeof (struct cgen_keyword_entry *));
- memset (kt->name_hash_table, 0, size * sizeof (struct cgen_keyword_entry *));
- kt->value_hash_table = (struct cgen_keyword_entry **)
- xmalloc (size * sizeof (struct cgen_keyword_entry *));
- memset (kt->value_hash_table, 0, size * sizeof (struct cgen_keyword_entry *));
+ kt->name_hash_table = (CGEN_KEYWORD_ENTRY **)
+ xmalloc (size * sizeof (CGEN_KEYWORD_ENTRY *));
+ memset (kt->name_hash_table, 0, size * sizeof (CGEN_KEYWORD_ENTRY *));
+ kt->value_hash_table = (CGEN_KEYWORD_ENTRY **)
+ xmalloc (size * sizeof (CGEN_KEYWORD_ENTRY *));
+ memset (kt->value_hash_table, 0, size * sizeof (CGEN_KEYWORD_ENTRY *));
/* The table is scanned backwards as we want keywords appearing earlier to
be prefered over later ones. */
@@ -273,11 +299,11 @@ build_keyword_hash_tables (kt)
/* Hardware support. */
-CGEN_HW_ENTRY *
+const CGEN_HW_ENTRY *
cgen_hw_lookup (name)
const char *name;
{
- CGEN_HW_ENTRY *hw = cgen_current_opcode_data->hw_list;
+ const CGEN_HW_ENTRY *hw = cgen_current_opcode_data->hw_list;
while (hw != NULL)
{
diff --git a/contrib/binutils/opcodes/config.in b/contrib/binutils/opcodes/config.in
index aedc490..6be7c59 100644
--- a/contrib/binutils/opcodes/config.in
+++ b/contrib/binutils/opcodes/config.in
@@ -1,5 +1,11 @@
/* config.in. Generated automatically from configure.in by autoheader. */
+/* Name of package. */
+#undef PACKAGE
+
+/* Version of package. */
+#undef VERSION
+
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
diff --git a/contrib/binutils/opcodes/configure b/contrib/binutils/opcodes/configure
index 5384638..ab71c7a 100755
--- a/contrib/binutils/opcodes/configure
+++ b/contrib/binutils/opcodes/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
+# Generated automatically using autoconf version 2.12.1
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -12,11 +12,22 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
- --enable-targets alternative target configurations"
+ --enable-shared build shared libraries [default=no]
+ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list"
+ac_help="$ac_help
+ --enable-static build static libraries [default=yes]
+ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list"
+ac_help="$ac_help
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
ac_help="$ac_help
- --enable-shared build shared opcodes library"
+ --enable-targets alternative target configurations"
ac_help="$ac_help
--enable-commonbfdlib build shared BFD/opcodes/libiberty library"
+ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -55,6 +66,7 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
@@ -338,7 +350,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
+ echo "configure generated by autoconf version 2.12.1"
exit 0 ;;
-with-* | --with-*)
@@ -524,58 +536,9 @@ else
fi
-# configure.in script for the opcodes library.
-# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-# Written by Cygnus Support.
-#
-# 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.
-
-# Check whether --enable-targets or --disable-targets was given.
-if test "${enable_targets+set}" = set; then
- enableval="$enable_targets"
- case "${enableval}" in
- yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
- ;;
- no) enable_targets= ;;
- *) enable_targets=$enableval ;;
-esac
-fi
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- case "${enableval}" in
- yes) shared=true ;;
- no) shared=false ;;
- *opcodes*) shared=true ;;
- *) shared=false ;;
-esac
-fi
-# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
-if test "${enable_commonbfdlib+set}" = set; then
- enableval="$enable_commonbfdlib"
- case "${enableval}" in
- yes) commonbfdlib=true ;;
- no) commonbfdlib=false ;;
- *) { echo "configure: error: bad value ${enableval} for opcodes commonbfdlib option" 1>&2; exit 1; } ;;
-esac
-fi
-
-
ac_aux_dir=
-for ac_dir in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`; do
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -587,7 +550,7 @@ for ac_dir in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`; do
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`" 1>&2; exit 1; }
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
@@ -616,33 +579,33 @@ esac
# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:625: checking host system type" >&5
+echo "configure:588: checking host system type" >&5
host_alias=$host
case "$host_alias" in
NONE)
case $nonopt in
NONE)
- if host_alias=`$ac_config_guess`; then :
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
fi ;;
*) host_alias=$nonopt ;;
esac ;;
esac
-host=`$ac_config_sub $host_alias`
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:646: checking target system type" >&5
+echo "configure:609: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -653,14 +616,14 @@ NONE)
esac ;;
esac
-target=`$ac_config_sub $target_alias`
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:664: checking build system type" >&5
+echo "configure:627: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -671,7 +634,7 @@ NONE)
esac ;;
esac
-build=`$ac_config_sub $build_alias`
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -682,9 +645,115 @@ test "$host_alias" != "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
-if test -z "$target" ; then
- { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
+
+# We currently only use the version number for the name of any shared
+# library. For user convenience, we always use the same version
+# number that BFD is using.
+BFD_VERSION=`grep INIT_AUTOMAKE ${srcdir}/../bfd/configure.in | sed -n -e 's/[ ]//g' -e 's/^.*,\(.*\)).*$/\1/p'`
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:667: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:721: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
if test "$program_transform_name" = s,x,x,; then
program_transform_name=
else
@@ -704,29 +773,302 @@ test "$program_suffix" != NONE &&
# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:778: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
-# host-specific stuff:
-ALLLIBS='$(TARGETLIB)'
-PICFLAG=
-SHLIB=unused-shlib
-SHLINK=unused-shlink
-if test "${shared}" = "true"; then
- ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
- PICFLAG=-fpic
- if test "${commonbfdlib}" = "true"; then
- SHLIB=../bfd/libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
- SHLINK=../bfd/libbfd.so
- else
- SHLIB=libopcodes.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
- SHLINK=libopcodes.so
- fi
+PACKAGE=opcodes
+
+VERSION=${BFD_VERSION}
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:824: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
+else
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:837: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:850: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:863: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
+else
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:876: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
+
+
+if test $host != $build; then
+ ac_tool_prefix=${host_alias}-
+else
+ ac_tool_prefix=
+fi
+
+# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:899: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+ echo "$ac_t""$AR" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:930: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_RANLIB"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:961: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ RANLIB=":"
+fi
+fi
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=no
+fi
+
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1043: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:730: checking for $ac_word" >&5
+echo "configure:1072: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -755,7 +1097,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:759: checking for $ac_word" >&5
+echo "configure:1101: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -803,7 +1145,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:807: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1149: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -813,11 +1155,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 817 "configure"
+#line 1159 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -837,12 +1179,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:841: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1183: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:846: checking whether we are using GNU C" >&5
+echo "configure:1188: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -851,7 +1193,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -866,7 +1208,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:870: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1212: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -893,207 +1235,528 @@ else
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
-. ${srcdir}/../bfd/configure.host
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:1252: checking for ld used by GCC" >&5
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+ /* | [A-Za-z]:\\*)
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:1270: checking for GNU ld" >&5
+else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:1273: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
-if test $host != $build; then
- ac_tool_prefix=${host_alias}-
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ echo "$ac_t""$LD" 1>&6
else
- ac_tool_prefix=
+ echo "$ac_t""no" 1>&6
fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
-# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:910: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:1309: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
+
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:1325: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
+ case "$NM" in
+/* | [A-Za-z]:\\*)
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
break
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac
fi
+
+NM="$ac_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1362: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
fi
-AR="$ac_cv_prog_AR"
-if test -n "$AR"; then
- echo "$ac_t""$AR" 1>&6
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
else
echo "$ac_t""no" 1>&6
fi
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 1398 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
-# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+
+# Check whether --enable-targets or --disable-targets was given.
+if test "${enable_targets+set}" = set; then
+ enableval="$enable_targets"
+ case "${enableval}" in
+ yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
+ ;;
+ no) enable_targets= ;;
+ *) enable_targets=$enableval ;;
+esac
+fi
+# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
+if test "${enable_commonbfdlib+set}" = set; then
+ enableval="$enable_commonbfdlib"
+ case "${enableval}" in
+ yes) commonbfdlib=true ;;
+ no) commonbfdlib=false ;;
+ *) { echo "configure: error: bad value ${enableval} for opcodes commonbfdlib option" 1>&2; exit 1; } ;;
+esac
+fi
+
+
+
+
+
+if test -z "$target" ; then
+ { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
+fi
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:1477: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+
+
+echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
+echo "configure:1495: checking for Cygwin32 environment" >&5
+if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1500 "configure"
+#include "confdefs.h"
+
+int main() {
+return __CYGWIN32__;
+; return 0; }
+EOF
+if { (eval echo configure:1507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_cygwin32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_cygwin32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_cygwin32" 1>&6
+CYGWIN32=
+test "$am_cv_cygwin32" = yes && CYGWIN32=yes
+echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
+echo "configure:1524: checking for Mingw32 environment" >&5
+if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1529 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_mingw32" 1>&6
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1555: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
+am_cv_exeext=.exe
+else
+cat > am_c_test.c << 'EOF'
+int main() {
+/* Nothing needed here */
+}
+EOF
+${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
+am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
+rm -f am_c_test*
+fi
+
+test x"${am_cv_exeext}" = x && am_cv_exeext=no
+fi
+EXEEXT=""
+test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
+echo "$ac_t""${am_cv_exeext}" 1>&6
+
+
+# host-specific stuff:
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:941: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+echo "configure:1584: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ ac_cv_prog_CC="gcc"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
-
-if test -z "$ac_cv_prog_RANLIB"; then
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:972: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+echo "configure:1613: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
break
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
fi
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
-else
- RANLIB=":"
-fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1014: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1661: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 1671 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:1675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ ac_cv_prog_cc_cross=yes
fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
+rm -fr conftest*
-if test "${shared}" = "true"; then
- if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
- echo "configure: warning: opcodes --enable-shared only supported when using gcc" 1>&2
- shared=false
- ALLLIBS='$(TARGETLIB)'
- PICFLAG=
- SHLIB=unused-shlib
- fi
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1700: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1724: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+fi
-
-
-if test "${commonbfdlib}" = "true"; then
- COMMON_SHLIB=yes
- # Rebuild the shared library if libiberty or libbfd changes.
- SHLIB_DEP="../libiberty/libiberty.a ../bfd/libbfd.a"
- BFD_PICLIST=../bfd/piclist
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
else
- COMMON_SHLIB=
- SHLIB_DEP=
- BFD_PICLIST=
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
+. ${srcdir}/../bfd/configure.host
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1097: checking how to run the C preprocessor" >&5
+echo "configure:1760: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1108,13 +1771,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1112 "configure"
+#line 1775 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1118: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1125,13 +1788,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1129 "configure"
+#line 1792 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1157,17 +1820,17 @@ for ac_hdr in string.h strings.h stdlib.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1161: checking for $ac_hdr" >&5
+echo "configure:1824: 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 1166 "configure"
+#line 1829 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1194,6 +1857,7 @@ fi
done
+
# target-specific stuff:
# Canonicalize the secondary target names.
@@ -1224,7 +1888,7 @@ done
# Utility var, documents generic cgen support files.
-cgen_files="cgen-opc.o cgen-asm.o cgen-dis.o"
+cgen_files="cgen-opc.lo cgen-asm.lo cgen-dis.lo"
# We don't do any links based on the target system, just makefile config.
@@ -1238,36 +1902,39 @@ if test x${all_targets} = xfalse ; then
ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
archdefs="$archdefs -DARCH_$ad"
case "$arch" in
- bfd_a29k_arch) ta="$ta a29k-dis.o" ;;
+ bfd_a29k_arch) ta="$ta a29k-dis.lo" ;;
bfd_alliant_arch) ;;
- bfd_alpha_arch) ta="$ta alpha-dis.o alpha-opc.o" ;;
- bfd_arm_arch) ta="$ta arm-dis.o" ;;
+ bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;;
+ bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo" ;;
+ bfd_arm_arch) ta="$ta arm-dis.lo" ;;
bfd_convex_arch) ;;
- bfd_d10v_arch) ta="$ta d10v-dis.o d10v-opc.o" ;;
- bfd_h8300_arch) ta="$ta h8300-dis.o" ;;
- bfd_h8500_arch) ta="$ta h8500-dis.o" ;;
- bfd_hppa_arch) ta="$ta hppa-dis.o" ;;
- bfd_i386_arch) ta="$ta i386-dis.o" ;;
+ bfd_d10v_arch) ta="$ta d10v-dis.lo d10v-opc.lo" ;;
+ bfd_h8300_arch) ta="$ta h8300-dis.lo" ;;
+ bfd_h8500_arch) ta="$ta h8500-dis.lo" ;;
+ bfd_hppa_arch) ta="$ta hppa-dis.lo" ;;
+ bfd_i386_arch) ta="$ta i386-dis.lo" ;;
bfd_i860_arch) ;;
- bfd_i960_arch) ta="$ta i960-dis.o" ;;
- bfd_m32r_arch) ta="$ta $cgen_files m32r-opc.o m32r-asm.o m32r-dis.o" ;;
- bfd_m68k_arch) ta="$ta m68k-dis.o m68k-opc.o" ;;
- bfd_m88k_arch) ta="$ta m88k-dis.o" ;;
- bfd_mips_arch) ta="$ta mips-dis.o mips-opc.o mips16-opc.o" ;;
- bfd_mn10200_arch) ta="$ta m10200-dis.o m10200-opc.o" ;;
- bfd_mn10300_arch) ta="$ta m10300-dis.o m10300-opc.o" ;;
- bfd_ns32k_arch) ta="$ta ns32k-dis.o" ;;
- bfd_powerpc_arch) ta="$ta ppc-dis.o ppc-opc.o" ;;
+ bfd_i960_arch) ta="$ta i960-dis.lo" ;;
+ bfd_m32r_arch) ta="$ta $cgen_files m32r-opc.lo m32r-asm.lo m32r-dis.lo" ;;
+ bfd_m68k_arch) ta="$ta m68k-dis.lo m68k-opc.lo" ;;
+ bfd_m88k_arch) ta="$ta m88k-dis.lo" ;;
+ bfd_mips_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo" ;;
+ bfd_mn10200_arch) ta="$ta m10200-dis.lo m10200-opc.lo" ;;
+ bfd_mn10300_arch) ta="$ta m10300-dis.lo m10300-opc.lo" ;;
+ bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;;
+ bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
bfd_pyramid_arch) ;;
bfd_romp_arch) ;;
- bfd_rs6000_arch) ta="$ta ppc-dis.o ppc-opc.o" ;;
- bfd_sh_arch) ta="$ta sh-dis.o" ;;
- bfd_sparc_arch) ta="$ta sparc-dis.o sparc-opc.o" ;;
+ bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
+ bfd_sh_arch) ta="$ta sh-dis.lo" ;;
+ bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;;
bfd_tahoe_arch) ;;
+ bfd_tic30_arch) ta="$ta tic30-dis.lo" ;;
+ bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
bfd_vax_arch) ;;
- bfd_w65_arch) ta="$ta w65-dis.o" ;;
+ bfd_w65_arch) ta="$ta w65-dis.lo" ;;
bfd_we32k_arch) ;;
- bfd_z8k_arch) ta="$ta z8k-dis.o" ;;
+ bfd_z8k_arch) ta="$ta z8k-dis.lo" ;;
"") ;;
*) { echo "configure: error: *** unknown target architecture $arch" 1>&2; exit 1; } ;;
@@ -1327,7 +1994,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -1394,7 +2061,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -1414,6 +2081,7 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
@@ -1450,23 +2118,27 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
-s%@CC@%$CC%g
-s%@HDEFINES@%$HDEFINES%g
-s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@ALLLIBS@%$ALLLIBS%g
-s%@PICFLAG@%$PICFLAG%g
-s%@SHLIB@%$SHLIB%g
-s%@SHLIB_CC@%$SHLIB_CC%g
-s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
-s%@SHLIB_LIBS@%$SHLIB_LIBS%g
-s%@COMMON_SHLIB@%$COMMON_SHLIB%g
-s%@SHLIB_DEP@%$SHLIB_DEP%g
-s%@BFD_PICLIST@%$BFD_PICLIST%g
-s%@SHLINK@%$SHLINK%g
-s%@INSTALL_SHLIB@%$INSTALL_SHLIB%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@AR@%$AR%g
+s%@RANLIB@%$RANLIB%g
+s%@CC@%$CC%g
+s%@LD@%$LD%g
+s%@NM@%$NM%g
+s%@LN_S@%$LN_S%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@MAINT@%$MAINT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@HDEFINES@%$HDEFINES%g
s%@CPP@%$CPP%g
s%@archdefs@%$archdefs%g
s%@BFD_MACHINES@%$BFD_MACHINES%g
@@ -1680,9 +2352,11 @@ fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
+
EOF
cat >> $CONFIG_STATUS <<\EOF
-case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
+test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
exit 0
EOF
chmod +x $CONFIG_STATUS
diff --git a/contrib/binutils/opcodes/configure.in b/contrib/binutils/opcodes/configure.in
index 67057a0..3a24a43 100644
--- a/contrib/binutils/opcodes/configure.in
+++ b/contrib/binutils/opcodes/configure.in
@@ -1,22 +1,30 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+
AC_PREREQ(2.5)
AC_INIT(z8k-dis.c)
-# configure.in script for the opcodes library.
-# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-# Written by Cygnus Support.
-#
-# 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.
+
+AC_CANONICAL_SYSTEM
+
+# We currently only use the version number for the name of any shared
+# library. For user convenience, we always use the same version
+# number that BFD is using.
+changequote(,)dnl
+BFD_VERSION=`grep INIT_AUTOMAKE ${srcdir}/../bfd/configure.in | sed -n -e 's/[ ]//g' -e 's/^.*,\(.*\)).*$/\1/p'`
+changequote([,])dnl
+
+AM_INIT_AUTOMAKE(opcodes, ${BFD_VERSION})
+
+dnl These must be called before AM_PROG_LIBTOOL, because it may want
+dnl to call AC_CHECK_PROG.
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+
+dnl Default to a non shared library. This may be overridden by the
+dnl configure option --enable-shared.
+AM_DISABLE_SHARED
+
+AM_PROG_LIBTOOL
AC_ARG_ENABLE(targets,
[ --enable-targets alternative target configurations],
@@ -26,14 +34,6 @@ AC_ARG_ENABLE(targets,
no) enable_targets= ;;
*) enable_targets=$enableval ;;
esac])dnl
-AC_ARG_ENABLE(shared,
-[ --enable-shared build shared opcodes library],
-[case "${enableval}" in
- yes) shared=true ;;
- no) shared=false ;;
- *opcodes*) shared=true ;;
- *) shared=false ;;
-esac])dnl
AC_ARG_ENABLE(commonbfdlib,
[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
[case "${enableval}" in
@@ -42,80 +42,29 @@ AC_ARG_ENABLE(commonbfdlib,
*) AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;;
esac])dnl
-AC_CONFIG_HEADER(config.h:config.in)
+AM_CONFIG_HEADER(config.h:config.in)
-AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
-AC_CANONICAL_SYSTEM
if test -z "$target" ; then
AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
fi
AC_ARG_PROGRAM
-# host-specific stuff:
+AM_MAINTAINER_MODE
+AM_CYGWIN32
+AM_EXEEXT
-ALLLIBS='$(TARGETLIB)'
-PICFLAG=
-SHLIB=unused-shlib
-SHLINK=unused-shlink
-if test "${shared}" = "true"; then
- ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
- PICFLAG=-fpic
- if test "${commonbfdlib}" = "true"; then
-changequote(,)dnl
- SHLIB=../bfd/libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
-changequote([,])dnl
- SHLINK=../bfd/libbfd.so
- else
-changequote(,)dnl
- SHLIB=libopcodes.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
-changequote([,])dnl
- SHLINK=libopcodes.so
- fi
-fi
+# host-specific stuff:
AC_PROG_CC
. ${srcdir}/../bfd/configure.host
AC_SUBST(HDEFINES)
-AC_CHECK_TOOL(AR, ar)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_PROG_INSTALL
-
-if test "${shared}" = "true"; then
- if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
- AC_MSG_WARN([opcodes --enable-shared only supported when using gcc])
- shared=false
- ALLLIBS='$(TARGETLIB)'
- PICFLAG=
- SHLIB=unused-shlib
- fi
-fi
-
-AC_SUBST(ALLLIBS)
-AC_SUBST(PICFLAG)
-AC_SUBST(SHLIB)
-AC_SUBST(SHLIB_CC)
-AC_SUBST(SHLIB_CFLAGS)
-AC_SUBST(SHLIB_LIBS)
-if test "${commonbfdlib}" = "true"; then
- COMMON_SHLIB=yes
- # Rebuild the shared library if libiberty or libbfd changes.
- SHLIB_DEP="../libiberty/libiberty.a ../bfd/libbfd.a"
- BFD_PICLIST=../bfd/piclist
-else
- COMMON_SHLIB=
- SHLIB_DEP=
- BFD_PICLIST=
-fi
-AC_SUBST(COMMON_SHLIB)
-AC_SUBST(SHLIB_DEP)
-AC_SUBST(BFD_PICLIST)
-AC_SUBST(SHLINK)
-AC_SUBST(INSTALL_SHLIB)
+AM_PROG_INSTALL
AC_CHECK_HEADERS(string.h strings.h stdlib.h)
+
# target-specific stuff:
# Canonicalize the secondary target names.
@@ -146,7 +95,7 @@ done
# Utility var, documents generic cgen support files.
-cgen_files="cgen-opc.o cgen-asm.o cgen-dis.o"
+cgen_files="cgen-opc.lo cgen-asm.lo cgen-dis.lo"
# We don't do any links based on the target system, just makefile config.
@@ -160,36 +109,39 @@ if test x${all_targets} = xfalse ; then
ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
archdefs="$archdefs -DARCH_$ad"
case "$arch" in
- bfd_a29k_arch) ta="$ta a29k-dis.o" ;;
+ bfd_a29k_arch) ta="$ta a29k-dis.lo" ;;
bfd_alliant_arch) ;;
- bfd_alpha_arch) ta="$ta alpha-dis.o alpha-opc.o" ;;
- bfd_arm_arch) ta="$ta arm-dis.o" ;;
+ bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;;
+ bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo" ;;
+ bfd_arm_arch) ta="$ta arm-dis.lo" ;;
bfd_convex_arch) ;;
- bfd_d10v_arch) ta="$ta d10v-dis.o d10v-opc.o" ;;
- bfd_h8300_arch) ta="$ta h8300-dis.o" ;;
- bfd_h8500_arch) ta="$ta h8500-dis.o" ;;
- bfd_hppa_arch) ta="$ta hppa-dis.o" ;;
- bfd_i386_arch) ta="$ta i386-dis.o" ;;
+ bfd_d10v_arch) ta="$ta d10v-dis.lo d10v-opc.lo" ;;
+ bfd_h8300_arch) ta="$ta h8300-dis.lo" ;;
+ bfd_h8500_arch) ta="$ta h8500-dis.lo" ;;
+ bfd_hppa_arch) ta="$ta hppa-dis.lo" ;;
+ bfd_i386_arch) ta="$ta i386-dis.lo" ;;
bfd_i860_arch) ;;
- bfd_i960_arch) ta="$ta i960-dis.o" ;;
- bfd_m32r_arch) ta="$ta $cgen_files m32r-opc.o m32r-asm.o m32r-dis.o" ;;
- bfd_m68k_arch) ta="$ta m68k-dis.o m68k-opc.o" ;;
- bfd_m88k_arch) ta="$ta m88k-dis.o" ;;
- bfd_mips_arch) ta="$ta mips-dis.o mips-opc.o mips16-opc.o" ;;
- bfd_mn10200_arch) ta="$ta m10200-dis.o m10200-opc.o" ;;
- bfd_mn10300_arch) ta="$ta m10300-dis.o m10300-opc.o" ;;
- bfd_ns32k_arch) ta="$ta ns32k-dis.o" ;;
- bfd_powerpc_arch) ta="$ta ppc-dis.o ppc-opc.o" ;;
+ bfd_i960_arch) ta="$ta i960-dis.lo" ;;
+ bfd_m32r_arch) ta="$ta $cgen_files m32r-opc.lo m32r-asm.lo m32r-dis.lo" ;;
+ bfd_m68k_arch) ta="$ta m68k-dis.lo m68k-opc.lo" ;;
+ bfd_m88k_arch) ta="$ta m88k-dis.lo" ;;
+ bfd_mips_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo" ;;
+ bfd_mn10200_arch) ta="$ta m10200-dis.lo m10200-opc.lo" ;;
+ bfd_mn10300_arch) ta="$ta m10300-dis.lo m10300-opc.lo" ;;
+ bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;;
+ bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
bfd_pyramid_arch) ;;
bfd_romp_arch) ;;
- bfd_rs6000_arch) ta="$ta ppc-dis.o ppc-opc.o" ;;
- bfd_sh_arch) ta="$ta sh-dis.o" ;;
- bfd_sparc_arch) ta="$ta sparc-dis.o sparc-opc.o" ;;
+ bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
+ bfd_sh_arch) ta="$ta sh-dis.lo" ;;
+ bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;;
bfd_tahoe_arch) ;;
+ bfd_tic30_arch) ta="$ta tic30-dis.lo" ;;
+ bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
bfd_vax_arch) ;;
- bfd_w65_arch) ta="$ta w65-dis.o" ;;
+ bfd_w65_arch) ta="$ta w65-dis.lo" ;;
bfd_we32k_arch) ;;
- bfd_z8k_arch) ta="$ta z8k-dis.o" ;;
+ bfd_z8k_arch) ta="$ta z8k-dis.lo" ;;
"") ;;
*) AC_MSG_ERROR(*** unknown target architecture $arch) ;;
@@ -226,5 +178,4 @@ fi
AC_SUBST(archdefs)
AC_SUBST(BFD_MACHINES)
-AC_OUTPUT(Makefile,
-[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
+AC_OUTPUT(Makefile)
diff --git a/contrib/binutils/opcodes/dep-in.sed b/contrib/binutils/opcodes/dep-in.sed
index ebf69eb..c30dee5 100644
--- a/contrib/binutils/opcodes/dep-in.sed
+++ b/contrib/binutils/opcodes/dep-in.sed
@@ -3,6 +3,7 @@
s/\\\n */ /g
t loop
+s!\.o:!.lo:!
s! @BFD_H@! $(BFD_H)!g
s!@INCDIR@!$(INCDIR)!g
s!@BFDDIR@!$(BFDDIR)!g
diff --git a/contrib/binutils/opcodes/dis-buf.c b/contrib/binutils/opcodes/dis-buf.c
index 47a2e33..befbd59 100644
--- a/contrib/binutils/opcodes/dis-buf.c
+++ b/contrib/binutils/opcodes/dis-buf.c
@@ -68,3 +68,13 @@ generic_print_address (addr, info)
{
(*info->fprintf_func) (info->stream, "0x%x", addr);
}
+
+/* Just return the given address. */
+
+int
+generic_symbol_at_address (addr, info)
+ bfd_vma addr;
+ struct disassemble_info * info;
+{
+ return 1;
+}
diff --git a/contrib/binutils/opcodes/disassemble.c b/contrib/binutils/opcodes/disassemble.c
index 66cff50..213ff7f 100644
--- a/contrib/binutils/opcodes/disassemble.c
+++ b/contrib/binutils/opcodes/disassemble.c
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef ARCH_all
#define ARCH_a29k
#define ARCH_alpha
+#define ARCH_arc
#define ARCH_arm
#define ARCH_d10v
#define ARCH_h8300
@@ -39,10 +40,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define ARCH_rs6000
#define ARCH_sh
#define ARCH_sparc
+#define ARCH_tic30
+#define ARCH_v850
#define ARCH_w65
#define ARCH_z8k
#endif
+
disassembler_ftype
disassembler (abfd)
bfd *abfd;
@@ -65,6 +69,14 @@ disassembler (abfd)
disassemble = print_insn_alpha;
break;
#endif
+#ifdef ARCH_arc
+ case bfd_arch_arc:
+ {
+ disassemble = arc_get_disassembler (bfd_get_mach (abfd),
+ bfd_big_endian (abfd));
+ break;
+ }
+#endif
#ifdef ARCH_arm
case bfd_arch_arm:
if (bfd_big_endian (abfd))
@@ -172,6 +184,16 @@ disassembler (abfd)
disassemble = print_insn_sparc;
break;
#endif
+#ifdef ARCH_tic30
+ case bfd_arch_tic30:
+ disassemble = print_insn_tic30;
+ break;
+#endif
+#ifdef ARCH_v850
+ case bfd_arch_v850:
+ disassemble = print_insn_v850;
+ break;
+#endif
#ifdef ARCH_w65
case bfd_arch_w65:
disassemble = print_insn_w65;
@@ -190,3 +212,4 @@ disassembler (abfd)
}
return disassemble;
}
+
diff --git a/contrib/binutils/opcodes/i386-dis.c b/contrib/binutils/opcodes/i386-dis.c
index a8f8c80..63b7d9c 100644
--- a/contrib/binutils/opcodes/i386-dis.c
+++ b/contrib/binutils/opcodes/i386-dis.c
@@ -1,5 +1,5 @@
/* Print i386 instructions for GDB, the GNU debugger.
- Copyright (C) 1988, 89, 91, 93, 94, 95, 96, 1997
+ Copyright (C) 1988, 89, 91, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GDB.
@@ -267,8 +267,8 @@ static struct dis386 dis386[] = {
{ "addS", Gv, Ev },
{ "addb", AL, Ib },
{ "addS", eAX, Iv },
- { "pushl", es },
- { "popl", es },
+ { "pushS", es },
+ { "popS", es },
/* 08 */
{ "orb", Eb, Gb },
{ "orS", Ev, Gv },
@@ -276,7 +276,7 @@ static struct dis386 dis386[] = {
{ "orS", Gv, Ev },
{ "orb", AL, Ib },
{ "orS", eAX, Iv },
- { "pushl", cs },
+ { "pushS", cs },
{ "(bad)" }, /* 0x0f extended opcode escape */
/* 10 */
{ "adcb", Eb, Gb },
@@ -285,8 +285,8 @@ static struct dis386 dis386[] = {
{ "adcS", Gv, Ev },
{ "adcb", AL, Ib },
{ "adcS", eAX, Iv },
- { "pushl", ss },
- { "popl", ss },
+ { "pushS", ss },
+ { "popS", ss },
/* 18 */
{ "sbbb", Eb, Gb },
{ "sbbS", Ev, Gv },
@@ -294,8 +294,8 @@ static struct dis386 dis386[] = {
{ "sbbS", Gv, Ev },
{ "sbbb", AL, Ib },
{ "sbbS", eAX, Iv },
- { "pushl", ds },
- { "popl", ds },
+ { "pushS", ds },
+ { "popS", ds },
/* 20 */
{ "andb", Eb, Gb },
{ "andS", Ev, Gv },
@@ -380,7 +380,7 @@ static struct dis386 dis386[] = {
/* 68 */
{ "pushS", Iv }, /* 386 book wrong */
{ "imulS", Gv, Ev, Iv },
- { "pushl", sIb }, /* push of byte really pushes 4 bytes */
+ { "pushS", sIb }, /* push of byte really pushes 2 or 4 bytes */
{ "imulS", Gv, Ev, Ib },
{ "insb", Yb, indirDX },
{ "insS", Yv, indirDX },
@@ -418,9 +418,9 @@ static struct dis386 dis386[] = {
{ "movS", Ev, Gv },
{ "movb", Gb, Eb },
{ "movS", Gv, Ev },
- { "movw", Ew, Sw },
+ { "movS", Ev, Sw },
{ "leaS", Gv, M },
- { "movw", Sw, Ew },
+ { "movS", Sw, Ev },
{ "popS", Ev },
/* 90 */
{ "nop" },
@@ -432,8 +432,8 @@ static struct dis386 dis386[] = {
{ "xchgS", eSI, eAX },
{ "xchgS", eDI, eAX },
/* 98 */
- { "cwtl" },
- { "cltd" },
+ { "cWtS" },
+ { "cStd" },
{ "lcall", Ap },
{ "(bad)" }, /* fwait */
{ "pushf" },
@@ -670,8 +670,8 @@ static struct dis386 dis386_twobyte[] = {
{ "setle", Eb },
{ "setg", Eb },
/* a0 */
- { "pushl", fs },
- { "popl", fs },
+ { "pushS", fs },
+ { "popS", fs },
{ "cpuid" },
{ "btS", Ev, Gv },
{ "shldS", Ev, Gv, Ib },
@@ -679,8 +679,8 @@ static struct dis386 dis386_twobyte[] = {
{ "(bad)" },
{ "(bad)" },
/* a8 */
- { "pushl", gs },
- { "popl", gs },
+ { "pushS", gs },
+ { "popS", gs },
{ "rsm" },
{ "btsS", Ev, Gv },
{ "shrdS", Ev, Gv, Ib },
@@ -734,12 +734,12 @@ static struct dis386 dis386_twobyte[] = {
/* d8 */
{ "psubusb", MX, EM },
{ "psubusw", MX, EM },
- { "pand", MX, EM },
{ "(bad)" },
+ { "pand", MX, EM },
{ "paddusb", MX, EM },
{ "paddusw", MX, EM },
{ "(bad)" },
- { "pand", MX, EM },
+ { "pandn", MX, EM },
/* e0 */
{ "(bad)" },
{ "psraw", MX, EM },
@@ -809,7 +809,7 @@ static const unsigned char twobyte_has_modrm[256] = {
/* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
/* b0 */ 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1, /* bf */
/* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
- /* d0 */ 0,1,1,1,0,1,0,0,1,1,1,0,1,1,0,1, /* df */
+ /* d0 */ 0,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1, /* df */
/* e0 */ 0,1,1,0,0,1,0,0,1,1,0,1,1,1,0,1, /* ef */
/* f0 */ 0,1,1,1,0,1,0,0,1,1,1,0,1,1,1,0 /* ff */
};
@@ -1164,6 +1164,8 @@ int
print_insn_x86 (pc, info, aflag, dflag)
bfd_vma pc;
disassemble_info *info;
+ int aflag;
+ int dflag;
{
struct dis386 *dp;
int i;
@@ -1229,7 +1231,10 @@ print_insn_x86 (pc, info, aflag, dflag)
if (prefixes & PREFIX_ADR)
{
aflag ^= 1;
- oappend ("addr16 ");
+ if (aflag)
+ oappend ("addr32 ");
+ else
+ oappend ("addr16 ");
}
if (*codep == 0x0f)
@@ -1660,6 +1665,13 @@ putop (template, aflag, dflag)
else
*obufp++ = 'w';
break;
+ case 'W':
+ /* operand size flag for cwtl, cbtw */
+ if (dflag)
+ *obufp++ = 'w';
+ else
+ *obufp++ = 'b';
+ break;
}
}
*obufp = 0;
@@ -1743,8 +1755,8 @@ OP_E (bytemode, aflag, dflag)
int havesib;
int havebase;
int base;
- int index;
- int scale;
+ int index = 0;
+ int scale = 0;
havesib = 0;
havebase = 1;
@@ -1771,7 +1783,9 @@ OP_E (bytemode, aflag, dflag)
break;
case 1:
FETCH_DATA (the_info, codep + 1);
- disp = *(char *)codep++;
+ disp = *codep++;
+ if ((disp & 0x80) != 0)
+ disp -= 0x100;
break;
case 2:
disp = get32 ();
@@ -1808,14 +1822,22 @@ OP_E (bytemode, aflag, dflag)
{
case 0:
if (rm == 6)
- disp = (short) get16 ();
+ {
+ disp = get16 ();
+ if ((disp & 0x8000) != 0)
+ disp -= 0x10000;
+ }
break;
case 1:
FETCH_DATA (the_info, codep + 1);
- disp = *(char *)codep++;
+ disp = *codep++;
+ if ((disp & 0x80) != 0)
+ disp -= 0x100;
break;
case 2:
- disp = (short) get16 ();
+ disp = get16 ();
+ if ((disp & 0x8000) != 0)
+ disp -= 0x10000;
break;
}
@@ -1979,16 +2001,24 @@ OP_sI (bytemode, aflag, dflag)
{
case b_mode:
FETCH_DATA (the_info, codep + 1);
- op = *(char *)codep++;
+ op = *codep++;
+ if ((op & 0x80) != 0)
+ op -= 0x100;
break;
case v_mode:
if (dflag)
op = get32 ();
else
- op = (short)get16();
+ {
+ op = get16();
+ if ((op & 0x8000) != 0)
+ op -= 0x10000;
+ }
break;
case w_mode:
- op = (short)get16 ();
+ op = get16 ();
+ if ((op & 0x8000) != 0)
+ op -= 0x10000;
break;
default:
oappend ("<internal disassembler error>");
@@ -2012,14 +2042,18 @@ OP_J (bytemode, aflag, dflag)
{
case b_mode:
FETCH_DATA (the_info, codep + 1);
- disp = *(char *)codep++;
+ disp = *codep++;
+ if ((disp & 0x80) != 0)
+ disp -= 0x100;
break;
case v_mode:
if (dflag)
disp = get32 ();
else
{
- disp = (short)get16 ();
+ disp = get16 ();
+ if ((disp & 0x8000) != 0)
+ disp -= 0x10000;
/* for some reason, a data16 prefix on a jump instruction
means that the pc is masked to 16 bits after the
displacement is added! */
@@ -2080,7 +2114,11 @@ OP_DIR (size, aflag, dflag)
if (aflag)
offset = get32 ();
else
- offset = (short)get16 ();
+ {
+ offset = get16 ();
+ if ((offset & 0x8000) != 0)
+ offset -= 0x10000;
+ }
offset = start_pc + codep - start_codep + offset;
set_op (offset);
@@ -2135,7 +2173,16 @@ OP_DSSI (dummy, aflag, dflag)
int aflag;
int dflag;
{
- oappend ("%ds:(");
+ if ((prefixes
+ & (PREFIX_CS
+ | PREFIX_DS
+ | PREFIX_SS
+ | PREFIX_ES
+ | PREFIX_FS
+ | PREFIX_GS)) == 0)
+ prefixes |= PREFIX_DS;
+ append_prefix ();
+ oappend ("(");
oappend (aflag ? "%esi" : "%si");
oappend (")");
return (0);
diff --git a/contrib/binutils/opcodes/sh-dis.c b/contrib/binutils/opcodes/sh-dis.c
index c83570e..2ebfdb6 100644
--- a/contrib/binutils/opcodes/sh-dis.c
+++ b/contrib/binutils/opcodes/sh-dis.c
@@ -1,5 +1,5 @@
/* Disassemble SH instructions.
- Copyright (C) 1993, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,28 +25,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define LITTLE_BIT 2
static int
-print_insn_shx(memaddr, info)
+print_insn_shx (memaddr, info)
bfd_vma memaddr;
struct disassemble_info *info;
{
- fprintf_ftype fprintf = info->fprintf_func;
+ fprintf_ftype fprintf_fn = info->fprintf_func;
void *stream = info->stream;
- unsigned char insn[2];
- unsigned char nibs[4];
+ unsigned char insn[2];
+ unsigned char nibs[4];
int status;
- int relmask = ~0;
+ bfd_vma relmask = ~ (bfd_vma) 0;
sh_opcode_info *op;
-
- status = info->read_memory_func(memaddr, insn, 2, info);
+
+ status = info->read_memory_func (memaddr, insn, 2, info);
if (status != 0)
{
- info->memory_error_func(status, memaddr, info);
+ info->memory_error_func (status, memaddr, info);
return -1;
}
-
-
if (info->flags & LITTLE_BIT)
{
nibs[0] = (insn[1] >> 4) & 0xf;
@@ -67,196 +65,245 @@ print_insn_shx(memaddr, info)
for (op = sh_table; op->name; op++)
{
int n;
- int imm;
- int rn;
- int rm;
- int rb;
-
- for (n = 0; n < 4; n++) {
- int i = op->nibbles[n];
- if (i < 16)
- {
- if (nibs[n] == i) continue;
- goto fail;
- }
- switch (i)
- {
- case BRANCH_8:
- imm = (nibs[2] << 4) | (nibs[3]);
- if (imm & 0x80)
- imm |= ~0xff;
- imm = ((char)imm) * 2 + 4 ;
- goto ok;
-
- case BRANCH_12:
- imm = ((nibs[1]) << 8) | (nibs[2] << 4) | (nibs[3]);
- if (imm & 0x800)
- imm |= ~0xfff;
- imm = imm * 2 + 4;
- goto ok;
- case IMM_4:
- imm = nibs[3];
- goto ok;
- case IMM_4BY2:
- imm = nibs[3] <<1;
- goto ok;
- case IMM_4BY4:
- imm = nibs[3] <<2;
- goto ok;
+ int imm = 0;
+ int rn = 0;
+ int rm = 0;
+ int rb = 0;
+ int disp_pc;
+ bfd_vma disp_pc_addr = 0;
-
- case IMM_8:
- imm = (nibs[2] << 4) | nibs[3];
- goto ok;
- case PCRELIMM_8BY2:
- imm = ((nibs[2] << 4) | nibs[3]) <<1;
- relmask = ~1;
-
- goto ok;
+ for (n = 0; n < 4; n++)
+ {
+ int i = op->nibbles[n];
- case PCRELIMM_8BY4:
- imm = ((nibs[2] << 4) | nibs[3]) <<2;
- relmask = ~3;
- goto ok;
-
- case IMM_8BY2:
- imm = ((nibs[2] << 4) | nibs[3]) <<1;
- goto ok;
- case IMM_8BY4:
- imm = ((nibs[2] << 4) | nibs[3]) <<2;
- goto ok;
- case DISP_8:
- imm = (nibs[2] << 4) | (nibs[3]);
- goto ok;
- case DISP_4:
- imm = nibs[3];
- goto ok;
- case REG_N:
- rn = nibs[n];
- break;
- case REG_M:
- rm = nibs[n];
- break;
- case REG_B:
- rb = nibs[n] & 0x07;
- break;
- default:
- abort();
- }
+ if (i < 16)
+ {
+ if (nibs[n] == i)
+ continue;
+ goto fail;
+ }
+ switch (i)
+ {
+ case BRANCH_8:
+ imm = (nibs[2] << 4) | (nibs[3]);
+ if (imm & 0x80)
+ imm |= ~0xff;
+ imm = ((char)imm) * 2 + 4 ;
+ goto ok;
+ case BRANCH_12:
+ imm = ((nibs[1]) << 8) | (nibs[2] << 4) | (nibs[3]);
+ if (imm & 0x800)
+ imm |= ~0xfff;
+ imm = imm * 2 + 4;
+ goto ok;
+ case IMM_4:
+ imm = nibs[3];
+ goto ok;
+ case IMM_4BY2:
+ imm = nibs[3] <<1;
+ goto ok;
+ case IMM_4BY4:
+ imm = nibs[3] <<2;
+ goto ok;
+ case IMM_8:
+ imm = (nibs[2] << 4) | nibs[3];
+ goto ok;
+ case PCRELIMM_8BY2:
+ imm = ((nibs[2] << 4) | nibs[3]) <<1;
+ relmask = ~ (bfd_vma) 1;
+ goto ok;
+ case PCRELIMM_8BY4:
+ imm = ((nibs[2] << 4) | nibs[3]) <<2;
+ relmask = ~ (bfd_vma) 3;
+ goto ok;
+ case IMM_8BY2:
+ imm = ((nibs[2] << 4) | nibs[3]) <<1;
+ goto ok;
+ case IMM_8BY4:
+ imm = ((nibs[2] << 4) | nibs[3]) <<2;
+ goto ok;
+ case DISP_8:
+ imm = (nibs[2] << 4) | (nibs[3]);
+ goto ok;
+ case DISP_4:
+ imm = nibs[3];
+ goto ok;
+ case REG_N:
+ rn = nibs[n];
+ break;
+ case REG_M:
+ rm = nibs[n];
+ break;
+ case REG_NM:
+ rn = (nibs[n] & 0xc) >> 2;
+ rm = (nibs[n] & 0x3);
+ break;
+ case REG_B:
+ rb = nibs[n] & 0x07;
+ break;
+ default:
+ abort();
+ }
+ }
- }
ok:
- fprintf(stream,"%s\t", op->name);
+ fprintf_fn (stream,"%s\t", op->name);
+ disp_pc = 0;
for (n = 0; n < 3 && op->arg[n] != A_END; n++)
{
if (n && op->arg[1] != A_END)
- fprintf(stream,",");
+ fprintf_fn (stream, ",");
switch (op->arg[n])
{
case A_IMM:
- fprintf(stream,"#%d", (char)(imm));
+ fprintf_fn (stream, "#%d", (char)(imm));
break;
case A_R0:
- fprintf(stream,"r0");
+ fprintf_fn (stream, "r0");
break;
case A_REG_N:
- fprintf(stream,"r%d", rn);
+ fprintf_fn (stream, "r%d", rn);
break;
case A_INC_N:
- fprintf(stream,"@r%d+", rn);
+ fprintf_fn (stream, "@r%d+", rn);
break;
case A_DEC_N:
- fprintf(stream,"@-r%d", rn);
+ fprintf_fn (stream, "@-r%d", rn);
break;
case A_IND_N:
- fprintf(stream,"@r%d", rn);
+ fprintf_fn (stream, "@r%d", rn);
break;
case A_DISP_REG_N:
- fprintf(stream,"@(%d,r%d)",imm, rn);
+ fprintf_fn (stream, "@(%d,r%d)", imm, rn);
break;
case A_REG_M:
- fprintf(stream,"r%d", rm);
+ fprintf_fn (stream, "r%d", rm);
break;
case A_INC_M:
- fprintf(stream,"@r%d+", rm);
+ fprintf_fn (stream, "@r%d+", rm);
break;
case A_DEC_M:
- fprintf(stream,"@-r%d", rm);
+ fprintf_fn (stream, "@-r%d", rm);
break;
case A_IND_M:
- fprintf(stream,"@r%d", rm);
+ fprintf_fn (stream, "@r%d", rm);
break;
case A_DISP_REG_M:
- fprintf(stream,"@(%d,r%d)",imm, rm);
+ fprintf_fn (stream, "@(%d,r%d)", imm, rm);
break;
- case A_REG_B:
- fprintf(stream,"r%d_bank", rb);
+ case A_REG_B:
+ fprintf_fn (stream, "r%d_bank", rb);
break;
case A_DISP_PC:
- fprintf(stream,"0x%0x", imm+ 4+(memaddr&relmask));
+ disp_pc = 1;
+ disp_pc_addr = imm + 4 + (memaddr & relmask);
+ (*info->print_address_func) (disp_pc_addr, info);
break;
case A_IND_R0_REG_N:
- fprintf(stream,"@(r0,r%d)", rn);
+ fprintf_fn (stream, "@(r0,r%d)", rn);
break;
case A_IND_R0_REG_M:
- fprintf(stream,"@(r0,r%d)", rm);
+ fprintf_fn (stream, "@(r0,r%d)", rm);
break;
case A_DISP_GBR:
- fprintf(stream,"@(%d,gbr)",imm);
+ fprintf_fn (stream, "@(%d,gbr)",imm);
break;
case A_R0_GBR:
- fprintf(stream,"@(r0,gbr)");
+ fprintf_fn (stream, "@(r0,gbr)");
break;
case A_BDISP12:
case A_BDISP8:
(*info->print_address_func) (imm + memaddr, info);
break;
case A_SR:
- fprintf(stream,"sr");
+ fprintf_fn (stream, "sr");
break;
case A_GBR:
- fprintf(stream,"gbr");
+ fprintf_fn (stream, "gbr");
break;
case A_VBR:
- fprintf(stream,"vbr");
+ fprintf_fn (stream, "vbr");
break;
case A_SSR:
- fprintf(stream,"ssr");
+ fprintf_fn (stream, "ssr");
break;
case A_SPC:
- fprintf(stream,"spc");
+ fprintf_fn (stream, "spc");
break;
case A_MACH:
- fprintf(stream,"mach");
+ fprintf_fn (stream, "mach");
break;
case A_MACL:
- fprintf(stream,"macl");
+ fprintf_fn (stream ,"macl");
break;
case A_PR:
- fprintf(stream,"pr");
+ fprintf_fn (stream, "pr");
+ break;
+ case A_SGR:
+ fprintf_fn (stream, "sgr");
+ break;
+ case A_DBR:
+ fprintf_fn (stream, "dbr");
break;
+ case FD_REG_N:
+ if (0)
+ goto d_reg_n;
case F_REG_N:
- fprintf(stream,"fr%d", rn);
+ fprintf_fn (stream, "fr%d", rn);
break;
case F_REG_M:
- fprintf(stream,"fr%d", rm);
+ fprintf_fn (stream, "fr%d", rm);
+ break;
+ case DX_REG_N:
+ if (rn & 1)
+ {
+ fprintf_fn (stream, "xd%d", rn & ~1);
+ break;
+ }
+ d_reg_n:
+ case D_REG_N:
+ fprintf_fn (stream, "dr%d", rn);
+ break;
+ case DX_REG_M:
+ if (rm & 1)
+ {
+ fprintf_fn (stream, "xd%d", rm & ~1);
+ break;
+ }
+ case D_REG_M:
+ fprintf_fn (stream, "dr%d", rm);
break;
case FPSCR_M:
case FPSCR_N:
- fprintf(stream,"fpscr");
+ fprintf_fn (stream, "fpscr");
break;
case FPUL_M:
case FPUL_N:
- fprintf(stream,"fpul");
+ fprintf_fn (stream, "fpul");
break;
case F_FR0:
- fprintf(stream,"fr0");
+ fprintf_fn (stream, "fr0");
+ break;
+ case V_REG_N:
+ fprintf_fn (stream, "fv%d", rn*4);
+ break;
+ case V_REG_M:
+ fprintf_fn (stream, "fv%d", rm*4);
+ break;
+ case XMTRX_M4:
+ fprintf_fn (stream, "xmtrx");
break;
default:
abort();
}
-
}
+
+#if 0
+ /* This code prints instructions in delay slots on the same line
+ as the instruction which needs the delay slots. This can be
+ confusing, since other disassembler don't work this way, and
+ it means that the instructions are not all in a line. So I
+ disabled it. Ian. */
if (!(info->flags & 1)
&& (op->name[0] == 'j'
|| (op->name[0] == 'b'
@@ -266,40 +313,75 @@ print_insn_shx(memaddr, info)
|| (op->name[0] == 'b' && op->name[2] == '.')))
{
info->flags |= 1;
- fprintf(stream,"\t(slot "); print_insn_shx(memaddr +2, info);
+ fprintf_fn (stream, "\t(slot ");
+ print_insn_shx (memaddr + 2, info);
info->flags &= ~1;
- fprintf(stream,")");
+ fprintf_fn (stream, ")");
return 4;
}
-
+#endif
+
+ if (disp_pc && strcmp (op->name, "mova") != 0)
+ {
+ int size;
+ bfd_byte bytes[4];
+
+ if (relmask == ~ (bfd_vma) 1)
+ size = 2;
+ else
+ size = 4;
+ status = info->read_memory_func (disp_pc_addr, bytes, size, info);
+ if (status == 0)
+ {
+ unsigned int val;
+
+ if (size == 2)
+ {
+ if ((info->flags & LITTLE_BIT) != 0)
+ val = bfd_getl16 (bytes);
+ else
+ val = bfd_getb16 (bytes);
+ }
+ else
+ {
+ if ((info->flags & LITTLE_BIT) != 0)
+ val = bfd_getl32 (bytes);
+ else
+ val = bfd_getb32 (bytes);
+ }
+ fprintf_fn (stream, "\t! 0x%x", val);
+ }
+ }
+
return 2;
fail:
;
}
- fprintf(stream,".word 0x%x%x%x%x", nibs[0], nibs[1], nibs[2], nibs[3]);
+ fprintf_fn (stream, ".word 0x%x%x%x%x", nibs[0], nibs[1], nibs[2], nibs[3]);
return 2;
}
-
int
-print_insn_shl(memaddr, info)
+print_insn_shl (memaddr, info)
bfd_vma memaddr;
struct disassemble_info *info;
{
int r;
+
info->flags = LITTLE_BIT;
- r =print_insn_shx (memaddr, info);
+ r = print_insn_shx (memaddr, info);
return r;
}
int
-print_insn_sh(memaddr, info)
+print_insn_sh (memaddr, info)
bfd_vma memaddr;
struct disassemble_info *info;
{
int r;
+
info->flags = 0;
- r =print_insn_shx (memaddr, info);
+ r = print_insn_shx (memaddr, info);
return r;
}
diff --git a/contrib/binutils/opcodes/sh-opc.h b/contrib/binutils/opcodes/sh-opc.h
index cc75e79..dc1aae5 100644
--- a/contrib/binutils/opcodes/sh-opc.h
+++ b/contrib/binutils/opcodes/sh-opc.h
@@ -34,6 +34,7 @@ typedef enum {
HEX_F,
REG_N,
REG_M,
+ REG_NM,
REG_B,
BRANCH_12,
BRANCH_8,
@@ -79,8 +80,20 @@ typedef enum {
A_VBR,
A_SSR,
A_SPC,
+ A_SGR,
+ A_DBR,
F_REG_N,
F_REG_M,
+ D_REG_N,
+ D_REG_M,
+ X_REG_N, /* Only used for argument parsing */
+ X_REG_M, /* Only used for argument parsing */
+ DX_REG_N,
+ DX_REG_M,
+ V_REG_N,
+ V_REG_M,
+ FD_REG_N,
+ XMTRX_M4,
F_FR0,
FPUL_N,
FPUL_M,
@@ -180,6 +193,8 @@ sh_opcode_info sh_table[] = {
/* 0100nnnn01001110 ldc <REG_N>,SPC */{"ldc",{A_REG_N,A_SPC},{HEX_4,REG_N,HEX_4,HEX_E}},
+/* 0100nnnn01111110 ldc <REG_N>,DBR */{"ldc",{A_REG_N,A_DBR},{HEX_4,REG_N,HEX_7,HEX_E}},
+
/* 0100nnnn1xxx1110 ldc <REG_N>,Rn_BANK */{"ldc",{A_REG_N,A_REG_B},{HEX_4,REG_N,REG_B,HEX_E}},
/* 0100nnnn00000111 ldc.l @<REG_N>+,SR */{"ldc.l",{A_INC_N,A_SR},{HEX_4,REG_N,HEX_0,HEX_7}},
@@ -192,6 +207,8 @@ sh_opcode_info sh_table[] = {
/* 0100nnnn01000111 ldc.l @<REG_N>+,SPC */{"ldc.l",{A_INC_N,A_SPC},{HEX_4,REG_N,HEX_4,HEX_7}},
+/* 0100nnnn01110111 ldc.l @<REG_N>+,DBR */{"ldc.l",{A_INC_N,A_DBR},{HEX_4,REG_N,HEX_7,HEX_7}},
+
/* 0100nnnn1xxx0111 ldc.l <REG_N>,Rn_BANK */{"ldc.l",{A_INC_N,A_REG_B},{HEX_4,REG_N,REG_B,HEX_7}},
/* 0100nnnn00001010 lds <REG_N>,MACH */{"lds",{A_REG_N,A_MACH},{HEX_4,REG_N,HEX_0,HEX_A}},
@@ -287,6 +304,8 @@ sh_opcode_info sh_table[] = {
/* 11000001i8*2.... mov.w R0,@(<disp>,GBR)*/{"mov.w",{A_R0,A_DISP_GBR},{HEX_C,HEX_1,IMM_8BY2}},
/* 11000111i8p4.... mova @(<disp>,PC),R0*/{"mova",{A_DISP_PC,A_R0},{HEX_C,HEX_7,PCRELIMM_8BY4}},
+/* 0000nnnn11000011 movca.l R0,@<REG_N> */{"movca.l",{A_R0,A_IND_N},{HEX_0,REG_N,HEX_C,HEX_3}},
+
/* 0000nnnn00101001 movt <REG_N> */{"movt",{A_REG_N},{HEX_0,REG_N,HEX_2,HEX_9}},
@@ -303,6 +322,12 @@ sh_opcode_info sh_table[] = {
/* 0000000000001001 nop */{"nop",{0},{HEX_0,HEX_0,HEX_0,HEX_9}},
/* 0110nnnnmmmm0111 not <REG_M>,<REG_N> */{"not",{ A_REG_M,A_REG_N},{HEX_6,REG_N,REG_M,HEX_7}},
+/* 0000nnnn10010011 ocbi @<REG_N> */{"ocbi",{A_IND_N},{HEX_0,REG_N,HEX_9,HEX_3}},
+
+/* 0000nnnn10100011 ocbp @<REG_N> */{"ocbp",{A_IND_N},{HEX_0,REG_N,HEX_A,HEX_3}},
+
+/* 0000nnnn10110011 ocbwb @<REG_N> */{"ocbwb",{A_IND_N},{HEX_0,REG_N,HEX_B,HEX_3}},
+
/* 11001011i8*1.... or #<imm>,R0 */{"or",{A_IMM,A_R0},{HEX_C,HEX_B,IMM_8}},
@@ -363,6 +388,10 @@ sh_opcode_info sh_table[] = {
/* 0000nnnn01000010 stc SPC,<REG_N> */{"stc",{A_SPC,A_REG_N},{HEX_0,REG_N,HEX_4,HEX_2}},
+/* 0000nnnn01100010 stc SGR,<REG_N> */{"stc",{A_SGR,A_REG_N},{HEX_0,REG_N,HEX_6,HEX_2}},
+
+/* 0000nnnn01110010 stc DBR,<REG_N> */{"stc",{A_DBR,A_REG_N},{HEX_0,REG_N,HEX_7,HEX_2}},
+
/* 0000nnnn1xxx0012 stc Rn_BANK,<REG_N> */{"stc",{A_REG_B,A_REG_N},{HEX_0,REG_N,REG_B,HEX_2}},
/* 0100nnnn00000011 stc.l SR,@-<REG_N> */{"stc.l",{A_SR,A_DEC_N},{HEX_4,REG_N,HEX_0,HEX_3}},
@@ -375,6 +404,10 @@ sh_opcode_info sh_table[] = {
/* 0100nnnn01000011 stc.l SPC,@-<REG_N> */{"stc.l",{A_SPC,A_DEC_N},{HEX_4,REG_N,HEX_4,HEX_3}},
+/* 0100nnnn01100011 stc.l SGR,@-<REG_N> */{"stc.l",{A_SGR,A_DEC_N},{HEX_4,REG_N,HEX_6,HEX_3}},
+
+/* 0100nnnn01110011 stc.l DBR,@-<REG_N> */{"stc.l",{A_DBR,A_DEC_N},{HEX_4,REG_N,HEX_7,HEX_3}},
+
/* 0100nnnn1xxx0012 stc.l Rn_BANK,@-<REG_N> */{"stc.l",{A_REG_B,A_DEC_N},{HEX_4,REG_N,REG_B,HEX_3}},
/* 0000nnnn00001010 sts MACH,<REG_N> */{"sts",{A_MACH,A_REG_N},{HEX_0,REG_N,HEX_0,HEX_A}},
@@ -439,15 +472,25 @@ sh_opcode_info sh_table[] = {
/* 0000nnnn00000011 bsrf <REG_N> */{"bsrf",{A_REG_N},{HEX_0,REG_N,HEX_0,HEX_3}},
-/* 1111nnnn01011101 fabs <F_REG_N> */{"fabs",{F_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}},
+/* 1111nnnn01011101 fabs <F_REG_N> */{"fabs",{FD_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}},
/* 1111nnnnmmmm0000 fadd <F_REG_M>,<F_REG_N>*/{"fadd",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_0}},
+/* 1111nnn0mmm00000 fadd <D_REG_M>,<D_REG_N>*/{"fadd",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_0}},
/* 1111nnnnmmmm0100 fcmp/eq <F_REG_M>,<F_REG_N>*/{"fcmp/eq",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_4}},
+/* 1111nnn0mmm00100 fcmp/eq <D_REG_M>,<D_REG_N>*/{"fcmp/eq",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_4}},
/* 1111nnnnmmmm0101 fcmp/gt <F_REG_M>,<F_REG_N>*/{"fcmp/gt",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_5}},
+/* 1111nnn0mmm00101 fcmp/gt <D_REG_M>,<D_REG_N>*/{"fcmp/gt",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_5}},
+
+/* 1111nnn010111101 fcnvds <D_REG_N>,FPUL*/{"fcnvds",{D_REG_N,FPUL_M},{HEX_F,REG_N,HEX_B,HEX_D}},
+
+/* 1111nnn010101101 fcnvsd FPUL,<D_REG_N>*/{"fcnvsd",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_A,HEX_D}},
/* 1111nnnnmmmm0011 fdiv <F_REG_M>,<F_REG_N>*/{"fdiv",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_3}},
+/* 1111nnn0mmm00011 fdiv <D_REG_M>,<D_REG_N>*/{"fdiv",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_3}},
+
+/* 1111nnmm11101101 fipr <V_REG_M>,<V_REG_N>*/{"fipr",{V_REG_M,V_REG_N},{HEX_F,REG_NM,HEX_E,HEX_D}},
/* 1111nnnn10001101 fldi0 <F_REG_N> */{"fldi0",{F_REG_N},{HEX_F,REG_N,HEX_8,HEX_D}},
@@ -455,11 +498,42 @@ sh_opcode_info sh_table[] = {
/* 1111nnnn00011101 flds <F_REG_N>,FPUL*/{"flds",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_1,HEX_D}},
-/* 1111nnnn00101101 float FPUL,<F_REG_N>*/{"float",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}},
+/* 1111nnnn00101101 float FPUL,<FD_REG_N>*/{"float",{FPUL_M,FD_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}},
/* 1111nnnnmmmm1110 fmac FR0,<F_REG_M>,<F_REG_N>*/{"fmac",{F_FR0,F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_E}},
/* 1111nnnnmmmm1100 fmov <F_REG_M>,<F_REG_N>*/{"fmov",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_C}},
+/* 1111nnnnmmmm1100 fmov <DX_REG_M>,<DX_REG_N>*/{"fmov",{DX_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_C}},
+
+/* 1111nnnnmmmm1000 fmov @<REG_M>,<F_REG_N>*/{"fmov",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}},
+/* 1111nnnnmmmm1000 fmov @<REG_M>,<DX_REG_N>*/{"fmov",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}},
+
+/* 1111nnnnmmmm1010 fmov <F_REG_M>,@<REG_N>*/{"fmov",{F_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}},
+/* 1111nnnnmmmm1010 fmov <DX_REG_M>,@<REG_N>*/{"fmov",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}},
+
+/* 1111nnnnmmmm1001 fmov @<REG_M>+,<F_REG_N>*/{"fmov",{A_INC_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_9}},
+/* 1111nnnnmmmm1001 fmov @<REG_M>+,<DX_REG_N>*/{"fmov",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}},
+
+/* 1111nnnnmmmm1011 fmov <F_REG_M>,@-<REG_N>*/{"fmov",{F_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}},
+/* 1111nnnnmmmm1011 fmov <DX_REG_M>,@-<REG_N>*/{"fmov",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}},
+
+/* 1111nnnnmmmm0110 fmov @(R0,<REG_M>),<F_REG_N>*/{"fmov",{A_IND_R0_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_6}},
+/* 1111nnnnmmmm0110 fmov @(R0,<REG_M>),<DX_REG_N>*/{"fmov",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}},
+
+/* 1111nnnnmmmm0111 fmov <F_REG_M>,@(R0,<REG_N>)*/{"fmov",{F_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}},
+/* 1111nnnnmmmm0111 fmov <DX_REG_M>,@(R0,<REG_N>)*/{"fmov",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}},
+
+/* 1111nnnnmmmm1000 fmov.d @<REG_M>,<DX_REG_N>*/{"fmov.d",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}},
+
+/* 1111nnnnmmmm1010 fmov.d <DX_REG_M>,@<REG_N>*/{"fmov.d",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}},
+
+/* 1111nnnnmmmm1001 fmov.d @<REG_M>+,<DX_REG_N>*/{"fmov.d",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}},
+
+/* 1111nnnnmmmm1011 fmov.d <DX_REG_M>,@-<REG_N>*/{"fmov.d",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}},
+
+/* 1111nnnnmmmm0110 fmov.d @(R0,<REG_M>),<DX_REG_N>*/{"fmov.d",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}},
+
+/* 1111nnnnmmmm0111 fmov.d <DX_REG_M>,@(R0,<REG_N>)*/{"fmov.d",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}},
/* 1111nnnnmmmm1000 fmov.s @<REG_M>,<F_REG_N>*/{"fmov.s",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}},
@@ -474,18 +548,24 @@ sh_opcode_info sh_table[] = {
/* 1111nnnnmmmm0111 fmov.s <F_REG_M>,@(R0,<REG_N>)*/{"fmov.s",{F_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}},
/* 1111nnnnmmmm0010 fmul <F_REG_M>,<F_REG_N>*/{"fmul",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_2}},
+/* 1111nnn0mmm00010 fmul <D_REG_M>,<D_REG_N>*/{"fmul",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_2}},
+
+/* 1111nnnn01001101 fneg <FD_REG_N> */{"fneg",{FD_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}},
+
+/* 1111101111111101 frchg */{"frchg",{0},{HEX_F,HEX_B,HEX_F,HEX_D}},
-/* 1111nnnn01001101 fneg <F_REG_N> */{"fneg",{F_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}},
+/* 1111001111111101 fschg */{"fschg",{0},{HEX_F,HEX_3,HEX_F,HEX_D}},
-/* 1111nnnn01101101 fsqrt <F_REG_N> */{"fsqrt",{F_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}},
+/* 1111nnnn01101101 fsqrt <FD_REG_N> */{"fsqrt",{FD_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}},
/* 1111nnnn00001101 fsts FPUL,<F_REG_N>*/{"fsts",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_0,HEX_D}},
/* 1111nnnnmmmm0001 fsub <F_REG_M>,<F_REG_N>*/{"fsub",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_1}},
+/* 1111nnn0mmm00001 fsub <D_REG_M>,<D_REG_N>*/{"fsub",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_1}},
-/* 1111nnnn00111101 ftrc <F_REG_M>,FPUL*/{"ftrc",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_3,HEX_D}},
+/* 1111nnnn00111101 ftrc <FD_REG_N>,FPUL*/{"ftrc",{FD_REG_N,FPUL_M},{HEX_F,REG_N,HEX_3,HEX_D}},
-/* 1111nnnn01111101 ftst/nan <F_REG_N> */{"ftst/nan",{F_REG_N},{HEX_F,REG_N,HEX_7,HEX_D}},
+/* 1111nn0111111101 ftrv XMTRX_M4,<V_REG_n>*/{"ftrv",{XMTRX_M4,V_REG_N},{HEX_F,REG_NM,HEX_F,HEX_D}},
{ 0 }
};
diff --git a/contrib/binutils/opcodes/stamp-h.in b/contrib/binutils/opcodes/stamp-h.in
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/contrib/binutils/opcodes/stamp-h.in
@@ -0,0 +1 @@
+timestamp
diff --git a/contrib/binutils/opcodes/tic30-dis.c b/contrib/binutils/opcodes/tic30-dis.c
new file mode 100644
index 0000000..1051457
--- /dev/null
+++ b/contrib/binutils/opcodes/tic30-dis.c
@@ -0,0 +1,711 @@
+/* Disassembly routines for TMS320C30 architecture
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
+
+ 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 <errno.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#include "dis-asm.h"
+#include "opcode/tic30.h"
+
+#define NORMAL_INSN 1
+#define PARALLEL_INSN 2
+
+/* Gets the type of instruction based on the top 2 or 3 bits of the
+ instruction word. */
+#define GET_TYPE(insn) (insn & 0x80000000 ? insn & 0xC0000000 : insn & 0xE0000000)
+
+/* Instruction types. */
+#define TWO_OPERAND_1 0x00000000
+#define TWO_OPERAND_2 0x40000000
+#define THREE_OPERAND 0x20000000
+#define PAR_STORE 0xC0000000
+#define MUL_ADDS 0x80000000
+#define BRANCHES 0x60000000
+
+/* Specific instruction id bits. */
+#define NORMAL_IDEN 0x1F800000
+#define PAR_STORE_IDEN 0x3E000000
+#define MUL_ADD_IDEN 0x2C000000
+#define BR_IMM_IDEN 0x1F000000
+#define BR_COND_IDEN 0x1C3F0000
+
+/* Addressing modes. */
+#define AM_REGISTER 0x00000000
+#define AM_DIRECT 0x00200000
+#define AM_INDIRECT 0x00400000
+#define AM_IMM 0x00600000
+
+#define P_FIELD 0x03000000
+
+#define REG_AR0 0x08
+#define LDP_INSN 0x08700000
+
+/* TMS320C30 program counter for current instruction. */
+static unsigned int _pc;
+
+struct instruction
+ {
+ int type;
+ template *tm;
+ partemplate *ptm;
+ };
+
+int get_tic30_instruction PARAMS ((unsigned long, struct instruction *));
+int print_two_operand
+ PARAMS ((disassemble_info *, unsigned long, struct instruction *));
+int print_three_operand
+ PARAMS ((disassemble_info *, unsigned long, struct instruction *));
+int print_par_insn
+ PARAMS ((disassemble_info *, unsigned long, struct instruction *));
+int print_branch
+ PARAMS ((disassemble_info *, unsigned long, struct instruction *));
+int get_indirect_operand PARAMS ((unsigned short, int, char *));
+int get_register_operand PARAMS ((unsigned char, char *));
+int cnvt_tmsfloat_ieee PARAMS ((unsigned long, int, float *));
+
+int
+print_insn_tic30 (pc, info)
+ bfd_vma pc;
+ disassemble_info *info;
+{
+ unsigned long insn_word;
+ struct instruction insn =
+ {0, NULL, NULL};
+ bfd_vma bufaddr = pc - info->buffer_vma;
+ /* Obtain the current instruction word from the buffer. */
+ insn_word = (*(info->buffer + bufaddr) << 24) | (*(info->buffer + bufaddr + 1) << 16) |
+ (*(info->buffer + bufaddr + 2) << 8) | *(info->buffer + bufaddr + 3);
+ _pc = pc / 4;
+ /* Get the instruction refered to by the current instruction word
+ and print it out based on its type. */
+ if (!get_tic30_instruction (insn_word, &insn))
+ return -1;
+ switch (GET_TYPE (insn_word))
+ {
+ case TWO_OPERAND_1:
+ case TWO_OPERAND_2:
+ if (!print_two_operand (info, insn_word, &insn))
+ return -1;
+ break;
+ case THREE_OPERAND:
+ if (!print_three_operand (info, insn_word, &insn))
+ return -1;
+ break;
+ case PAR_STORE:
+ case MUL_ADDS:
+ if (!print_par_insn (info, insn_word, &insn))
+ return -1;
+ break;
+ case BRANCHES:
+ if (!print_branch (info, insn_word, &insn))
+ return -1;
+ break;
+ }
+ return 4;
+}
+
+int
+get_tic30_instruction (insn_word, insn)
+ unsigned long insn_word;
+ struct instruction *insn;
+{
+ switch (GET_TYPE (insn_word))
+ {
+ case TWO_OPERAND_1:
+ case TWO_OPERAND_2:
+ case THREE_OPERAND:
+ insn->type = NORMAL_INSN;
+ {
+ template *current_optab = (template *) tic30_optab;
+ for (; current_optab < tic30_optab_end; current_optab++)
+ {
+ if (GET_TYPE (current_optab->base_opcode) == GET_TYPE (insn_word))
+ {
+ if (current_optab->operands == 0)
+ {
+ if (current_optab->base_opcode == insn_word)
+ {
+ insn->tm = current_optab;
+ break;
+ }
+ }
+ else if ((current_optab->base_opcode & NORMAL_IDEN) == (insn_word & NORMAL_IDEN))
+ {
+ insn->tm = current_optab;
+ break;
+ }
+ }
+ }
+ }
+ break;
+ case PAR_STORE:
+ insn->type = PARALLEL_INSN;
+ {
+ partemplate *current_optab = (partemplate *) tic30_paroptab;
+ for (; current_optab < tic30_paroptab_end; current_optab++)
+ {
+ if (GET_TYPE (current_optab->base_opcode) == GET_TYPE (insn_word))
+ {
+ if ((current_optab->base_opcode & PAR_STORE_IDEN) == (insn_word & PAR_STORE_IDEN))
+ {
+ insn->ptm = current_optab;
+ break;
+ }
+ }
+ }
+ }
+ break;
+ case MUL_ADDS:
+ insn->type = PARALLEL_INSN;
+ {
+ partemplate *current_optab = (partemplate *) tic30_paroptab;
+ for (; current_optab < tic30_paroptab_end; current_optab++)
+ {
+ if (GET_TYPE (current_optab->base_opcode) == GET_TYPE (insn_word))
+ {
+ if ((current_optab->base_opcode & MUL_ADD_IDEN) == (insn_word & MUL_ADD_IDEN))
+ {
+ insn->ptm = current_optab;
+ break;
+ }
+ }
+ }
+ }
+ break;
+ case BRANCHES:
+ insn->type = NORMAL_INSN;
+ {
+ template *current_optab = (template *) tic30_optab;
+ for (; current_optab < tic30_optab_end; current_optab++)
+ {
+ if (GET_TYPE (current_optab->base_opcode) == GET_TYPE (insn_word))
+ {
+ if (current_optab->operand_types[0] & Imm24)
+ {
+ if ((current_optab->base_opcode & BR_IMM_IDEN) == (insn_word & BR_IMM_IDEN))
+ {
+ insn->tm = current_optab;
+ break;
+ }
+ }
+ else if (current_optab->operands > 0)
+ {
+ if ((current_optab->base_opcode & BR_COND_IDEN) == (insn_word & BR_COND_IDEN))
+ {
+ insn->tm = current_optab;
+ break;
+ }
+ }
+ else
+ {
+ if ((current_optab->base_opcode & (BR_COND_IDEN | 0x00800000)) == (insn_word & (BR_COND_IDEN | 0x00800000)))
+ {
+ insn->tm = current_optab;
+ break;
+ }
+ }
+ }
+ }
+ }
+ break;
+ default:
+ return 0;
+ }
+ return 1;
+}
+
+int
+print_two_operand (info, insn_word, insn)
+ disassemble_info *info;
+ unsigned long insn_word;
+ struct instruction *insn;
+{
+ char name[12];
+ char operand[2][13] =
+ {
+ {0},
+ {0}};
+ float f_number;
+
+ if (insn->tm == NULL)
+ return 0;
+ strcpy (name, insn->tm->name);
+ if (insn->tm->opcode_modifier == AddressMode)
+ {
+ int src_op, dest_op;
+ /* Determine whether instruction is a store or a normal instruction. */
+ if ((insn->tm->operand_types[1] & (Direct | Indirect)) == (Direct | Indirect))
+ {
+ src_op = 1;
+ dest_op = 0;
+ }
+ else
+ {
+ src_op = 0;
+ dest_op = 1;
+ }
+ /* Get the destination register. */
+ if (insn->tm->operands == 2)
+ get_register_operand ((insn_word & 0x001F0000) >> 16, operand[dest_op]);
+ /* Get the source operand based on addressing mode. */
+ switch (insn_word & AddressMode)
+ {
+ case AM_REGISTER:
+ /* Check for the NOP instruction before getting the operand. */
+ if ((insn->tm->operand_types[0] & NotReq) == 0)
+ get_register_operand ((insn_word & 0x0000001F), operand[src_op]);
+ break;
+ case AM_DIRECT:
+ sprintf (operand[src_op], "@0x%lX", (insn_word & 0x0000FFFF));
+ break;
+ case AM_INDIRECT:
+ get_indirect_operand ((insn_word & 0x0000FFFF), 2, operand[src_op]);
+ break;
+ case AM_IMM:
+ /* Get the value of the immediate operand based on variable type. */
+ switch (insn->tm->imm_arg_type)
+ {
+ case Imm_Float:
+ cnvt_tmsfloat_ieee ((insn_word & 0x0000FFFF), 2, &f_number);
+ sprintf (operand[src_op], "%2.2f", f_number);
+ break;
+ case Imm_SInt:
+ sprintf (operand[src_op], "%d", (short) (insn_word & 0x0000FFFF));
+ break;
+ case Imm_UInt:
+ sprintf (operand[src_op], "%lu", (insn_word & 0x0000FFFF));
+ break;
+ default:
+ return 0;
+ }
+ /* Handle special case for LDP instruction. */
+ if ((insn_word & 0xFFFFFF00) == LDP_INSN)
+ {
+ strcpy (name, "ldp");
+ sprintf (operand[0], "0x%06lX", (insn_word & 0x000000FF) << 16);
+ operand[1][0] = '\0';
+ }
+ }
+ }
+ /* Handle case for stack and rotate instructions. */
+ else if (insn->tm->operands == 1)
+ {
+ if (insn->tm->opcode_modifier == StackOp)
+ {
+ get_register_operand ((insn_word & 0x001F0000) >> 16, operand[0]);
+ }
+ }
+ /* Output instruction to stream. */
+ info->fprintf_func (info->stream, " %s %s%c%s", name,
+ operand[0][0] ? operand[0] : "",
+ operand[1][0] ? ',' : ' ',
+ operand[1][0] ? operand[1] : "");
+ return 1;
+}
+
+int
+print_three_operand (info, insn_word, insn)
+ disassemble_info *info;
+ unsigned long insn_word;
+ struct instruction *insn;
+{
+ char operand[3][13] =
+ {
+ {0},
+ {0},
+ {0}};
+
+ if (insn->tm == NULL)
+ return 0;
+ switch (insn_word & AddressMode)
+ {
+ case AM_REGISTER:
+ get_register_operand ((insn_word & 0x000000FF), operand[0]);
+ get_register_operand ((insn_word & 0x0000FF00) >> 8, operand[1]);
+ break;
+ case AM_DIRECT:
+ get_register_operand ((insn_word & 0x000000FF), operand[0]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1]);
+ break;
+ case AM_INDIRECT:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0]);
+ get_register_operand ((insn_word & 0x0000FF00) >> 8, operand[1]);
+ break;
+ case AM_IMM:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1]);
+ break;
+ default:
+ return 0;
+ }
+ if (insn->tm->operands == 3)
+ get_register_operand ((insn_word & 0x001F0000) >> 16, operand[2]);
+ info->fprintf_func (info->stream, " %s %s,%s%c%s", insn->tm->name,
+ operand[0], operand[1],
+ operand[2][0] ? ',' : ' ',
+ operand[2][0] ? operand[2] : "");
+ return 1;
+}
+
+int
+print_par_insn (info, insn_word, insn)
+ disassemble_info *info;
+ unsigned long insn_word;
+ struct instruction *insn;
+{
+ size_t i, len;
+ char *name1, *name2;
+ char operand[2][3][13] =
+ {
+ {
+ {0},
+ {0},
+ {0}},
+ {
+ {0},
+ {0},
+ {0}}};
+
+ if (insn->ptm == NULL)
+ return 0;
+ /* Parse out the names of each of the parallel instructions from the
+ q_insn1_insn2 format. */
+ name1 = (char *) strdup (insn->ptm->name + 2);
+ name2 = "";
+ len = strlen (name1);
+ for (i = 0; i < len; i++)
+ {
+ if (name1[i] == '_')
+ {
+ name2 = &name1[i + 1];
+ name1[i] = '\0';
+ break;
+ }
+ }
+ /* Get the operands of the instruction based on the operand order. */
+ switch (insn->ptm->oporder)
+ {
+ case OO_4op1:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][0]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][1]);
+ get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]);
+ get_register_operand ((insn_word >> 22) & 0x07, operand[0][1]);
+ break;
+ case OO_4op2:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][0]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][0]);
+ get_register_operand ((insn_word >> 19) & 0x07, operand[1][1]);
+ get_register_operand ((insn_word >> 22) & 0x07, operand[0][1]);
+ break;
+ case OO_4op3:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][1]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][1]);
+ get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]);
+ get_register_operand ((insn_word >> 22) & 0x07, operand[0][0]);
+ break;
+ case OO_5op1:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][0]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][1]);
+ get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]);
+ get_register_operand ((insn_word >> 19) & 0x07, operand[0][1]);
+ get_register_operand ((insn_word >> 22) & 0x07, operand[0][2]);
+ break;
+ case OO_5op2:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][1]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][1]);
+ get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]);
+ get_register_operand ((insn_word >> 19) & 0x07, operand[0][0]);
+ get_register_operand ((insn_word >> 22) & 0x07, operand[0][2]);
+ break;
+ case OO_PField:
+ if (insn_word & 0x00800000)
+ get_register_operand (0x01, operand[0][2]);
+ else
+ get_register_operand (0x00, operand[0][2]);
+ if (insn_word & 0x00400000)
+ get_register_operand (0x03, operand[1][2]);
+ else
+ get_register_operand (0x02, operand[1][2]);
+ switch (insn_word & P_FIELD)
+ {
+ case 0x00000000:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[0][1]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[0][0]);
+ get_register_operand ((insn_word >> 16) & 0x07, operand[1][1]);
+ get_register_operand ((insn_word >> 19) & 0x07, operand[1][0]);
+ break;
+ case 0x01000000:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[1][0]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[0][0]);
+ get_register_operand ((insn_word >> 16) & 0x07, operand[1][1]);
+ get_register_operand ((insn_word >> 19) & 0x07, operand[0][1]);
+ break;
+ case 0x02000000:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[1][1]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[1][0]);
+ get_register_operand ((insn_word >> 16) & 0x07, operand[0][1]);
+ get_register_operand ((insn_word >> 19) & 0x07, operand[0][0]);
+ break;
+ case 0x03000000:
+ get_indirect_operand ((insn_word & 0x000000FF), 1, operand[1][1]);
+ get_indirect_operand ((insn_word & 0x0000FF00) >> 8, 1, operand[0][0]);
+ get_register_operand ((insn_word >> 16) & 0x07, operand[1][0]);
+ get_register_operand ((insn_word >> 19) & 0x07, operand[0][1]);
+ break;
+ }
+ break;
+ default:
+ return 0;
+ }
+ info->fprintf_func (info->stream, " %s %s,%s%c%s", name1,
+ operand[0][0], operand[0][1],
+ operand[0][2][0] ? ',' : ' ',
+ operand[0][2][0] ? operand[0][2] : "");
+ info->fprintf_func (info->stream, "\n\t\t\t|| %s %s,%s%c%s", name2,
+ operand[1][0], operand[1][1],
+ operand[1][2][0] ? ',' : ' ',
+ operand[1][2][0] ? operand[1][2] : "");
+ free (name1);
+ return 1;
+}
+
+int
+print_branch (info, insn_word, insn)
+ disassemble_info *info;
+ unsigned long insn_word;
+ struct instruction *insn;
+{
+ char operand[2][13] =
+ {
+ {0},
+ {0}};
+ unsigned long address;
+ int print_label = 0;
+
+ if (insn->tm == NULL)
+ return 0;
+ /* Get the operands for 24-bit immediate jumps. */
+ if (insn->tm->operand_types[0] & Imm24)
+ {
+ address = insn_word & 0x00FFFFFF;
+ sprintf (operand[0], "0x%lX", address);
+ print_label = 1;
+ }
+ /* Get the operand for the trap instruction. */
+ else if (insn->tm->operand_types[0] & IVector)
+ {
+ address = insn_word & 0x0000001F;
+ sprintf (operand[0], "0x%lX", address);
+ }
+ else
+ {
+ address = insn_word & 0x0000FFFF;
+ /* Get the operands for the DB instructions. */
+ if (insn->tm->operands == 2)
+ {
+ get_register_operand (((insn_word & 0x01C00000) >> 22) + REG_AR0, operand[0]);
+ if (insn_word & PCRel)
+ {
+ sprintf (operand[1], "%d", (short) address);
+ print_label = 1;
+ }
+ else
+ get_register_operand (insn_word & 0x0000001F, operand[1]);
+ }
+ /* Get the operands for the standard branches. */
+ else if (insn->tm->operands == 1)
+ {
+ if (insn_word & PCRel)
+ {
+ address = (short) address;
+ sprintf (operand[0], "%ld", address);
+ print_label = 1;
+ }
+ else
+ get_register_operand (insn_word & 0x0000001F, operand[0]);
+ }
+ }
+ info->fprintf_func (info->stream, " %s %s%c%s", insn->tm->name,
+ operand[0][0] ? operand[0] : "",
+ operand[1][0] ? ',' : ' ',
+ operand[1][0] ? operand[1] : "");
+ /* Print destination of branch in relation to current symbol. */
+ if (print_label && info->symbols)
+ {
+ asymbol *sym = *info->symbols;
+
+ if ((insn->tm->opcode_modifier == PCRel) && (insn_word & PCRel))
+ {
+ address = (_pc + 1 + (short) address) - ((sym->section->vma + sym->value) / 4);
+ /* Check for delayed instruction, if so adjust destination. */
+ if (insn_word & 0x00200000)
+ address += 2;
+ }
+ else
+ {
+ address -= ((sym->section->vma + sym->value) / 4);
+ }
+ if (address == 0)
+ info->fprintf_func (info->stream, " <%s>", sym->name);
+ else
+ info->fprintf_func (info->stream, " <%s %c %d>", sym->name,
+ ((short) address < 0) ? '-' : '+',
+ abs (address));
+ }
+ return 1;
+}
+
+int
+get_indirect_operand (fragment, size, buffer)
+ unsigned short fragment;
+ int size;
+ char *buffer;
+{
+ unsigned char mod;
+ unsigned arnum;
+ unsigned char disp;
+
+ if (buffer == NULL)
+ return 0;
+ /* Determine which bits identify the sections of the indirect operand based on the
+ size in bytes. */
+ switch (size)
+ {
+ case 1:
+ mod = (fragment & 0x00F8) >> 3;
+ arnum = (fragment & 0x0007);
+ disp = 0;
+ break;
+ case 2:
+ mod = (fragment & 0xF800) >> 11;
+ arnum = (fragment & 0x0700) >> 8;
+ disp = (fragment & 0x00FF);
+ break;
+ default:
+ return 0;
+ }
+ {
+ const ind_addr_type *current_ind = tic30_indaddr_tab;
+ for (; current_ind < tic30_indaddrtab_end; current_ind++)
+ {
+ if (current_ind->modfield == mod)
+ {
+ if (current_ind->displacement == IMPLIED_DISP && size == 2)
+ {
+ continue;
+ }
+ else
+ {
+ size_t i, len;
+ int bufcnt;
+
+ len = strlen (current_ind->syntax);
+ for (i = 0, bufcnt = 0; i < len; i++, bufcnt++)
+ {
+ buffer[bufcnt] = current_ind->syntax[i];
+ if (buffer[bufcnt - 1] == 'a' && buffer[bufcnt] == 'r')
+ buffer[++bufcnt] = arnum + '0';
+ if (buffer[bufcnt] == '(' && current_ind->displacement == DISP_REQUIRED)
+ {
+ sprintf (&buffer[bufcnt + 1], "%u", disp);
+ bufcnt += strlen (&buffer[bufcnt + 1]);
+ }
+ }
+ buffer[bufcnt + 1] = '\0';
+ break;
+ }
+ }
+ }
+ }
+ return 1;
+}
+
+int
+get_register_operand (fragment, buffer)
+ unsigned char fragment;
+ char *buffer;
+{
+ const reg *current_reg = tic30_regtab;
+
+ if (buffer == NULL)
+ return 0;
+ for (; current_reg < tic30_regtab_end; current_reg++)
+ {
+ if ((fragment & 0x1F) == current_reg->opcode)
+ {
+ strcpy (buffer, current_reg->name);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+int
+cnvt_tmsfloat_ieee (tmsfloat, size, ieeefloat)
+ unsigned long tmsfloat;
+ int size;
+ float *ieeefloat;
+{
+ unsigned long exp, sign, mant;
+
+ if (size == 2)
+ {
+ if ((tmsfloat & 0x0000F000) == 0x00008000)
+ tmsfloat = 0x80000000;
+ else
+ {
+ tmsfloat <<= 16;
+ tmsfloat = (long) tmsfloat >> 4;
+ }
+ }
+ exp = tmsfloat & 0xFF000000;
+ if (exp == 0x80000000)
+ {
+ *ieeefloat = 0.0;
+ return 1;
+ }
+ exp += 0x7F000000;
+ sign = (tmsfloat & 0x00800000) << 8;
+ mant = tmsfloat & 0x007FFFFF;
+ if (exp == 0xFF000000)
+ {
+ if (mant == 0)
+ *ieeefloat = ERANGE;
+ if (sign == 0)
+ *ieeefloat = 1.0 / 0.0;
+ else
+ *ieeefloat = -1.0 / 0.0;
+ return 1;
+ }
+ exp >>= 1;
+ if (sign)
+ {
+ mant = (~mant) & 0x007FFFFF;
+ mant += 1;
+ exp += mant & 0x00800000;
+ exp &= 0x7F800000;
+ mant &= 0x007FFFFF;
+ }
+ if (tmsfloat == 0x80000000)
+ sign = mant = exp = 0;
+ tmsfloat = sign | exp | mant;
+ *ieeefloat = *((float *) &tmsfloat);
+ return 1;
+}
diff --git a/contrib/binutils/opcodes/v850-dis.c b/contrib/binutils/opcodes/v850-dis.c
new file mode 100644
index 0000000..da099bf
--- /dev/null
+++ b/contrib/binutils/opcodes/v850-dis.c
@@ -0,0 +1,253 @@
+/* Disassemble V850 instructions.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 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 <stdio.h>
+
+#include "ansidecl.h"
+#include "opcode/v850.h"
+#include "dis-asm.h"
+
+static const char *const v850_reg_names[] =
+{ "r0", "r1", "r2", "sp", "gp", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
+ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
+ "r24", "r25", "r26", "r27", "r28", "r29", "ep", "lp" };
+
+static const char *const v850_sreg_names[] =
+{ "eipc", "eipsw", "fepc", "fepsw", "ecr", "psw", "sr6", "sr7",
+ "sr8", "sr9", "sr10", "sr11", "sr12", "sr13", "sr14", "sr15",
+ "sr16", "sr17", "sr18", "sr19", "sr20", "sr21", "sr22", "sr23",
+ "sr24", "sr25", "sr26", "sr27", "sr28", "sr29", "sr30", "sr31" };
+
+static const char *const v850_cc_names[] =
+{ "v", "c/l", "z", "nh", "s/n", "t", "lt", "le",
+ "nv", "nc/nl", "nz", "h", "ns/p", "sa", "ge", "gt" };
+
+static int
+disassemble (memaddr, info, insn)
+ bfd_vma memaddr;
+ struct disassemble_info *info;
+ unsigned long insn;
+{
+ struct v850_opcode * op = (struct v850_opcode *)v850_opcodes;
+ const struct v850_operand * operand;
+ int match = 0;
+ int short_op = ((insn & 0x0600) != 0x0600);
+ int bytes_read;
+ int target_processor;
+
+
+ bytes_read = short_op ? 2 : 4;
+
+ /* If this is a two byte insn, then mask off the high bits. */
+ if (short_op)
+ insn &= 0xffff;
+
+ switch (info->mach)
+ {
+ case 0:
+ default:
+ target_processor = PROCESSOR_V850;
+ break;
+
+ }
+
+ /* Find the opcode. */
+ while (op->name)
+ {
+ if ((op->mask & insn) == op->opcode
+ && (op->processors & target_processor))
+ {
+ const unsigned char * opindex_ptr;
+ unsigned int opnum;
+ unsigned int memop;
+
+ match = 1;
+ (*info->fprintf_func) (info->stream, "%s\t", op->name);
+/*fprintf (stderr, "match: mask: %x insn: %x, opcode: %x, name: %s\n", op->mask, insn, op->opcode, op->name );*/
+
+ memop = op->memop;
+ /* Now print the operands.
+
+ MEMOP is the operand number at which a memory
+ address specification starts, or zero if this
+ instruction has no memory addresses.
+
+ A memory address is always two arguments.
+
+ This information allows us to determine when to
+ insert commas into the output stream as well as
+ when to insert disp[reg] expressions onto the
+ output stream. */
+
+ for (opindex_ptr = op->operands, opnum = 1;
+ *opindex_ptr != 0;
+ opindex_ptr++, opnum++)
+ {
+ long value;
+ int flag;
+ int status;
+ bfd_byte buffer[ 4 ];
+
+ operand = &v850_operands[*opindex_ptr];
+
+ if (operand->extract)
+ value = (operand->extract) (insn, 0);
+ else
+ {
+ if (operand->bits == -1)
+ value = (insn & operand->shift);
+ else
+ value = (insn >> operand->shift) & ((1 << operand->bits) - 1);
+
+ if (operand->flags & V850_OPERAND_SIGNED)
+ value = ((long)(value << (32 - operand->bits))
+ >> (32 - operand->bits));
+ }
+
+ /* The first operand is always output without any
+ special handling.
+
+ For the following arguments:
+
+ If memop && opnum == memop + 1, then we need '[' since
+ we're about to output the register used in a memory
+ reference.
+
+ If memop && opnum == memop + 2, then we need ']' since
+ we just finished the register in a memory reference. We
+ also need a ',' before this operand.
+
+ Else we just need a comma.
+
+ We may need to output a trailing ']' if the last operand
+ in an instruction is the register for a memory address.
+
+ The exception (and there's always an exception) is the
+ "jmp" insn which needs square brackets around it's only
+ register argument. */
+
+ if (memop && opnum == memop + 1) info->fprintf_func (info->stream, "[");
+ else if (memop && opnum == memop + 2) info->fprintf_func (info->stream, "],");
+ else if (memop == 1 && opnum == 1
+ && (operand->flags & V850_OPERAND_REG))
+ info->fprintf_func (info->stream, "[");
+ else if (opnum > 1) info->fprintf_func (info->stream, ", ");
+
+ /* extract the flags, ignorng ones which do not effect disassembly output. */
+ flag = operand->flags;
+ flag &= ~ V850_OPERAND_SIGNED;
+ flag &= ~ V850_OPERAND_RELAX;
+ flag &= - flag;
+
+ switch (flag)
+ {
+ case V850_OPERAND_REG: info->fprintf_func (info->stream, "%s", v850_reg_names[value]); break;
+ case V850_OPERAND_SRG: info->fprintf_func (info->stream, "%s", v850_sreg_names[value]); break;
+ case V850_OPERAND_CC: info->fprintf_func (info->stream, "%s", v850_cc_names[value]); break;
+ case V850_OPERAND_EP: info->fprintf_func (info->stream, "ep"); break;
+ default: info->fprintf_func (info->stream, "%d", value); break;
+ case V850_OPERAND_DISP:
+ {
+ bfd_vma addr = value + memaddr;
+
+ /* On the v850 the top 8 bits of an address are used by an overlay manager.
+ Thus it may happen that when we are looking for a symbol to match
+ against an address with some of its top bits set, the search fails to
+ turn up an exact match. In this case we try to find an exact match
+ against a symbol in the lower address space, and if we find one, we
+ use that address. We only do this for JARL instructions however, as
+ we do not want to misinterpret branch instructions. */
+ if (operand->bits == 22)
+ {
+ if ( ! info->symbol_at_address_func (addr, info)
+ && ((addr & 0xFF000000) != 0)
+ && info->symbol_at_address_func (addr & 0x00FFFFFF, info))
+ {
+ addr &= 0x00FFFFFF;
+ }
+ }
+ info->print_address_func (addr, info);
+ break;
+ }
+
+ }
+
+ /* Handle jmp correctly. */
+ if (memop == 1 && opnum == 1
+ && ((operand->flags & V850_OPERAND_REG) != 0))
+ (*info->fprintf_func) (info->stream, "]");
+ }
+
+ /* Close any square bracket we left open. */
+ if (memop && opnum == memop + 2)
+ (*info->fprintf_func) (info->stream, "]");
+
+ /* All done. */
+ break;
+ }
+ op++;
+ }
+
+ if (!match)
+ {
+ if (short_op)
+ info->fprintf_func (info->stream, ".short\t0x%04x", insn);
+ else
+ info->fprintf_func (info->stream, ".long\t0x%08x", insn);
+ }
+
+ return bytes_read;
+}
+
+int
+print_insn_v850 (memaddr, info)
+ bfd_vma memaddr;
+ struct disassemble_info * info;
+{
+ int status;
+ bfd_byte buffer[ 4 ];
+ unsigned long insn = 0;
+
+ /* First figure out how big the opcode is. */
+
+ status = info->read_memory_func (memaddr, buffer, 2, info);
+ if (status == 0)
+ {
+ insn = bfd_getl16 (buffer);
+
+ if ( (insn & 0x0600) == 0x0600
+ && (insn & 0xffe0) != 0x0620)
+ {
+ /* If this is a 4 byte insn, read 4 bytes of stuff. */
+ status = info->read_memory_func (memaddr, buffer, 4, info);
+
+ if (status == 0)
+ insn = bfd_getl32 (buffer);
+ }
+ }
+
+ if (status != 0)
+ {
+ info->memory_error_func (status, memaddr, info);
+ return -1;
+ }
+
+ /* Make sure we tell our caller how many bytes we consumed. */
+ return disassemble (memaddr, info, insn);
+}
diff --git a/contrib/binutils/opcodes/v850-opc.c b/contrib/binutils/opcodes/v850-opc.c
new file mode 100644
index 0000000..3a6624b
--- /dev/null
+++ b/contrib/binutils/opcodes/v850-opc.c
@@ -0,0 +1,494 @@
+/* Assemble V850 instructions.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 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 "ansidecl.h"
+#include "opcode/v850.h"
+#include <stdio.h>
+
+/* regular opcode */
+#define OP(x) ((x & 0x3f) << 5)
+#define OP_MASK OP (0x3f)
+
+/* conditional branch opcode */
+#define BOP(x) ((0x0b << 7) | (x & 0x0f))
+#define BOP_MASK ((0x0f << 7) | 0x0f)
+
+/* one-word opcodes */
+#define one(x) ((unsigned int) (x))
+
+/* two-word opcodes */
+#define two(x,y) ((unsigned int) (x) | ((unsigned int) (y) << 16))
+
+
+
+/* The functions used to insert and extract complicated operands. */
+
+/* Note: There is a conspiracy between these functions and
+ v850_insert_operand() in gas/config/tc-v850.c. Error messages
+ containing the string 'out of range' will be ignored unless a
+ specific command line option is given to GAS. */
+
+static const char * not_valid = "displacement value is not in range and is not aligned";
+static const char * out_of_range = "displacement value is out of range";
+static const char * not_aligned = "displacement value is not aligned";
+
+static const char * immediate_out_of_range = "immediate value is out of range";
+
+static unsigned long
+insert_d9 (insn, value, errmsg)
+ unsigned long insn;
+ long value;
+ const char ** errmsg;
+{
+ if (value > 0xff || value < -0x100)
+ {
+ if ((value % 2) != 0)
+ * errmsg = "branch value not in range and to odd offset";
+ else
+ * errmsg = "branch value out of range";
+ }
+ else if ((value % 2) != 0)
+ * errmsg = "branch to odd offset";
+
+ return (insn | ((value & 0x1f0) << 7) | ((value & 0x0e) << 3));
+}
+
+static unsigned long
+extract_d9 (insn, invalid)
+ unsigned long insn;
+ int * invalid;
+{
+ unsigned long ret = ((insn & 0xf800) >> 7) | ((insn & 0x0070) >> 3);
+
+ if ((insn & 0x8000) != 0)
+ ret -= 0x0200;
+
+ return ret;
+}
+
+static unsigned long
+insert_d22 (insn, value, errmsg)
+ unsigned long insn;
+ long value;
+ const char ** errmsg;
+{
+ if (value > 0x1fffff || value < -0x200000)
+ {
+ if ((value % 2) != 0)
+ * errmsg = "branch value not in range and to an odd offset";
+ else
+ * errmsg = "branch value out of range";
+ }
+ else if ((value % 2) != 0)
+ * errmsg = "branch to odd offset";
+
+ return (insn | ((value & 0xfffe) << 16) | ((value & 0x3f0000) >> 16));
+}
+
+static unsigned long
+extract_d22 (insn, invalid)
+ unsigned long insn;
+ int * invalid;
+{
+ signed long ret = ((insn & 0xfffe0000) >> 16) | ((insn & 0x3f) << 16);
+
+ return (unsigned long) ((ret << 10) >> 10);
+}
+
+static unsigned long
+insert_d16_15 (insn, value, errmsg)
+ unsigned long insn;
+ long value;
+ const char ** errmsg;
+{
+ if (value > 0x7fff || value < -0x8000)
+ {
+ if ((value % 2) != 0)
+ * errmsg = not_valid;
+ else
+ * errmsg = out_of_range;
+ }
+ else if ((value % 2) != 0)
+ * errmsg = not_aligned;
+
+ return insn | ((value & 0xfffe) << 16);
+}
+
+static unsigned long
+extract_d16_15 (insn, invalid)
+ unsigned long insn;
+ int * invalid;
+{
+ signed long ret = (insn & 0xfffe0000);
+
+ return ret >> 16;
+}
+
+static unsigned long
+insert_d8_7 (insn, value, errmsg)
+ unsigned long insn;
+ long value;
+ const char ** errmsg;
+{
+ if (value > 0xff || value < 0)
+ {
+ if ((value % 2) != 0)
+ * errmsg = not_valid;
+ else
+ * errmsg = out_of_range;
+ }
+ else if ((value % 2) != 0)
+ * errmsg = not_aligned;
+
+ value >>= 1;
+
+ return (insn | (value & 0x7f));
+}
+
+static unsigned long
+extract_d8_7 (insn, invalid)
+ unsigned long insn;
+ int * invalid;
+{
+ unsigned long ret = (insn & 0x7f);
+
+ return ret << 1;
+}
+
+static unsigned long
+insert_d8_6 (insn, value, errmsg)
+ unsigned long insn;
+ long value;
+ const char ** errmsg;
+{
+ if (value > 0xff || value < 0)
+ {
+ if ((value % 4) != 0)
+ *errmsg = not_valid;
+ else
+ * errmsg = out_of_range;
+ }
+ else if ((value % 4) != 0)
+ * errmsg = not_aligned;
+
+ value >>= 1;
+
+ return (insn | (value & 0x7e));
+}
+
+static unsigned long
+extract_d8_6 (insn, invalid)
+ unsigned long insn;
+ int * invalid;
+{
+ unsigned long ret = (insn & 0x7e);
+
+ return ret << 1;
+}
+
+
+
+/* Warning: code in gas/config/tc-v850.c examines the contents of this array.
+ If you change any of the values here, be sure to look for side effects in
+ that code. */
+const struct v850_operand v850_operands[] =
+{
+#define UNUSED 0
+ { 0, 0, NULL, NULL, 0 },
+
+/* The R1 field in a format 1, 6, 7, or 9 insn. */
+#define R1 (UNUSED + 1)
+ { 5, 0, NULL, NULL, V850_OPERAND_REG },
+
+/* As above, but register 0 is not allowed. */
+#define R1_NOTR0 (R1 + 1)
+ { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 },
+
+/* The R2 field in a format 1, 2, 4, 5, 6, 7, 9 insn. */
+#define R2 (R1_NOTR0 + 1)
+ { 5, 11, NULL, NULL, V850_OPERAND_REG },
+
+/* As above, but register 0 is not allowed. */
+#define R2_NOTR0 (R2 + 1)
+ { 5, 11, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 },
+
+/* The imm5 field in a format 2 insn. */
+#define I5 (R2_NOTR0 + 1)
+ { 5, 0, NULL, NULL, V850_OPERAND_SIGNED },
+
+/* The unsigned imm5 field in a format 2 insn. */
+#define I5U (I5 + 1)
+ { 5, 0, NULL, NULL, 0 },
+
+/* The imm16 field in a format 6 insn. */
+#define I16 (I5U + 1)
+ { 16, 16, NULL, NULL, V850_OPERAND_SIGNED },
+
+/* The signed disp7 field in a format 4 insn. */
+#define D7 (I16 + 1)
+ { 7, 0, NULL, NULL, 0},
+
+/* The disp16 field in a format 6 insn. */
+#define D16_15 (D7 + 1)
+ { 15, 17, insert_d16_15, extract_d16_15, V850_OPERAND_SIGNED },
+
+/* The 3 bit immediate field in format 8 insn. */
+#define B3 (D16_15 + 1)
+ { 3, 11, NULL, NULL, 0 },
+
+/* The 4 bit condition code in a setf instruction */
+#define CCCC (B3 + 1)
+ { 4, 0, NULL, NULL, V850_OPERAND_CC },
+
+/* The unsigned DISP8 field in a format 4 insn. */
+#define D8_7 (CCCC + 1)
+ { 7, 0, insert_d8_7, extract_d8_7, 0 },
+
+/* The unsigned DISP8 field in a format 4 insn. */
+#define D8_6 (D8_7 + 1)
+ { 6, 1, insert_d8_6, extract_d8_6, 0 },
+
+/* System register operands. */
+#define SR1 (D8_6 + 1)
+ { 5, 0, NULL, NULL, V850_OPERAND_SRG },
+
+/* EP Register. */
+#define EP (SR1 + 1)
+ { 0, 0, NULL, NULL, V850_OPERAND_EP },
+
+/* The imm16 field (unsigned) in a format 6 insn. */
+#define I16U (EP + 1)
+ { 16, 16, NULL, NULL, 0},
+
+/* The R2 field as a system register. */
+#define SR2 (I16U + 1)
+ { 5, 11, NULL, NULL, V850_OPERAND_SRG },
+
+/* The disp16 field in a format 8 insn. */
+#define D16 (SR2 + 1)
+ { 16, 16, NULL, NULL, V850_OPERAND_SIGNED },
+
+/* The DISP9 field in a format 3 insn, relaxable. */
+#define D9_RELAX (D16 + 1)
+ { 9, 0, insert_d9, extract_d9, V850_OPERAND_RELAX | V850_OPERAND_SIGNED | V850_OPERAND_DISP },
+
+/* The DISP22 field in a format 4 insn, relaxable.
+ This _must_ follow D9_RELAX; the assembler assumes that the longer
+ version immediately follows the shorter version for relaxing. */
+#define D22 (D9_RELAX + 1)
+ { 22, 0, insert_d22, extract_d22, V850_OPERAND_SIGNED | V850_OPERAND_DISP },
+
+} ;
+
+
+/* reg-reg instruction format (Format I) */
+#define IF1 {R1, R2}
+
+/* imm-reg instruction format (Format II) */
+#define IF2 {I5, R2}
+
+/* conditional branch instruction format (Format III) */
+#define IF3 {D9_RELAX}
+
+/* 3 operand instruction (Format VI) */
+#define IF6 {I16, R1, R2}
+
+/* 3 operand instruction (Format VI) */
+#define IF6U {I16U, R1, R2}
+
+
+
+/* The opcode table.
+
+ The format of the opcode table is:
+
+ NAME OPCODE MASK { OPERANDS } MEMOP PROCESSOR
+
+ NAME is the name of the instruction.
+ OPCODE is the instruction opcode.
+ MASK is the opcode mask; this is used to tell the disassembler
+ which bits in the actual opcode must match OPCODE.
+ OPERANDS is the list of operands.
+ MEMOP specifies which operand (if any) is a memory operand.
+ PROCESSORS specifies which CPU(s) support the opcode.
+
+ The disassembler reads the table in order and prints the first
+ instruction which matches, so this table is sorted to put more
+ specific instructions before more general instructions. It is also
+ sorted by major opcode.
+
+ The table is also sorted by name. This is used by the assembler.
+ When parsing an instruction the assembler finds the first occurance
+ of the name of the instruciton in this table and then attempts to
+ match the instruction's arguments with description of the operands
+ associated with the entry it has just found in this table. If the
+ match fails the assembler looks at the next entry in this table.
+ If that entry has the same name as the previous entry, then it
+ tries to match the instruction against that entry and so on. This
+ is how the assembler copes with multiple, different formats of the
+ same instruction. */
+
+const struct v850_opcode v850_opcodes[] =
+{
+{ "breakpoint", 0xffff, 0xffff, {UNUSED}, 0, PROCESSOR_ALL },
+
+{ "jmp", one (0x0060), one (0xffe0), {R1}, 1, PROCESSOR_ALL },
+
+/* load/store instructions */
+{ "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850 },
+
+
+{ "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850 },
+{ "sld.w", one (0x0500), one (0x0781), {D8_6, EP, R2}, 1, PROCESSOR_ALL },
+{ "sst.b", one (0x0380), one (0x0780), {R2, D7, EP}, 2, PROCESSOR_ALL },
+{ "sst.h", one (0x0480), one (0x0780), {R2, D8_7, EP}, 2, PROCESSOR_ALL },
+{ "sst.w", one (0x0501), one (0x0781), {R2, D8_6, EP}, 2, PROCESSOR_ALL },
+
+
+
+{ "ld.b", two (0x0700, 0x0000), two (0x07e0, 0x0000), {D16, R1, R2}, 1, PROCESSOR_ALL },
+{ "ld.h", two (0x0720, 0x0000), two (0x07e0, 0x0001), {D16_15, R1, R2}, 1, PROCESSOR_ALL },
+{ "ld.w", two (0x0720, 0x0001), two (0x07e0, 0x0001), {D16_15, R1, R2}, 1, PROCESSOR_ALL },
+{ "st.b", two (0x0740, 0x0000), two (0x07e0, 0x0000), {R2, D16, R1}, 2, PROCESSOR_ALL },
+{ "st.h", two (0x0760, 0x0000), two (0x07e0, 0x0001), {R2, D16_15, R1}, 2, PROCESSOR_ALL },
+{ "st.w", two (0x0760, 0x0001), two (0x07e0, 0x0001), {R2, D16_15, R1}, 2, PROCESSOR_ALL },
+
+
+/* arithmetic operation instructions */
+{ "setf", two (0x07e0, 0x0000), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_ALL },
+{ "divh", OP (0x02), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+
+
+{ "nop", one (0x00), one (0xffff), {0}, 0, PROCESSOR_ALL },
+{ "mov", OP (0x10), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "mov", OP (0x00), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "movea", OP (0x31), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "movhi", OP (0x32), OP_MASK, {I16U, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "add", OP (0x0e), OP_MASK, IF1, 0, PROCESSOR_ALL },
+{ "add", OP (0x12), OP_MASK, IF2, 0, PROCESSOR_ALL },
+{ "addi", OP (0x30), OP_MASK, IF6, 0, PROCESSOR_ALL },
+{ "sub", OP (0x0d), OP_MASK, IF1, 0, PROCESSOR_ALL },
+{ "subr", OP (0x0c), OP_MASK, IF1, 0, PROCESSOR_ALL },
+{ "mulh", OP (0x17), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "mulh", OP (0x07), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "mulhi", OP (0x37), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "cmp", OP (0x0f), OP_MASK, IF1, 0, PROCESSOR_ALL },
+{ "cmp", OP (0x13), OP_MASK, IF2, 0, PROCESSOR_ALL },
+
+/* saturated operation instructions */
+{ "satadd", OP (0x11), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "satadd", OP (0x06), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "satsub", OP (0x05), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "satsubi", OP (0x33), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+{ "satsubr", OP (0x04), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
+
+/* logical operation instructions */
+{ "tst", OP (0x0b), OP_MASK, IF1, 0, PROCESSOR_ALL },
+{ "or", OP (0x08), OP_MASK, IF1, 0, PROCESSOR_ALL },
+{ "ori", OP (0x34), OP_MASK, IF6U, 0, PROCESSOR_ALL },
+{ "and", OP (0x0a), OP_MASK, IF1, 0, PROCESSOR_ALL },
+{ "andi", OP (0x36), OP_MASK, IF6U, 0, PROCESSOR_ALL },
+{ "xor", OP (0x09), OP_MASK, IF1, 0, PROCESSOR_ALL },
+{ "xori", OP (0x35), OP_MASK, IF6U, 0, PROCESSOR_ALL },
+{ "not", OP (0x01), OP_MASK, IF1, 0, PROCESSOR_ALL },
+{ "sar", OP (0x15), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL },
+{ "sar", two (0x07e0, 0x00a0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
+{ "shl", OP (0x16), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL },
+{ "shl", two (0x07e0, 0x00c0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
+{ "shr", OP (0x14), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL },
+{ "shr", two (0x07e0, 0x0080), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
+
+/* branch instructions */
+ /* signed integer */
+{ "bgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "blt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "ble", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+ /* unsigned integer */
+{ "bh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+ /* common */
+{ "be", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+ /* others */
+{ "bv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "br", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "bsa", BOP (0xd), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+
+/* Branch macros.
+
+ We use the short form in the opcode/mask fields. The assembler
+ will twiddle bits as necessary if the long form is needed. */
+
+ /* signed integer */
+{ "jgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jlt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jle", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+ /* unsigned integer */
+{ "jh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+ /* common */
+{ "je", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+ /* others */
+{ "jv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jsa", BOP (0xd), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+{ "jbr", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL },
+
+{ "jr", one (0x0780), two (0xffc0, 0x0001), {D22}, 0, PROCESSOR_ALL },
+{ "jarl", one (0x0780), two (0x07c0, 0x0001), {D22, R2}, 0, PROCESSOR_ALL},
+
+/* bit manipulation instructions */
+{ "set1", two (0x07c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
+{ "not1", two (0x47c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
+{ "clr1", two (0x87c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
+{ "tst1", two (0xc7c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
+
+/* special instructions */
+{ "di", two (0x07e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
+{ "ei", two (0x87e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
+{ "halt", two (0x07e0, 0x0120), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
+{ "reti", two (0x07e0, 0x0140), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
+{ "trap", two (0x07e0, 0x0100), two (0xffe0, 0xffff), {I5U}, 0, PROCESSOR_ALL },
+{ "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0xffff), {R1, SR2}, 0, PROCESSOR_ALL },
+{ "stsr", two (0x07e0, 0x0040), two (0x07e0, 0xffff), {SR1, R2}, 0, PROCESSOR_ALL },
+{ 0, 0, 0, {0}, 0, 0 },
+
+} ;
+
+const int v850_num_opcodes =
+ sizeof (v850_opcodes) / sizeof (v850_opcodes[0]);
+
diff --git a/contrib/binutils/opcodes/z8k-dis.c b/contrib/binutils/opcodes/z8k-dis.c
index 8890e12..7123622 100644
--- a/contrib/binutils/opcodes/z8k-dis.c
+++ b/contrib/binutils/opcodes/z8k-dis.c
@@ -1,4 +1,6 @@
-/*
+/* Disassemble z8000 code.
+ Copyright 1992, 1993, 1995, 1998 Free Software Foundation, Inc.
+
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
@@ -67,7 +69,6 @@ fetch_data (info, nibble)
unsigned char mybuf[20];
int status;
instr_data_s *priv = (instr_data_s *)info->private_data;
- bfd_vma start;
if ((nibble % 4) != 0)
abort ();
@@ -164,6 +165,7 @@ print_insn_z8k (addr, info, is_segmented)
}
}
+int
print_insn_z8001 (addr, info)
bfd_vma addr;
disassemble_info *info;
@@ -171,6 +173,7 @@ print_insn_z8001 (addr, info)
return print_insn_z8k (addr, info, 1);
}
+int
print_insn_z8002 (addr, info)
bfd_vma addr;
disassemble_info *info;
@@ -495,26 +498,26 @@ unparse_instr (instr_data)
switch (datum_class)
{
case CLASS_X:
- sprintf (tmp_str, "0x%0x(R%d)", instr_data->address,
+ sprintf (tmp_str, "0x%0lx(R%ld)", instr_data->address,
instr_data->arg_reg[datum_value]);
strcat (out_str, tmp_str);
break;
case CLASS_BA:
- sprintf (tmp_str, "r%d(#%x)", instr_data->arg_reg[datum_value],
+ sprintf (tmp_str, "r%ld(#%lx)", instr_data->arg_reg[datum_value],
instr_data->immediate);
strcat (out_str, tmp_str);
break;
case CLASS_BX:
- sprintf (tmp_str, "r%d(R%d)", instr_data->arg_reg[datum_value],
+ sprintf (tmp_str, "r%ld(R%ld)", instr_data->arg_reg[datum_value],
instr_data->arg_reg[ARG_RX]);
strcat (out_str, tmp_str);
break;
case CLASS_DISP:
- sprintf (tmp_str, "#0x%0x", instr_data->displacement);
+ sprintf (tmp_str, "#0x%0lx", instr_data->displacement);
strcat (out_str, tmp_str);
break;
case CLASS_IMM:
- sprintf (tmp_str, "#0x%0x", instr_data->immediate);
+ sprintf (tmp_str, "#0x%0lx", instr_data->immediate);
strcat (out_str, tmp_str);
break;
case CLASS_CC:
@@ -522,44 +525,44 @@ unparse_instr (instr_data)
strcat (out_str, tmp_str);
break;
case CLASS_CTRL:
- sprintf (tmp_str, "0x%0x", instr_data->ctrl_code);
+ sprintf (tmp_str, "0x%0lx", instr_data->ctrl_code);
strcat (out_str, tmp_str);
break;
case CLASS_DA:
case CLASS_ADDRESS:
- sprintf (tmp_str, "#0x%0x", instr_data->address);
+ sprintf (tmp_str, "#0x%0lx", instr_data->address);
strcat (out_str, tmp_str);
break;
case CLASS_IR:
- sprintf (tmp_str, "@R%d", instr_data->arg_reg[datum_value]);
+ sprintf (tmp_str, "@R%ld", instr_data->arg_reg[datum_value]);
strcat (out_str, tmp_str);
break;
case CLASS_FLAGS:
- sprintf (tmp_str, "0x%0x", instr_data->flags);
+ sprintf (tmp_str, "0x%0lx", instr_data->flags);
strcat (out_str, tmp_str);
break;
case CLASS_REG_BYTE:
if (instr_data->arg_reg[datum_value] >= 0x8)
{
- sprintf (tmp_str, "rl%d",
+ sprintf (tmp_str, "rl%ld",
instr_data->arg_reg[datum_value] - 0x8);
}
else
{
- sprintf (tmp_str, "rh%d", instr_data->arg_reg[datum_value]);
+ sprintf (tmp_str, "rh%ld", instr_data->arg_reg[datum_value]);
}
strcat (out_str, tmp_str);
break;
case CLASS_REG_WORD:
- sprintf (tmp_str, "r%d", instr_data->arg_reg[datum_value]);
+ sprintf (tmp_str, "r%ld", instr_data->arg_reg[datum_value]);
strcat (out_str, tmp_str);
break;
case CLASS_REG_QUAD:
- sprintf (tmp_str, "rq%d", instr_data->arg_reg[datum_value]);
+ sprintf (tmp_str, "rq%ld", instr_data->arg_reg[datum_value]);
strcat (out_str, tmp_str);
break;
case CLASS_REG_LONG:
- sprintf (tmp_str, "rr%d", instr_data->arg_reg[datum_value]);
+ sprintf (tmp_str, "rr%ld", instr_data->arg_reg[datum_value]);
strcat (out_str, tmp_str);
break;
default:
diff --git a/contrib/binutils/symlink-tree b/contrib/binutils/symlink-tree
index bd35f8f..096582d 100755
--- a/contrib/binutils/symlink-tree
+++ b/contrib/binutils/symlink-tree
@@ -34,10 +34,12 @@ for f in `ls -a ${srcdir}`; do
fi
done
if [ -z "${found}" ]; then
+ echo "$f ..working in"
if [ -d $f ]; then true; else mkdir $f; fi
(cd $f; ${prog} ${newsrcdir}/$f "${ignore}")
fi
else
+ echo "$f ..linked"
rm -f $f
ln -s ${srcdir}/$f .
fi
diff --git a/contrib/binutils/ylwrap b/contrib/binutils/ylwrap
new file mode 100755
index 0000000..b5b6218
--- /dev/null
+++ b/contrib/binutils/ylwrap
@@ -0,0 +1,107 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Usage:
+# ylwrap PROGRAM INPUT [OUTPUT DESIRED]... -- [ARGS]...
+# * PROGRAM is program to run.
+# * INPUT is the input file
+# * OUTPUT is file PROG generates
+# * DESIRED is file we actually want
+# * ARGS are passed to PROG
+# Any number of OUTPUT,DESIRED pairs may be used.
+
+# The program to run.
+prog="$1"
+shift
+# Make any relative path in $prog absolute.
+case "$prog" in
+ /*) ;;
+ */*) prog="`pwd`/$prog" ;;
+esac
+
+# The input.
+input="$1"
+shift
+case "$input" in
+ /*)
+ # Absolute path; do nothing.
+ ;;
+ *)
+ # Relative path. Make it absolute. Why? Because otherwise any
+ # debugging info in the generated file will point to the wrong
+ # place. This is really gross.
+ input="`pwd`/$input"
+ ;;
+esac
+
+pairlist=
+while test "$#" -ne 0; do
+ if test "$1" = "--"; then
+ shift
+ break
+ fi
+ pairlist="$pairlist $1"
+ shift
+done
+
+# FIXME: add hostname here for parallel makes that run commands on
+# other machines. But that might take us over the 14-char limit.
+dirname=ylwrap$$
+trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
+mkdir $dirname || exit 1
+
+cd $dirname
+$prog ${1+"$@"} "$input"
+status=$?
+
+if test $status -eq 0; then
+ set X $pairlist
+ shift
+ first=yes
+ while test "$#" -ne 0; do
+ if test -f "$1"; then
+ # If $2 is an absolute path name, then just use that,
+ # otherwise prepend `../'.
+ case "$2" in
+ /*) target="$2";;
+ *) target="../$2";;
+ esac
+ mv "$1" "$target" || status=$?
+ else
+ # A missing file is only an error for the first file. This
+ # is a blatant hack to let us support using "yacc -d". If -d
+ # is not specified, we don't want an error when the header
+ # file is "missing".
+ if test $first = yes; then
+ status=1
+ fi
+ fi
+ shift
+ shift
+ first=no
+ done
+else
+ status=$?
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $status
OpenPOWER on IntegriCloud